ImageD  v2_7_5 (24.06.22)
ImageD is an image processing software designed for rapid prototyping and implementing algorithms and solutions for science, research and teaching.
d_makro_corefoci.h
Go to the documentation of this file.
1 /************************************
2  * added: 26.09.2018 *
3  * author: David Eilenstein *
4  * contact: D.Eilenstein@gsi.de *
5  * project: ImageD *
6  * facility: GSI Darmstadt, Ger *
7  ************************************/
8 
9 #ifndef D_MAKRO_COREFOCI_H
10 #define D_MAKRO_COREFOCI_H
11 
12 //own
13 #include <d_enum.h>
14 #include <scenemousetrack.h>
15 #include <d_img_proc.h>
16 #include <d_plot.h>
17 #include <d_storage.h>
18 #include <d_viewer.h>
19 #include <d_error_handler.h>
20 #include <d_table.h>
21 #include <d_math.h>
23 
24 //general
25 #include <iostream>
26 #include <sstream>
27 #include <fstream>
28 #include <vector>
29 #include <algorithm>
30 #include <iomanip>
31 
32 //Qt
33 #include <QMainWindow>
34 #include <QImage>
35 #include <QPixmap>
36 #include <QGraphicsScene>
37 #include <QFileInfo>
38 #include <QDir>
39 #include <QString>
40 #include <QDebug>
41 #include <QMessageBox>
42 #include <QFileDialog>
43 #include <QFileInfo>
44 #include <QBuffer>
45 #include <QSpacerItem>
46 #include <QElapsedTimer>
47 #include <QComboBox>
48 #include <QDateTime>
49 
50 //openCV
51 #include <opencv2/core/core.hpp>
52 #include <opencv2/highgui/highgui.hpp>
53 #include <opencv2/imgproc/imgproc.hpp>
54 
55 //namespaces
56 using namespace std;
57 //using namespace cv; (prohibited because of abigous names with qtdatavisualization)
58 #include <d_opencv_typedefs.h>
59 
60 namespace Ui {
61 class D_MAKRO_CoreFoci;
62 }
63 
64 class D_MAKRO_CoreFoci : public QMainWindow
65 {
66  Q_OBJECT
67 
68 public:
69  explicit D_MAKRO_CoreFoci(D_Storage *pStorage, QWidget *parent = 0);
71 
72  void resizeEvent(QResizeEvent* event);
73  void closeEvent(QCloseEvent *event);
74  void set_ClosingPossible(bool closeable) {ClosingPossible = closeable;}
75 
76  Mat *get_pMA_Substep(unsigned int vec_number, unsigned int pos);
77  unsigned int get_StepCount_Cores() {return c_ST_C_NUMBER_OF;}
78  unsigned int get_StepCount_Plasma() {return c_ST_P_NUMBER_OF;}
79  unsigned int get_StepCount_Foci() {return c_ST_F_NUMBER_OF;}
80  unsigned int get_StepCount_Results() {return c_ST_R_NUMBER_OF;}
81 
82 public slots:
83 
84  void Update_ImgProc_All();
85 
86 private slots:
87 
88  void Update_Views();
89  void Update_View_Cores();
90  void Update_View_Plasma();
91  void Update_View_Foci();
92  void Update_View_Results();
93  void Update_Ui();
94 
95  void Update_ImgProc_Cores(unsigned int start_step);
96  void Update_ImgProc_Plasma(unsigned int start_step);
97  void Update_ImgProc_Foci(unsigned int start_step);
98  void Update_ImgProc_Results(unsigned int start_step);
99  void Update_Step_Cores(unsigned int step);
100  void Update_Step_Plasma(unsigned int step);
101  void Update_Step_Foci(unsigned int step);
102  void Update_Step_Results(unsigned int step);
103  void Update_Combi_Results();
104  void Update_Combi_Results_Preset(int preset);
105 
106  void Update_Results();
107 
108  void Plot_Cells_Attribute();
109  void Plot_Cells_Attribute_Hist();
110  void Plot_Cells_Attribute_Scatter();
111  void Plot_Image_Attribute();
112  void Plot_Image_Attribute_Hist();
113  void Plot_Image_Attribute_Scatter();
114 
115  void Table_Cells_AttCel();
116  void Table_Cells_AttSta();
117  void Table_Image_AttImg();
118  void Table_Image_AttSta();
119 
120  void Table_Summary();
121 
122  void Parameters_Init();
123  void Parameters_ActivatePreset();
124  void Parameters_ParamSetToUi(vector<double> vParams);
125 
126  void Calc_All();
127  void Calc_Cells_Attrib();
128  void Calc_Cells_Stats();
129 
130  void Load_Images();
131  void Next_Image();
132  void Clear_Images();
133 
134  bool LoadParams_CurrentDir();
135  bool LoadParams();
136  bool LoadParams(QString QS_FileName);
137  void SaveParams();
138 
139  void Stack_Attributes_AskUpdate();
140  void Stack_Attributes_Process();
141  void Stack_Attributes_Init();
142  void Stack_Attributes_Calc();
143  void Stack_Attributes_Calc_Stats();
144  bool Stack_Attributes_Stream_Init();
145  void Stack_Attributes_Stream_Parameters();
146 
147  void Stack_Attributes_Stream_Cells();
148  void Stack_Attributes_Stream_Cells_Images();
149  void Stack_Attributes_Stream_Cells_Tables();
150  void Stack_Attributes_Stream_Cells_Plots();
151 
152  void Stack_Attributes_Stream_Images();
153  void Stack_Attributes_Stream_Images_Images();
154  void Stack_Attributes_Stream_Images_Tables();
155  void Stack_Attributes_Stream_Images_Plots();
156 
157  void Save_Image_Cores();
158  void Save_Image_Plasma();
159  void Save_Image_Foci();
160  void Save_Image_Results();
161  void Save_Plot_Cells();
162  void Save_Plot_Image();
163  void Save_Plot(QChartView *pCV, QString path);
164 
165  void Populate_CB();
166  void Populate_CB(QComboBox *CB, QStringList QSL);
167 
168  void View_BlockSignals(bool block);
169  void Proc_BlocSignals(bool block);
170 
171  void ERR(int err, QString func = "not specified", QString detail = "not specified");
172 
173  void on_spinBox_SetFoci_02_Size_valueChanged(int arg1);
174  void on_doubleSpinBox_SetFoci_02_Sigma_valueChanged(double arg1);
175  void on_spinBox_SetFoci_03_Size_valueChanged(int arg1);
176  void on_doubleSpinBox_SetFoci_03_Offset_valueChanged(double arg1);
177  void on_spinBox_SetFoci_04_Size_valueChanged(int arg1);
178  void on_spinBox_SetFoci_05_Size_valueChanged(int arg1);
179  void on_spinBox_SetFoci_06_Size_Min_valueChanged(int arg1);
180  void on_spinBox_SetFoci_06_Size_Max_valueChanged(int arg1);
181 
182  void on_spinBox_SetCore_02_Gauss_Size_valueChanged(int arg1);
183  void on_doubleSpinBox_SetCore_02_Gauss_Sigma_valueChanged(double arg1);
184  void on_spinBox_SetCore_04_Thres_Size_valueChanged(int arg1);
185  void on_doubleSpinBox_SetCore_04_Thres_Offset_valueChanged(double arg1);
186  void on_spinBox_SetCore_05_Fill_Area_valueChanged(int arg1);
187  void on_spinBox_SetCore_09_Eilenstein_Size_valueChanged(int arg1);
188  void on_doubleSpinBox_Set_Core_09_Eilenstein_Offset_valueChanged(double arg1);
189  void on_spinBox_SetCore_11_Thresh_Thres_valueChanged(int arg1);
190  void on_spinBox_SetCore_12_Open_Area_valueChanged(int arg1);
191  void on_spinBox_SetCore_13_Dilation_Size_valueChanged(int arg1);
192 
193  void on_doubleSpinBox_SetCyto_Gauss_Sigma_valueChanged(double arg1);
194  void on_spinBox_SetCyto_Gauss_Size_valueChanged(int arg1);
195  void on_spinBox_SetCyto_Closing_Size_valueChanged(int arg1);
196  void on_spinBox_SetCyto_Dilation_Size_valueChanged(int arg1);
197 
198  void on_pushButton_ResCol_Preset_ContrastAll_clicked();
199  void on_pushButton_ResCol_Preset_NormalAll_clicked();
200  void on_pushButton_ResCol_Preset_NucSegmentation_clicked();
201  void on_pushButton_ResCol_Preset_Regions_clicked();
202  void on_pushButton_ResCol_Preset_Foci_clicked();
203  void on_pushButton_ResCol_Preset_Plasma_clicked();
204 
205  void on_spinBox_Results_SpreadMax_valueChanged(int arg1);
206 
207  void on_comboBox_FileName_currentIndexChanged(int index);
208 
209  void on_spinBox_SetCyto_Thresh_Size_valueChanged(int arg1);
210  void on_doubleSpinBox_SetCyto_Thresh_Offset_valueChanged(double arg1);
211 
212  void on_checkBox_SetFoci_13_ExcludeBordered_clicked();
213  void on_checkBox_SetCore_13_ExcludeBordered_clicked();
214 
215  void on_pushButton_PresetActivate_clicked();
216 
217  void on_spinBox_SetCore_14_AreaDistMin_valueChanged(int arg1);
218  void on_spinBox_SetCore_14_AreaDistMax_valueChanged(int arg1);
219  void on_spinBox_SetCore_14_AreaMaxOfSmall_valueChanged(int arg1);
220  void on_spinBox_SetCore_14_AreaMinOfBig_valueChanged(int arg1);
221 
222  void on_pushButton_ParamsLoad_clicked();
223  void on_pushButton_ParamsSave_clicked();
224 
225 private:
226  Ui::D_MAKRO_CoreFoci *ui;
227 
228  bool ClosingPossible = false;
229 
230  //Data Storage
231  D_Storage *pStore;
232  vector<Mat> vMA_Cores;
233  vector<Mat> vMA_Plasma;
234  vector<Mat> vMA_Foci;
235  vector<Mat> vMA_Results;
236  Mat MA_Result = Mat();
237  unsigned int pos_dest;
238 
239  //image
240  bool calced_AttCel_cel = false;
241  vector<vector<double>> vvd_AttCel_cel;
242  bool calced_AttSta_cel = false;
243  vector<vector<double>> vvd_AttSta_cel;
244 
245  //stack
246  bool stack_processing = false;
247  int stack_img_curent = 0;
248  bool stack_processed = false;
249  bool calced_AttCel_cel_stack = false;
250  vector<vector<double>> vvd_AttCel_cel_stack;
251  bool calced_AttSta_cel_stack = false;
252  vector<vector<double>> vvd_AttSta_cel_stack;
253 
254 
255  //pathes of images
256  QStringList QSL_Input_Images;
257  QStringList QSL_BaseNames;
258  QStringList QSL_FileNames;
259  QFileInfoList FIL_Input_Images;
260  QString QS_BaseName_Current;
261  QString QS_FileName_Current;
262 
263  //Display images
264  D_Viewer V_Nuclei;
265  D_Viewer V_Plasma;
266  D_Viewer V_Foci;
267  D_Viewer V_Results;
268 
269  //Display plot
270  QChartView *ChartView_Cells;
271  QChart *Chart_Cells;
272  QChartView *ChartView_Image;
273  QChart *Chart_Image;
274 
275  //Tables
276  D_Table Table_CellStat;
277  D_Table Table_ImageStat;
278  D_Table Table_Summary_Single;
279  D_Table Table_Summary_Quotients;
280 
281  //stream to output data
282  QDir DIR_Stream_Main;
283  QDir DIR_Stream_Stack;
284  QDir DIR_Stream_Stack_Images;
285  QDir DIR_Stream_Stack_Tables;
286  QDir DIR_Stream_Stack_Plots;
287  QDir DIR_Stream_Images;
288  QDir DIR_Stream_Images_Sub;
289  QDir DIR_Stream_Other;
290  bool B_Stream_Out = false;
291  vector<int> v_StreamImage_Images;
292  vector<int> v_StreamImage_PlotAttrib;
293  vector<int> v_StreamStack_Images;
294  vector<int> v_StreamStack_PlotAttrib;
295  bool dont_stream = false;
296 
297  //statusbar
298  QLabel *L_SB_PixVal;
299 
300  //ParameterPresets
301  vector<vector<double>> vvd_ParameterPresets_SetPar;
302 
303  //CONSTANTS
304 
305  D_Error_Handler ER;
306 
307  enum c_Presets
308  {
309  c_PRESET_NIKON,
310  c_PRESET_LEICA,
311  c_PRESET_NUMBER_OF
312  };
313  QStringList QSL_PresetNames =
314  {
315  "Nikon",
316  "Leica"
317  };
318 
319  enum c_Parameters
320  {
321  c_PAR_NUC_BLUR_SIZE,
322  c_PAR_NUC_BLUR_SIGMA,
323  c_PAR_NUC_THRES_SIZE,
324  c_PAR_NUC_THRES_OFFSET,
325  c_PAR_NUC_AREA_FILL,
326  c_PAR_NUC_EILENSTEIN_SIZE,
327  c_PAR_NUC_EILENSTEIN_OFFSET,
328  c_PAR_NUC_LOCMAX_THRES,
329  c_PAR_NUC_REMOVE_SMALL,
330  c_PAR_NUC_CONNECT_NEAR,
331  c_PAR_NUC_EXCULDE_BORDER,
332  c_PAR_NUC_AREA_DIST_MIN,
333  c_PAR_NUC_AREA_DIST_MAX,
334  c_PAR_NUC_AREA_MAX_SMALL,
335  c_PAR_NUC_AREA_MIN_BIG,
336  c_PAR_CYT_BLUR_SIZE,
337  c_PAR_CYT_BLUR_SIGMA,
338  c_PAR_CTT_THRES_SIZE,
339  c_PAR_CYT_THRES_SIGMA,
340  c_PAR_CYT_CLOSE_HOLES,
341  c_PAR_CYT_MARGIN,
342  c_PAR_FOCI_BLUR_SIZE,
343  c_PAR_FOCI_BLUR_SIGMA,
344  c_PAR_FOCI_THRES_SIZE,
345  C_PAR_FOCI_THRES_SIGMA,
346  C_PAR_FOCI_MARGIN,
347  C_PAR_FOCI_CONNECT_NEAR,
348  C_PAR_FOCI_AREA_MIN,
349  C_PAR_FOCI_AREA_MAX,
350  C_PAR_FOCI_EXCLUDE_BORDER,
351  C_PAR_FOCI_RES_MAX_EXPECTED,
352  C_PAR_CALC_PX_TO_UM,
353  c_PAR_NUMBER_OF
354  };
355  const QStringList QSL_ParameterNames = {
356  "Nuclei, blur size",
357  "Nuclei, blur sigma",
358  "Nuclei, local adaptive threshold filter size",
359  "Nuclei, local adaptive threshold offset",
360  "Nuclei, fill holes",
361  "Nuclei, local adaptive contrast equilibration (eilenstein filter) size",
362  "Nuclei, local adaptive contrast equilibration (eilenstein filter) offset",
363  "Nuclei, threshold for local maxima",
364  "Nuclei, remove small seeds",
365  "Nuclei, connect near seeds",
366  "Nuclei, eclude border connected",
367  "Nuclei, merge by area context - dist min",
368  "Nuclei, merge by area context - dist max",
369  "Nuclei, merge by area context - max area of small",
370  "Nuclei, merge by area context - min area of big",
371  "Cytoplasma, blur size",
372  "Cytoplasma, blur sigma",
373  "Cytoplasma, local adaptive threshold filter size",
374  "Cytoplasma, local adaptive threshold offset",
375  "Cytoplasma, fill holes",
376  "Cytoplasma, add margin",
377  "Foci, blur size",
378  "Foci, blur sigma",
379  "Foci, local adaptive threshold filter size",
380  "Foci, local adaptive threshold offset",
381  "Foci, add margin to nuclei",
382  "Foci, connect near foci",
383  "Foci, area selection min",
384  "Foci, area selection max",
385  "Foci, exclude border connected",
386  "Results, visualization max value expected",
387  "Calc, px area to um area factor"
388  };
389 
390  //Resulttypes
391  enum c_ResultTypes {
392  c_RES_IMAGE = 0,
393  c_RES_PLOT_CELLS = 1,
394  c_RES_TABLE_CELLS = 2,
395  c_RES_PLOT_IMAGE = 3,
396  c_RES_TABLE_IMAGE = 4,
397  c_RES_NUMBER_OF = 5
398  };
399 
400  //TableTypes
401  enum c_TableTypes {
402  c_TAB_BASIC = 0,
403  c_TAB_STAT = 1,
404  c_TAB_NUMBER_OF = 2
405  };
406  QStringList QSL_TabeleTypes =
407  {
408  "Basic Data",
409  "Statistics"
410  };
411 
412  //Color Combi Results
413  enum c_ColorCombiResults {
414  c_RES_COLOR_NORMAL = 0,
415  c_RES_COLOR_CONTRAST = 1,
416  c_RES_COLOR_NUCLEI = 2,
417  c_RES_COLOR_PLASMA = 3,
418  c_RES_COLOR_FOCI = 4,
419  c_RES_COLOR_REGIONS = 5,
420  c_RES_COLOR_NUMBER_OF = 6
421  };
422  QStringList QSL_ResColor_Presets =
423  {
424  "Normal",
425  "Contrast",
426  "Nuclei",
427  "Plasma",
428  "Foci",
429  "Regions"
430  };
431 
432 
433  //Plot Cell
434  enum c_PlotCell {
435  c_RESPLOCEL_ATT = 0,
436  c_RESPLOCEL_ATT_HIST = 1,
437  c_RESPLOCEL_ATT_SCATTER = 2
438  };
439  QStringList QSL_ResPloCel =
440  {
441  "Attributes",
442  "Attributes Histogram",
443  "Attributes Scatter"
444  };
445 
446  //Res plot image
447  enum c_ResPlotImage {
448  c_RESPLOIMG_ATT = 0,
449  c_RESPLOIMG_ATT_HIST = 1,
450  c_RESPLOIMG_ATT_SCATTER = 2
451  };
452  QStringList QSL_ResPloImg =
453  {
454  "Attributes",
455  "Attributes Histogram",
456  "Attributes Scatter"
457  };
458 
459  //Attributes
460 
461  //Cells
462  enum c_AttCell {
463  c_ATT_CELL_NUCLEUS_AREA_PX,
464  c_ATT_CELL_NUCLEUS_AREA_UM,
465  c_ATT_CELL_CYTO_AREA_PX,
466  c_ATT_CELL_CYTO_AREA_UM,
467  c_ATT_CELL_FOCI_COUNT,
468  c_ATT_CELL_FOCI_AREA_PX,
469  c_ATT_CELL_FOCI_AREA_UM,
470  c_ATT_CELL_NUCLEUS_MEAN_I,
471  c_ATT_CELL_NUMBER_OF
472  };
473  QStringList QSL_AttCel =
474  {
475  "Area of Nucleus px x px",
476  "Area of Nucleus um x um",
477  "Area of Cytoplasma px x px",
478  "Area of Cytoplasma um x um",
479  "Number of Foci",
480  "Area of Foci px x px",
481  "Area of Foci um x um",
482  "Mean Nucleus Intensity"
483  //"Sum Nucleus Intensity"
484  };
485 
486 /*
487  //Images
488  static const unsigned int
489  c_ATT_IMG_NUCLEI_COUNT_SUM = 0,
490  c_ATT_IMG_NUCLEI_AREA_SUM = 1,
491  c_ATT_IMG_NUCLEI_AREA_MEAN = 2,
492  c_ATT_IMG_CYTO_AREA_SUM = 3,
493  c_ATT_IMG_CYTO_AREA_MEAN = 4,
494  c_ATT_IMG_CYTOAREApNUCAREA = 5,
495  c_ATT_IMG_FOCI_COUNT_SUM = 6,
496  //c_ATT_IMG_FOCI_COUNT_MEAN = 7,
497  c_ATT_IMG_FOCICOUNTpNUCCOUNT= 7,
498  c_ATT_IMG_FOCICOUNTpNUCAREA = 8,
499  c_ATT_IMG_FOCICOUNTpCYTOAREA= 9,
500  c_ATT_IMG_FOCI_AREA_SUM = 10,
501  c_ATT_IMG_FOCI_AREA_MEAN = 11,
502  c_ATT_IMG_NUMBER_OF = 12;
503 
504  QStringList QSL_AttImg =
505  {
506  "Nuclei Number Sum",
507  "Nuclei Area Sum",
508  "Nuclei Area Mean",
509  "Cytoplasma Area Sum",
510  "Cytoplasma Area Mean",
511  "Cytoplasma Area per Nuclei Area",
512  "Foci Number Sum",
513  //"Foci Number Mean",
514  "Foci Number per Nuclei Number",
515  "Foci Number per Nuclei Area",
516  "Foci Number per Cytoplasma Area",
517  "Foci Area Sum",
518  "Foci Area Mean"
519  };
520 */
521 
522  //Nuclei Steps
523  enum c_StepNuclei {
524  c_ST_C_LOAD,
525  c_ST_C_INPUT_CONV_8BIT,
526  c_ST_C_INPUT_CONTRAST,
527  c_ST_C_INPUT_BLUR,
528  c_ST_C_BIN_THRES,
529  c_ST_C_BIN_AREA,
530  c_ST_C_BIN_INV,
531  c_ST_C_DIST_TRANSFORM,
532  c_ST_C_RANK_EILENSTEIN,
533  c_ST_C_RANK_CONV_8BIT,
534  c_ST_C_LMAX_BIN,
535  c_ST_C_LMAX_OPEN,
536  c_ST_C_LMAX_DILATION,
537  c_ST_C_SEGM_WATERSHADE,
538  c_ST_C_SEGM_BINARY,
539  c_ST_C_SEGM_AREA_CONNECT,
540  c_ST_C_SEGM_LABELS_FINAL,
541  c_ST_C_SEGM_EDGES,
542  c_ST_C_NUMBER_OF
543  };
544  const QStringList QSL_StepNuclei =
545  {
546  "00 Load Image",
547  "01 Convert to 8bit",
548  "02 Contrast Improvement",
549  "03 Blur",
550  "04 Local adaptive Threshold",
551  "05 Fill Holes selected by Area",
552  "06 Invert",
553  "07 Distance Transformation",
554  "08 Local Rank Eilenstein Filter",
555  "09 Convert to 8bit",
556  "10 Binarize to get initial Seeds",
557  "11 Remove Small Seeds",
558  "12 Connect Near Seeds",
559  "13 Watershed Segmentation",
560  "14 Binary Nuclei",
561  "15 Connect small Nuclei to nearby big Nuclei",
562  "16 Final Nuclei Segmentation",
563  "17 Edges of segmented Nuclei"
564  };
565 
566  //Plasma Steps
567  enum c_StepPlasma {
568  c_ST_P_LOAD,
569  c_ST_P_INPUT_CONV_8BIT,
570  c_ST_P_INPUT_CONTRAST,
571  c_ST_P_INPUT_BLUR,
572  c_ST_P_BIN_THRES,
573  c_ST_P_MORPH_CLOSE,
574  c_ST_P_MORPH_DILATE,
575  c_ST_P_REG_PLASMA,
576  c_ST_P_REG_PLASMA_EDGES,
577  c_ST_P_NUMBER_OF
578  };
579  const QStringList QSL_StepPlasma =
580  {
581  "00 Load Image",
582  "01 Convert to 8bit",
583  "02 Contrast Improvement",
584  "03 Blur",
585  "04 Local adaptive Threshold",
586  "05 Closing Holes",
587  "06 Dilation",
588  "07 Cytoplasma Regions",
589  "08 Edges of Cytoplasma Regions"
590  };
591 
592  //Foci Steps
593  enum c_StepFoci {
594  c_ST_F_LOAD,
595  c_ST_F_INPUT_CONV_8BIT,
596  c_ST_F_INPUT_CONTRAST,
597  c_ST_F_INPUT_BLUR,
598  c_ST_F_BIN_THRES,
599  c_ST_F_ROI_NUC_MARGIN,
600  c_ST_F_ROI,
601  c_ST_F_ROI_EDEGS,
602  c_ST_F_OUT_CORES,
603  c_ST_F_OUT_CORES_CLOSE,
604  c_ST_F_OUT_CORES_AREA,
605  c_ST_F_CENTROID,
606  c_ST_F_REGIONS_NUCLEI,
607  c_ST_F_REGIONS_SEEDS,
608  c_ST_F_REGIONS_ROI2LABEL,
609  c_ST_F_REGIONS_CELLS_APPROX,
610  c_ST_F_REGIONS_8BIT,
611  c_ST_F_CENTROID_CORES,
612  c_ST_F_NUMBER_OF
613  };
614  const QStringList QSL_StepFoci =
615  {
616  "00 Load Image",
617  "01 Convert to 8bit",
618  "02 Contrast Improvement",
619  "03 Blur",
620  "04 Local adaptive Threshold",
621  "05 Nuclei with additional Margin",
622  "06 Cytoplasmatic Region but without Nuclei",
623  "07 Edges of ROI to detect Foci in it",
624  "08 Apply ROI to binary Foci Image",
625  "09 Connect near Foci",
626  "10 Select Foci by Area",
627  "11 Reduce Foci to Centroids",
628  "12 Nuclei as initial Seed for Cells",
629  "13 Erode Seeds",
630  "14 Possible Cell Area",
631  "15 Watershed Segmentation of Nuclei in Cytoplasma to approximate Cells",
632  "16 Convert to 8bit",
633  "17 Assign Foci to Cells"
634  };
635 
636  //Results
637  enum c_Results {
638  c_ST_R_EMPTY,
639  c_ST_R_C_INPUT,
640  c_ST_R_C_CONTRAST,
641  c_ST_R_C_BINARY,
642  c_ST_R_C_SEEDS,
643  c_ST_R_C_EDGES,
644  c_ST_R_P_INPUT,
645  c_ST_R_P_CONTRAST,
646  c_ST_R_P_BINARY,
647  c_ST_R_P_EDGES,
648  c_ST_R_F_INPUT,
649  c_ST_R_F_CONTRAST,
650  c_ST_R_F_BINARY,
651  c_ST_R_F_SELECTED,
652  c_ST_R_F_DOT,
653  c_ST_R_R_ROI,
654  c_ST_R_R_ROI_EDGES,
655  c_ST_R_R_EDGES,
656  c_ST_R_NUMBER_OF
657  };
658 };
659 
660 #endif // D_MAKRO_COREFOCI_H
Mat
cv::Mat Mat
Definition: d_opencv_typedefs.h:28
ER_okay
@ ER_okay
Definition: d_enum.h:133
D_Math::Function_2D_to_1D
static function< double(double x, double y)> Function_2D_to_1D(int type, double a=1, double b=0, double c=1, double d=0, double e=0, double f=0, double nan_val=0, double inf_val=0)
Definition: d_math.cpp:88
D_Img_Proc::Math_ImgImg_Diff
static int Math_ImgImg_Diff(Mat *pMA_Out, Mat *pMA_In1, Mat *pMA_In2)
Definition: d_img_proc.cpp:13125
D_QS_Version
const QString D_QS_Version
Definition: d_enum.h:18
d_math.h
D_Img_Proc::Threshold_Adaptive
static int Threshold_Adaptive(Mat *pMA_Out, Mat *pMA_In, int out_mode, double max_val, int adapt_mode, unsigned int mask_size, double offset)
Definition: d_img_proc.cpp:6669
D_MAKRO_CoreFoci::get_StepCount_Plasma
unsigned int get_StepCount_Plasma()
Definition: d_makro_corefoci.h:78
d_viewer.h
d_plot.h
D_Img_Proc::Spread_16_bit_to_8bit
static int Spread_16_bit_to_8bit(Mat *pMA_Out, Mat *pMA_In, double in_max, double out_max)
Definition: d_img_proc.cpp:3903
D_Img_Proc::Histo_Equal
static int Histo_Equal(Mat *pMA_Out, Mat *pMA_In)
Definition: d_img_proc.cpp:14397
D_Img_Proc::Split_img2vv_value
static int Split_img2vv_value(vector< vector< double >> *vv_data_LabPix, Mat *pMA_Value, Mat *pMA_Label, bool ignore_0)
Definition: d_img_proc.cpp:14833
D_Viewer
The D_Viewer class Display images (Mat) in QGraphicsView in the user interface.
Definition: d_viewer.h:58
d_value_distribution_list.h
D_Storage
The D_Storage class Used for storing data. There is only one instance in D_MainWindow .
Definition: d_storage.h:49
scenemousetrack.h
D_Table::set_data_d_2D_qsl_count
void set_data_d_2D_qsl_count(vector< vector< double >> vv_data, QStringList qsl_col_names)
Definition: d_table.cpp:98
D_Img_Proc::Normalize
static int Normalize(Mat *pMA_Out, Mat *pMA_In, unsigned int norm, unsigned int type, double min, double max)
Definition: d_img_proc.cpp:3814
D_MAKRO_CoreFoci::closeEvent
void closeEvent(QCloseEvent *event)
Definition: d_makro_corefoci.cpp:196
D_Img_Proc::Reduce_Centroid
static int Reduce_Centroid(Mat *pMA_Out, Mat *pMA_In, int thickness=1)
Definition: d_img_proc.cpp:16524
D_Viewer::Update_Image
void Update_Image(Mat *MA_new)
D_Viewer::Update_Image Set and show image.
Definition: d_viewer.cpp:2079
BORDER_REFLECT
const int BORDER_REFLECT
Definition: d_opencv_typedefs.h:79
D_Math::Condition_2D
static function< bool(double x, double y)> Condition_2D(int type, double a=1, double b=0, double c=1, double d=0, double e=0, double f=0, double g=0, double h=0)
Definition: d_math.cpp:944
d_table.h
D_Table::Save_Table
QString Save_Table()
Definition: d_table.cpp:186
D_Img_Proc::Labeling
static int Labeling(Mat *pMA_Out, Mat *pMA_In, int connectivity, int out_depth)
Definition: d_img_proc.cpp:12350
D_Img_Proc::Transformation_Distance
static int Transformation_Distance(Mat *pMA_Out, Mat *pMA_In, int metric, int precision)
Definition: d_img_proc.cpp:7486
D_MAKRO_CoreFoci::get_StepCount_Results
unsigned int get_StepCount_Results()
Definition: d_makro_corefoci.h:80
D_MAKRO_CoreFoci::get_pMA_Substep
Mat * get_pMA_Substep(unsigned int vec_number, unsigned int pos)
Definition: d_makro_corefoci.cpp:209
D_Img_Proc::Split_ObjectAreas
static int Split_ObjectAreas(vector< double > *v_objects, vector< double > *v_areas, Mat *pMA_Label, Mat *pMA_Objects, int connectivity)
Definition: d_img_proc.cpp:15179
D_Table::set_TW
void set_TW(QTableWidget *TW)
Definition: d_table.cpp:16
D_Storage::dir_M_dsDNA
QDir * dir_M_dsDNA()
Definition: d_storage.h:70
D_QS_Release
const QString D_QS_Release
Definition: d_enum.h:19
D_Stat::Function_SingleStat
static function< double(vector< double >)> Function_SingleStat(int stat)
Definition: d_stat.cpp:683
D_Viewer::Save_Image_Dialog
QString Save_Image_Dialog()
D_Viewer::Save_Image_Dialog Opens a dialog to save the show image (generated default path)
Definition: d_viewer.cpp:2105
MORPH_CLOSE
const int MORPH_CLOSE
Definition: d_opencv_typedefs.h:92
D_Img_Proc::Filter_Function
static int Filter_Function(Mat *pMA_Out, Mat *pMA_In, Mat *pMA_Mask, function< double(double cur, double nei)> F1_CenterImage, function< double(double f1r, double msk)> F2_f1mask, function< double(vector< double > vf2r)> F3_Combine, function< double(double f3r, double cen)> F4_f3center, int border_type=BORDER_CONSTANT, bool DoNonZeroMaskOnly=false)
Definition: d_img_proc.cpp:11397
D_Img_Proc::Duplicate
static int Duplicate(Mat *pMA_Out, Mat *pMA_In)
Definition: d_img_proc.cpp:2397
c_STAT_COUNT
@ c_STAT_COUNT
Definition: d_enum.h:734
D_MAKRO_CoreFoci::Update_ImgProc_All
void Update_ImgProc_All()
Definition: d_makro_corefoci.cpp:279
D_Plot::Plot_Hist_Single_Classes
static int Plot_Hist_Single_Classes(QChartView *pChartView, vector< double > *v_hist, double min, double step, QString name_title, QString name_series, QString name_x, QString name_y, bool ignore_first)
Definition: d_plot.cpp:769
c_MATH_2D_TO_1D_X
@ c_MATH_2D_TO_1D_X
Definition: d_enum.h:1032
D_Table::set_data_d_1D_qs_qsl
void set_data_d_1D_qs_qsl(vector< double > v_data, QString qs_col_name, QStringList qsl_row_names)
Definition: d_table.cpp:23
c_COND_INTERVALS_IN_INCL_AND
@ c_COND_INTERVALS_IN_INCL_AND
Definition: d_enum.h:1211
MORPH_RECT
const int MORPH_RECT
Definition: d_opencv_typedefs.h:86
d_img_proc.h
D_Table
The D_Table class Display tables in QTableWidget in the user interface.
Definition: d_table.h:42
D_Error_Handler
The D_Error_Handler class takes error codes from D_ERROR_ENUM and shows a popup if an error occures.
Definition: d_error_handler.h:38
MORPH_ERODE
const int MORPH_ERODE
Definition: d_opencv_typedefs.h:89
D_Img_Proc::Mask_1C
static int Mask_1C(Mat *pMA_Out, Mat *pMA_In, Mat *pMA_Mask)
Definition: d_img_proc.cpp:14214
D_Table::set_data_d_2D_qsl_qsl
void set_data_d_2D_qsl_qsl(vector< vector< double >> vv_data, QStringList qsl_col_names, QStringList qsl_row_names)
Definition: d_table.cpp:74
MORPH_OPEN
const int MORPH_OPEN
Definition: d_opencv_typedefs.h:91
c_CONNECT_IN_RANGE
@ c_CONNECT_IN_RANGE
Definition: d_enum.h:1267
MORPH_DILATE
const int MORPH_DILATE
Definition: d_opencv_typedefs.h:88
Scalar
cv::Scalar Scalar
Definition: d_opencv_typedefs.h:30
c_STAT_SUM
@ c_STAT_SUM
Definition: d_enum.h:737
D_Img_Proc::Transformation_Watershed_Auto
static int Transformation_Watershed_Auto(Mat *pMA_Out, Mat *pMA_In, Mat *pMA_Marker, bool include_not_seeded, bool conv_8bit, bool exclude_border)
Definition: d_img_proc.cpp:7573
D_Storage::set_dir_M_dsDNA
void set_dir_M_dsDNA(QString path)
Definition: d_storage.h:98
D_Plot::Plot_BarCore_Single
static int Plot_BarCore_Single(QChartView *pChartView, vector< double > v_data, QString name_title, QString name_series, QStringList name_categories, QString name_x, QString name_y)
Definition: d_plot.cpp:1333
D_Table::clear_data
void clear_data()
Definition: d_table.cpp:148
D_Viewer::set_GV
void set_GV(QGraphicsView *GV_ui)
Definition: d_viewer.cpp:49
c_MATH_2D_TO_1D_X_greater_Y
@ c_MATH_2D_TO_1D_X_greater_Y
Definition: d_enum.h:1041
D_Plot::Plot_Empty
static int Plot_Empty(QChartView *pChartView, QString QS_Text="No_Additional_Information")
Definition: d_plot.cpp:16
D_Viewer::clear_Image
void clear_Image()
Definition: d_viewer.cpp:74
Ui
Definition: d_analysiswindow.h:58
ER_other
@ ER_other
Definition: d_enum.h:134
D_Img_Proc::Morphology_Elemental
static int Morphology_Elemental(Mat *pMA_Out, Mat *pMA_In, int morph_type, int elem_type, unsigned int elem_size_X, unsigned int elem_size_Y, int border_type, unsigned int iterations)
Definition: d_img_proc.cpp:7041
D_Img_Proc::Math_ImgSelf_Not
static int Math_ImgSelf_Not(Mat *pMA_Out, Mat *pMA_In)
Definition: d_img_proc.cpp:12999
d_makro_corefoci.h
d_storage.h
D_Plot::Plot_Scatter_2D_Single_Y
static int Plot_Scatter_2D_Single_Y(QChartView *pChartView, vector< double > v_X_Val, vector< double > v_Y_Val, QString name_title, QString name_series, QString name_x, QString name_y, bool man_axis_style_x=false, bool man_axis_style_y=false, double man_min_x=0, double man_max_x=1, double man_min_y=0, double man_max_y=1, int ticks_x=AXE_TICK_COUNT_MAJOR_DEFAULT, int ticks_y=AXE_TICK_COUNT_MAJOR_DEFAULT)
Definition: d_plot.cpp:1690
ER_type_missmatch
@ ER_type_missmatch
Definition: d_enum.h:137
MORPH_ELLIPSE
const int MORPH_ELLIPSE
Definition: d_opencv_typedefs.h:87
D_Img_Proc::Threshold_Absolute_1C
static int Threshold_Absolute_1C(Mat *pMA_Out, Mat *pMA_In, double thres_abs)
Definition: d_img_proc.cpp:6553
D_Img_Proc::Math_ImgImg_BitOr
static int Math_ImgImg_BitOr(Mat *pMA_Out, Mat *pMA_In1, Mat *pMA_In2)
Definition: d_img_proc.cpp:13202
D_Img_Proc::Load_From_Path_Multi
static int Load_From_Path_Multi(Mat *pMA_Out, QString path, unsigned int page)
Definition: d_img_proc.cpp:315
d_opencv_typedefs.h
c_GEO_CONTOUR
@ c_GEO_CONTOUR
Definition: d_enum.h:2052
D_MAKRO_CoreFoci::D_MAKRO_CoreFoci
D_MAKRO_CoreFoci(D_Storage *pStorage, QWidget *parent=0)
Definition: d_makro_corefoci.cpp:12
c_COMPDIST_CONTOUR
@ c_COMPDIST_CONTOUR
Definition: d_enum.h:2087
D_Viewer::connect_Zoom
void connect_Zoom(D_Viewer *viewer)
Definition: d_viewer.cpp:128
QSL_StatList
const QStringList QSL_StatList
Definition: d_enum.h:797
D_MAKRO_CoreFoci::get_StepCount_Foci
unsigned int get_StepCount_Foci()
Definition: d_makro_corefoci.h:79
d_enum.h
D_Img_Proc::Select_Area
static int Select_Area(Mat *pMA_Out, Mat *pMA_In, unsigned int area_min, unsigned int area_max, int connectivity)
Definition: d_img_proc.cpp:16167
D_Img_Proc::Reduce_Geometric
static int Reduce_Geometric(Mat *pMA_Out, Mat *pMA_In, int geometric, int connectivity=8, int thickness=1, uchar value=255)
Definition: d_img_proc.cpp:16215
D_Viewer::Save_Image
QString Save_Image()
D_Viewer::Save_Image Saves the image at FI_LastSaved.
Definition: d_viewer.cpp:2157
D_Img_Proc::Math_ImgImg_BitAnd
static int Math_ImgImg_BitAnd(Mat *pMA_Out, Mat *pMA_In1, Mat *pMA_In2)
Definition: d_img_proc.cpp:13187
d_error_handler.h
D_Img_Proc::Merge
static int Merge(Mat *pMA_Out, Mat *pMA_In0, Mat *pMA_In1, Mat *pMA_In2, Mat *pMA_In3, unsigned int channels, bool channel_use[4])
Definition: d_img_proc.cpp:4060
BORDER_DEFAULT
const int BORDER_DEFAULT
Definition: d_opencv_typedefs.h:78
D_Storage::get_Adress
Mat * get_Adress(size_t pos)
Definition: d_storage.h:54
D_Img_Proc::Filter_Gauss
static int Filter_Gauss(Mat *pMA_Out, Mat *pMA_In, int size_x, int size_y, int border, double sigma_x, double sigma_y)
Definition: d_img_proc.cpp:9083
D_MAKRO_CoreFoci::resizeEvent
void resizeEvent(QResizeEvent *event)
Definition: d_makro_corefoci.cpp:190
D_Stat::Calc_Vector2Hist_1
static int Calc_Vector2Hist_1(vector< double > *v_hist, vector< double > *v_data, unsigned int class_count, double *min_ext, double *max_ext, double *max_y_ext, double *step_ext, bool accumulate, bool uniform)
Definition: d_stat.cpp:3688
D_Img_Proc::Threshold_Value
static int Threshold_Value(Mat *pMA_Out, Mat *pMA_In, int out_mode, double max_val, double thres)
Definition: d_img_proc.cpp:6638
D_MAKRO_CoreFoci::get_StepCount_Cores
unsigned int get_StepCount_Cores()
Definition: d_makro_corefoci.h:77
D_Stat::Calc_Stats
static int Calc_Stats(vector< double > *v_stats, vector< double > v_data, bool calc_sorted)
Definition: d_stat.cpp:16
D_MAKRO_CoreFoci::set_ClosingPossible
void set_ClosingPossible(bool closeable)
Definition: d_makro_corefoci.h:74
D_Img_Proc::Threshold_Absolute
static int Threshold_Absolute(Mat *pMA_Out, Mat *pMA_In, double thres_abs)
Definition: d_img_proc.cpp:6440
D_Img_Proc::Feature_Connect
static int Feature_Connect(Mat *pMA_Out, Mat *pMA_In, int pt_type1, int pt_type2, double dist_min, double dist_max, int feat1, int feat2, function< bool(double, double)> comp, int connect_mode=c_CONNECT_CLOSEST, int connectivity=4, int thickness=2)
Definition: d_img_proc.cpp:15901
D_MAKRO_CoreFoci::~D_MAKRO_CoreFoci
~D_MAKRO_CoreFoci()
Definition: d_makro_corefoci.cpp:185
D_MAKRO_CoreFoci
Definition: d_makro_corefoci.h:65
c_FEAT_AREA
@ c_FEAT_AREA
Definition: d_enum.h:1347
c_STAT_MEAN_ARITMETIC
@ c_STAT_MEAN_ARITMETIC
Definition: d_enum.h:740
D_Img_Proc::Filter_Laplace
static int Filter_Laplace(Mat *pMA_Out, Mat *pMA_In, int size, int border, int out_depth, double scale, double delta)
Definition: d_img_proc.cpp:10694
ER_empty
@ ER_empty
Definition: d_enum.h:135