 |
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.
|
Go to the documentation of this file.
9 #ifndef D_MAKRO_CELLCOLONIES_H
10 #define D_MAKRO_CELLCOLONIES_H
22 #include <QMainWindow>
23 #include <QFileDialog>
25 #include <QFileInfoList>
42 #include <opencv2/core/core.hpp>
43 #include <opencv2/highgui/highgui.hpp>
44 #include <opencv2/imgproc/imgproc.hpp>
63 void closeEvent(QCloseEvent *event);
73 void Save_Analysis_Dialog();
75 void Save_Processing_Chain();
76 void Save_Image(
D_Viewer *viewer, QString name_default);
77 void Save_Image_Cells();
78 void Save_Image_Results_Color();
79 void Save_Image_Results_Surrival();
80 void Save_Image_Results_Segmentation();
81 void Save_Image_Results_Attribute();
82 void Save_Plot(QChartView *pCV_Save, QString name_default);
83 void Save_Plot_Colony();
84 void Save_Plot_Image();
85 void Save_Plot_Surrival();
86 void Save_Parameters();
92 void Update_View_Cells();
93 void Update_View_Results();
94 void Update_View_Surrival();
95 void Update_View_Segmentation();
96 void Update_View_Attribute();
100 void Update_Images();
101 void Update_Image_Cells();
102 void Update_Image_Results();
103 void Update_Image_Surrival();
104 void Update_Image_Segmentation();
105 void Update_Image_Attribute();
108 void Update_Results();
111 void Settings_Reset();
114 void Update_ImgProc();
115 void Update_ImgProc_Cells(
int start_step);
116 void Update_ImgProc_Results(
int start_step);
117 void Update_Step_Cells(
int step);
118 void Update_Step_Results(
int step);
122 void Calc_Colony_Values_Split();
123 void Calc_Colony_Stats();
124 void Calc_Colony_Attributes();
125 void Calc_Image_Stats();
126 void Calc_Colony_Survival();
129 void Plot_Histogram_Colonies();
130 void Plot_Stat_Compare();
131 void Plot_MM_Colonies();
132 void Plot_CSK_Colonies();
133 void Plot_Quantiles_Colonies();
134 void Plot_Histogram_Image();
135 void Plot_Attribute_Compare();
136 void Plot_Colony_Surrival();
137 void Plot_Radial_Transmission_Colony();
140 void Populate_CB_Single(QComboBox *CB, QStringList QSL,
int index_init);
141 void Populate_CB_Stat();
142 void Populate_CB_Attribute();
143 void Populate_CB_Typ();
146 void on_doubleSpinBox_ProcCon_ROI_X1_valueChanged(
double arg1);
147 void on_doubleSpinBox_ProcCon_ROI_Y1_valueChanged(
double arg1);
148 void on_doubleSpinBox_ProcCon_ROI_X2_valueChanged(
double arg1);
149 void on_doubleSpinBox_ProcCon_ROI_Y2_valueChanged(
double arg1);
150 void on_spinBox_ProcCon_ColGrab_H_Min_valueChanged(
int arg1);
151 void on_spinBox_ProcCon_ColGrab_S_Min_valueChanged(
int arg1);
152 void on_spinBox_ProcCon_ColGrab_V_Min_valueChanged(
int arg1);
153 void on_spinBox_ProcCon_ColGrab_H_Max_valueChanged(
int arg1);
154 void on_spinBox_ProcCon_ColGrab_S_Max_valueChanged(
int arg1);
155 void on_spinBox_ProcCon_ColGrab_V_Max_valueChanged(
int arg1);
156 void on_spinBox_ProcCon_CellCol_Black_Noise_valueChanged(
int arg1);
157 void on_spinBox_ProcCon_CellCol_White_Noise_valueChanged(
int arg1);
158 void on_spinBox_ProcCon_Seed_Blur_Size_valueChanged(
int arg1);
159 void on_doubleSpinBox_ProcCon_Seed_Blur_Sigma_valueChanged(
double arg1);
160 void on_spinBox_ProcCon_Thres_Size_valueChanged(
int arg1);
161 void on_doubleSpinBox_ProcCon_Thres_Offset_valueChanged(
double arg1);
162 void on_spinBox_ProcCon_Seed_Open_Size_valueChanged(
int arg1);
163 void on_checkBox_ProcCon_Watershed_Border_stateChanged(
int arg1);
164 void on_checkBox_ProcCon_Watershed_nSeed_stateChanged(
int arg1);
165 void on_spinBox_ProcCon_Ref_Blur_Size_valueChanged(
int arg1);
166 void on_doubleSpinBox_ProcCon_Ref_Blur_Sigma_valueChanged(
double arg1);
169 void on_action_Last_Image_triggered();
170 void on_action_Next_Image_triggered();
173 void on_comboBox_ProcView_Image_currentIndexChanged(
const QString &arg1);
178 void on_doubleSpinBox_Extract_Asphere_Thres_valueChanged(
double arg1);
180 void on_doubleSpinBox_Separtate_Asphere_Thres_valueChanged(
double arg1);
182 void on_doubleSpinBox_Measure_Base_valueChanged(
double arg1);
184 void on_doubleSpinBox_Measure_Factor_valueChanged(
double arg1);
186 void on_doubleSpinBox_Sur_CellCount_valueChanged(
double arg1);
189 Ui::D_MAKRO_CellColonies *ui;
191 bool ClosingPossible =
false;
198 QFileInfoList FIL_Input_Images;
199 QFileInfo FI_Reference_Image;
200 QString QS_BaseName_Current =
"";
204 vector<Mat> vMA_Cells;
205 vector<Mat> vMA_Results;
207 Mat MA_Result_Surrival;
208 Mat MA_Result_Segmentation;
209 Mat MA_Result_Attribute;
210 bool Loaded_FileInfos =
false;
213 vector<vector<vector<double>>> vvvd_TypColVal;
214 vector<vector<vector<double>>> vvvd_TypColSta;
215 vector<vector<double>> vvd_AttCol_new;
216 vector<vector<double>> vvd_AttSta_new;
217 vector<int> vi_ColSur_new;
218 bool Calced_TypColVal =
false;
219 bool Calced_TypColSta =
false;
220 bool Calced_AttCol_new =
false;
221 bool Calced_AttSta_new =
false;
222 bool Calced_ColSur_new =
false;
227 QChartView *pChartView_Colony;
228 QChartView *pChartView_Image;
229 QChartView *pChartView_Surrival;
230 QChart *pChart_Colony;
231 QChart *pChart_Image;
232 QChart *pChart_Surrival;
243 QLabel *L_SB_ValAtPos;
253 bool stream_active =
false;
254 bool stack_proc_active =
false;
256 QDir DIR_Stream_Processing;
257 QDir DIR_Stream_Stack;
258 QDir DIR_Stream_Stack_Labeling;
259 QDir DIR_Stream_Stack_Surrival;
260 QDir DIR_Stream_Stack_Attribute;
261 ofstream OS_Parameters;
263 ofstream OS_Raw_Data;
265 ofstream OS_Stack_Summary;
271 static unsigned const int
272 c_ST_REFERENCE_LOAD = 0,
273 c_ST_REFERENCE_CROP = 1,
274 c_ST_REFERENCE_BLUR = 2,
277 c_ST_INPUT_ANTI_SHADE = 5,
278 c_ST_CELLS_GRAB_COLOR = 6,
279 c_ST_CELLS_BINARY = 7,
280 c_ST_CELLS_NOISE_BLACK = 8,
281 c_ST_CELLS_NOISE_WHITE = 9,
283 c_ST_SEED_SATURATION = 11,
285 c_ST_SEED_THRESH = 13,
287 c_ST_SEED_SPHERICITY_INV= 15,
288 c_ST_SEED_ASPH_EXTRACT = 16,
289 c_ST_SEED_ASPH_DISTANCE = 17,
290 c_ST_SEED_ASPH_SEPARATE = 18,
291 c_ST_SEED_SPHERE_EXTRACT= 19,
292 c_ST_SEED_ALL_SEEDS = 20,
293 c_ST_SEGM_WATERSHED = 21,
294 c_ST_SEGM_BINARY = 22,
295 c_ST_MEASURE_DIFF = 23,
296 c_ST_MEASURE_HSV = 24,
297 c_ST_MEASURE_VALUE = 25,
298 c_ST_MEASURE_VALUE_MASK = 26,
299 c_ST_MEASURE_ABSORPTION = 27,
300 c_ST_MEASURE_TRANSMISSON= 28,
301 c_ST_MEASURE_CELL_COUNT = 29,
305 static unsigned const int
307 c_ST_C_RGB_ANTISHADE = 1,
308 c_ST_C_RGB_DIFFERENCE = 2,
309 c_ST_C_HSV_INPUT = 3,
310 c_ST_C_HSV_DIFFERENCE = 4,
311 c_ST_G_INPUT_SAT = 5,
315 c_ST_B_EDGES_NUMBERS = 9,
318 c_RESULTS_STEPS = 12;
320 static unsigned const int
322 c_ATT_SIZE_RADIUS = 1,
323 c_ATT_SIZE_DIAMETER = 2,
324 c_ATT_ABSORB_MEAN = 3,
325 c_ATT_ABSORB_MEDIAN = 4,
326 c_ATT_ABSORB_SUM = 5,
327 c_ATT_TRANS_MEAN = 6,
328 c_ATT_TRANS_MEDIAN = 7,
330 c_ATT_TRANS_RADIAL_MEAN = 9,
331 c_ATT_TRANS_RADIAL_MEDIAN = 10,
332 c_ATT_TRANS_RADIAL_SUM = 11,
333 c_ATT_CELL_DENSITY_MEAN = 12,
334 c_ATT_CELL_DENSITY_MEDIAN = 13,
335 c_ATT_CELL_DENSITY_SUM = 14,
337 QStringList QSL_Attrib = {
338 "Size_Area",
"Size_Radius",
"Size_Diameter",
339 "Absorption_Mean",
"Absorption_Median",
"Absorption_Sum",
340 "Transmission_Mean",
"Transmission_Median",
"Transmission_Sum",
341 "Transmission_Radial_Mean",
"Transmission_Radial_Median",
"Transmission_Radial_Sum",
342 "Aprox_Cell_Density_pPx_Mean",
"Aprox_Cell_Density_pPx_Median",
"Aprox_Cell_Count"
346 static unsigned const int
349 c_TYP_TRANS_RADIAL = 2,
350 c_TYP_CELL_DENSITY = 3,
352 QStringList QSL_Types = {
"Absorption",
"Transmission",
"Transmission_Radial",
"Aprox_Cell_Density_per_Pixel"};
356 void ERR(
int err, QString func =
"not specified", QString detail =
"not specified");
362 #endif // D_MAKRO_CELLCOLONIES_H
@ c_AXE_POLAR_RADIUS
Definition: d_enum.h:2144
static int Plot_Stat_Multi_Custom(QChartView *pChartView, vector< vector< vector< double >>> *vvv_ParSetSta, unsigned int par_x, unsigned int par_y, unsigned int stat_x, unsigned int stat_y, QString name_title, QString name_series, QString name_x, QString name_y)
Definition: d_plot.cpp:3803
cv::Mat Mat
Definition: d_opencv_typedefs.h:28
@ ER_okay
Definition: d_enum.h:133
void Update_View()
D_Viewer::Update_View Starts the workflow to show an image.
Definition: d_viewer.cpp:2096
static int Math_ScalImg_Sub(Mat *pMA_Out, Mat *pMA_In, double minuend)
Definition: d_img_proc.cpp:13028
void set_dir_M_CellColonies(QString path)
Definition: d_storage.h:103
static int Math_ImgImg_Diff(Mat *pMA_Out, Mat *pMA_In1, Mat *pMA_In2)
Definition: d_img_proc.cpp:13125
The D_Value_Distribution_List class inherits D_Component_List and calculates the statistical distribu...
Definition: d_value_distribution_list.h:46
static int Plot_Hist_Multi_Classes(QChartView *pChartView, vector< vector< double >> *vv_hist, double min_x, double max_x, double max_y, double step, QString name_title, QString name_series, QString name_x, QString name_y, bool ignore_first)
const int DIST_L2
Definition: d_opencv_typedefs.h:114
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
const double PI_2_0
Definition: d_enum.h:2537
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
void set_ClosingPossible(bool closeable)
Definition: d_makro_cellcolonies.h:64
static int Load_From_Path(Mat *pMA_Out, QFileInfo FI_path)
Definition: d_img_proc.cpp:16
The D_Viewer class Display images (Mat) in QGraphicsView in the user interface.
Definition: d_viewer.h:58
The D_Storage class Used for storing data. There is only one instance in D_MainWindow .
Definition: d_storage.h:49
static int Plot_Scatter_2D_Parameter(QChartView *pChartView, vector< vector< vector< double >>> *vvv_ParSetVal, unsigned int set, unsigned int par_x, unsigned int par_y, QString name_title, QString name_series, QString name_x, QString name_y)
void Update_Image(Mat *MA_new)
D_Viewer::Update_Image Set and show image.
Definition: d_viewer.cpp:2079
static int Transformation_Distance(Mat *pMA_Out, Mat *pMA_In, int metric, int precision)
Definition: d_img_proc.cpp:7486
static int Math_Special_Add_Color(Mat *pMA_Out, Mat *pMA_In_Color, Mat *pMA_In0, Mat *pMA_In1, Mat *pMA_In2)
Definition: d_img_proc.cpp:13804
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
const int MORPH_CLOSE
Definition: d_opencv_typedefs.h:92
static int Duplicate(Mat *pMA_Out, Mat *pMA_In)
Definition: d_img_proc.cpp:2397
static int Calc_Vector2Hist_2(vector< vector< double >> *vv_hist, vector< vector< double >> *vv_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:3764
@ c_STAT_COUNT
Definition: d_enum.h:734
static int Draw_Label_Numbers(Mat *pMA_Out, Mat *pMA_In, Mat *pMA_Label, double scale, double thickness, bool center)
Definition: d_img_proc.cpp:19012
@ c_FEAT_SPHERICITY_INV
Definition: d_enum.h:1335
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
static int Plot_Stat_Multi_CvSkewKurt(QChartView *pChartView, vector< vector< double >> *vv_SetSta, bool pl_cv, bool pl_skew, bool pl_kurt, QString name_title, QString name_categories, QString name_y)
Definition: d_plot.cpp:3684
vector< vector< double > > get_Axe(int axe, int stat=c_STAT_MEAN_ARITMETIC)
Definition: d_value_distribution_list.cpp:213
static int Threshold_Relative_1C(Mat *pMA_Out, Mat *pMA_In, double max_val, double thres_rel)
Definition: d_img_proc.cpp:6352
@ c_STAT_MEDIAN
Definition: d_enum.h:764
Definition: d_makro_cellcolonies.h:56
void closeEvent(QCloseEvent *event)
Definition: d_makro_cellcolonies.cpp:145
static int Math_Special_Trans2Count(Mat *pMA_Count, Mat *pMA_Trans, float base, float scale)
Definition: d_img_proc.cpp:13995
static int Draw_Label_Numbers_LUT(Mat *pMA_Out, Mat *pMA_In, Mat *pMA_Label, vector< double > v_LUT, bool border, double scale, double thickness, bool center, int precision, uchar r=0, uchar g=0, uchar b=0)
Definition: d_img_proc.cpp:18727
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
void calc_All()
Definition: d_value_distribution_list.cpp:239
static int Split(Mat *pMA_Out, Mat *pMA_In, unsigned int channel)
Definition: d_img_proc.cpp:4007
static int Plot_Line_XY_Multi(QChartView *pChartView, vector< vector< double >> vv_XY_Data, QString name_title, QString name_series, QString name_x, QString name_y, int x_trans=c_AXE_TRANS_LIN, int y_trans=c_AXE_TRANS_LIN, bool dots_visible=false, bool heat_color=false, bool heat_color_AllColors=false, Qt::Alignment legend_pos=Qt::AlignTop)
static int Shading_Correct(Mat *pMA_Out, Mat *pMA_In, Mat *pMA_Reference)
Definition: d_img_proc.cpp:14089
const int MORPH_OPEN
Definition: d_opencv_typedefs.h:91
const int DIST_MASK_PRECISE
Definition: d_opencv_typedefs.h:122
static int Crop_Rect_Rel(Mat *pMA_Out, Mat *pMA_In, double x1_rel, double y1_rel, double x2_rel, double y2_rel)
Definition: d_img_proc.cpp:5467
@ c_STAT_SUM
Definition: d_enum.h:737
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
static int Color_Grab(Mat *pMA_Out, Mat *pMA_In, int color_space, int out_mode, vector< uchar > min, vector< uchar > max)
Definition: d_img_proc.cpp:6950
static int Plot_Pie_Surrival(QChartView *pChartView, int surrival, int dead, QString name_title)
Definition: d_plot.cpp:3885
void set_GV(QGraphicsView *GV_ui)
Definition: d_viewer.cpp:49
static int Feature_Value(Mat *pMA_Out, Mat *pMA_In, int feature, int connectivity=4)
Definition: d_img_proc.cpp:15646
static int Plot_Stat_Multi_Quantiles(QChartView *pChartView, vector< vector< double >> *vv_SetSta, unsigned int steps, QString name_title, QString name_categories, QString name_y)
Definition: d_plot.cpp:3735
~D_MAKRO_CellColonies()
Definition: d_makro_cellcolonies.cpp:140
Definition: d_analysiswindow.h:58
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_MAKRO_CellColonies(D_Storage *pStorage, QWidget *parent=0)
Definition: d_makro_cellcolonies.cpp:12
static int Math_ImgSelf_Not(Mat *pMA_Out, Mat *pMA_In)
Definition: d_img_proc.cpp:12999
static int Reduce_Outlines(Mat *pMA_Out, Mat *pMA_In, int neighborhood=8, int thickness=1)
Definition: d_img_proc.cpp:16469
@ c_STAT_STAN_DEV_SAMPLE
Definition: d_enum.h:751
const int MORPH_ELLIPSE
Definition: d_opencv_typedefs.h:87
static int Math_ImgImg_BitOr(Mat *pMA_Out, Mat *pMA_In1, Mat *pMA_In2)
Definition: d_img_proc.cpp:13202
static int Convert_Color(Mat *pMA_Out, Mat *pMA_In, int cvt_mode)
Definition: d_img_proc.cpp:2524
void connect_Zoom(D_Viewer *viewer)
Definition: d_viewer.cpp:128
const QStringList QSL_StatList
Definition: d_enum.h:797
QString Save_Image()
D_Viewer::Save_Image Saves the image at FI_LastSaved.
Definition: d_viewer.cpp:2157
int set_Mats(Mat *pMA_Label, Mat *pMA_Value, int connectivity=8)
Definition: d_value_distribution_list.cpp:21
static int Math_ImgImg_BitAnd(Mat *pMA_Out, Mat *pMA_In1, Mat *pMA_In2)
Definition: d_img_proc.cpp:13187
static int Math_ImgImg_Add(Mat *pMA_Out, Mat *pMA_In1, Mat *pMA_In2)
Definition: d_img_proc.cpp:13092
static int Plot_Stat_Multi_MeanMedian(QChartView *pChartView, vector< vector< double >> *vv_SetSta, bool pl_mean, bool pl_sd, bool pl_median, bool pl_adm, QString name_title, QString name_categories, QString name_y)
Definition: d_plot.cpp:3630
const int BORDER_DEFAULT
Definition: d_opencv_typedefs.h:78
QDir * dir_M_CellColonies()
Definition: d_storage.h:75
Mat * get_Adress(size_t pos)
Definition: d_storage.h:54
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
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
static int Threshold_Value(Mat *pMA_Out, Mat *pMA_In, int out_mode, double max_val, double thres)
Definition: d_img_proc.cpp:6638
static int Threshold_Relative(Mat *pMA_Out, Mat *pMA_In, double max_val, double thres_rel)
Definition: d_img_proc.cpp:6235
static int Calc_Stats(vector< double > *v_stats, vector< double > v_data, bool calc_sorted)
Definition: d_stat.cpp:16
static int Spread_8bit_to_float01(Mat *pMA_Out, Mat *pMA_In)
Definition: d_img_proc.cpp:3934
@ c_STAT_MEAN_ARITMETIC
Definition: d_enum.h:740
static int LUT_Apply_to_Label_Color(Mat *pMA_Out, Mat *pMA_In, Mat *pMA_Label, vector< int > vLUT, int channel_true, int channel_false, bool edges=true, bool ignore_BG=true)
Definition: d_img_proc.cpp:15567