 |
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_OSTEOCLASTS_H
10 #define D_MAKRO_OSTEOCLASTS_H
26 #include <QMainWindow>
27 #include <QFileDialog>
29 #include <QFileInfoList>
33 #include <QCloseEvent>
34 #include <QResizeEvent>
35 #include <QMouseEvent>
36 #include <QInputDialog>
50 #include <opencv2/core/core.hpp>
51 #include <opencv2/highgui/highgui.hpp>
52 #include <opencv2/imgproc/imgproc.hpp>
71 void closeEvent(QCloseEvent *event);
72 void resizeEvent(QResizeEvent *event);
73 void mousePressEvent(QMouseEvent *event);
79 void Update_View_Proc();
82 void Update_Image_ProcView();
83 void Update_Image_ProcView_Visualize();
84 void Update_Image_ProcView_SegmentationAuto();
85 void Update_Image_ProcView_SegmentationManual();
87 void Update_newViewport();
89 void Update_NucleiSegmentation_Auto();
90 void Update_NucleiSegmentation_Auto_Steps(
int start_step);
92 void Populate_CB_Single(QComboBox *CB, QStringList QSL,
int index_init = 0);
93 void Populate_CB_All_onStartUp();
94 void Populate_CB_All_onImgInit();
95 void Populate_CB_Stats();
96 void Populate_CB_AxeTrans();
97 void Populate_CB_Dimensions();
98 void Populate_CB_Draw();
99 void Populate_CB_ProcSteps();
100 void Populate_CB_Segmentations();
102 void Images_NucleiSegmentation_Init();
103 void Images_VisVPin_init();
105 void Load_Platelet();
107 void Visualize_DataSet();
109 void Segmentation_Next();
111 void SegmentationManual_DIR_Init();
112 void SegmentationManual_Scan();
113 void SegmentationManual_Load(
int seg_type);
114 void SegmentationManual_Init(
int seg_type);
115 void SegmentationManual_Save(
int seg_type);
116 void SegmentationManual_Reset();
117 void SegmentationManual_Backup();
118 void SegmentationManual_Undo();
119 void SegmentationManual_AdaptUi2BackupState();
120 void SegmentationManual_TriggerDraw(
int x,
int y);
121 void Segmentations_Combine();
122 void Segmentations_Combine(
int seg_type);
125 void Extrema_Viewport();
128 void VisVP_MouseMovedOnScene(
int x,
int y);
130 void on_comboBox_Viewport_currentIndexChanged(
int index);
133 void on_spinBox_SegAuto_Blur_Size_valueChanged(
int arg1);
135 void on_doubleSpinBox_SegAuto_Blur_Sigma_valueChanged(
double arg1);
137 void on_spinBox_SegAuto_Thres_Size_valueChanged(
int arg1);
139 void on_doubleSpinBox_SegAuto_Thres_Offset_valueChanged(
double arg1);
141 void on_doubleSpinBox_SegAuto_Distance_Thres_valueChanged(
double arg1);
143 void on_checkBox_SegAuto_Watershed_Bordered_stateChanged(
int arg1);
145 void on_checkBox_SegAuto_Watershed_nSeeded_stateChanged(
int arg1);
147 void on_spinBox_SegAuto_Area_Min_valueChanged(
int arg1);
149 void on_spinBox_SegAuto_Area_Max_valueChanged(
int arg1);
151 void on_doubleSpinBox_SegAuto_Roundness_Thres_valueChanged(
double arg1);
153 void on_comboBox_SegMan_SegmentationType_currentIndexChanged(
int index);
155 void on_comboBox_SegMan_Draw_Type_currentIndexChanged(
int index);
159 Ui::D_MAKRO_Osteoclasts *ui;
160 bool ClosingPossible =
false;
161 const bool MessageOnFunctionStart =
true;
162 const bool MessageOnBreakFromState =
false;
165 QDir DIR_InputPlatelet;
166 QDir DIR_Segmentations;
167 QStringList QSL_Viewport_Path;
168 QString QS_PlateletName;
169 QFileInfoList FIL_Segmentations_current;
174 bool state_Startup =
true;
176 bool state_Platelet_New =
true;
177 bool state_Platelet_Loaded =
false;
179 bool state_SegPath_Init =
false;
181 bool state_Viewport_New =
true;
182 bool state_Viewport_Loaded =
false;
184 bool state_VisVP_Init =
false;
185 bool state_VisVP_Updating =
false;
186 bool state_VisVp_Done =
false;
188 bool state_SegAuto_Init =
false;
189 bool state_SegAuto_Updating =
false;
190 bool state_SegAuto_Done =
false;
192 bool state_SegMan_Init =
false;
193 bool state_SegMan_Scanned =
false;
194 bool state_SegMan_Combined =
false;
195 bool state_SegMan_Draw_Active =
false;
196 bool state_SegMan_Draw_NewLine =
true;
203 vector<vector<vector<Mat>>> vvvMA_VpZCh_Stacks;
207 vector<Mat> vMA_Ch_VisVP_in;
212 vector<vector<Mat>> vvMA_VpStep_NucAutoSeg;
216 vector<vector<Mat>> vvMA_VpSeg_Manual_Saved;
217 vector<vector<Mat>> vvMA_VpSeg_Manual_Combined;
218 vector<vector<vector<Mat>>> vvvMA_VpSegStep_Manual_Backup;
219 vector<vector<unsigned int>> vvI_VpSeg_ActionsCount;
220 vector<vector<unsigned int>> vvI_VpSeg_UndoCount;
221 static const int c_SEG_MAN_BACKUPS = 10;
226 vector<vector<vector<double>>> vvvd_ProjExtCh_Extrema;
229 QStringList QSL_Viewport_Names;
230 QStringList QSL_Depths;
231 int Dim_Viewports = 0;
248 QChartView *pChartView_Plot;
255 void ERR(
int err, QString func =
"not specified", QString detail =
"not specified");
256 void ERR_StatesCheck(QString func);
263 c_PROC_VIEW_SEG_AUTO,
264 c_PROC_VIEW_SEG_MANUAL
267 enum VisualizeParameters
280 c_PROJ_SINGLE_IMAGES,
281 c_PROJ_CURRENT_PROJECTION,
299 QStringList QSL_Channels =
313 QStringList QSL_Segmentations =
320 enum SegmentationsSave
324 c_SEG_SAVE_NUCLEI_FG,
325 c_SEG_SAVE_NUCLEI_BG,
328 QStringList QSL_SegmentationsSave =
336 enum SegmentationColor
338 c_SEG_COLOR_FOREGROUND,
339 c_SEG_COLOR_BACKGROUND,
340 c_SEG_COLOR_NUMBER_OF
342 QStringList QSL_SegmentationColor =
354 QStringList QSL_SegmentationPen =
375 QStringList QSL_ProcSteps =
377 "00 - Nuclei Projection",
381 "04 - Distance Transform",
383 "06 - Watershed Transform",
385 "08 - Roundness Filter",
393 #endif // D_MAKRO_OSTEOCLASTS_H
cv::Mat Mat
Definition: d_opencv_typedefs.h:28
@ ER_okay
Definition: d_enum.h:133
static int Fill_Holes(Mat *pMA_Out, Mat *pMA_In)
Definition: d_img_proc.cpp:12257
void Update_View()
D_Viewer::Update_View Starts the workflow to show an image.
Definition: d_viewer.cpp:2096
static int Draw_Line(Mat *pMA_Target, unsigned int x1, unsigned int y1, unsigned int x2, unsigned int y2, unsigned int thickness=1, double value=255)
Definition: d_img_proc.cpp:17134
static int Math_ImgImg_Diff(Mat *pMA_Out, Mat *pMA_In1, Mat *pMA_In2)
Definition: d_img_proc.cpp:13125
void set_ClosingPossible(bool closeable)
Definition: d_makro_osteoclasts.h:74
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
static int Math_ImgImg_AddWeighted(Mat *pMA_Out, Mat *pMA_In1, Mat *pMA_In2, double weight_1, double weight_2, double weight_sum)
Definition: d_img_proc.cpp:13107
static int Feature_Select(Mat *pMA_Out, Mat *pMA_In, int feature, double f_min, double f_max, int connectivity=4)
Definition: d_img_proc.cpp:15710
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 Normalize(Mat *pMA_Out, Mat *pMA_In, unsigned int norm, unsigned int type, double min, double max)
Definition: d_img_proc.cpp:3814
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
@ c_GEO_OUTLINE
Definition: d_enum.h:2053
void resizeEvent(QResizeEvent *event)
Definition: d_makro_osteoclasts.cpp:107
cv::Point Point
Definition: d_opencv_typedefs.h:35
@ c_FEAT_ROUNDNESS
Definition: d_enum.h:1322
The D_Table class Display tables in QTableWidget in the user interface.
Definition: d_table.h:42
static int ValAtPix(vector< double > *v_value, Mat *pMA_In, size_t x_pos, size_t y_pos)
Definition: d_img_proc.cpp:2192
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
static int Split(Mat *pMA_Out, Mat *pMA_In, unsigned int channel)
Definition: d_img_proc.cpp:4007
static int MinMax_of_Mat(Mat *pMA_In, double *min_ext, double *max_ext)
Definition: d_img_proc.cpp:2052
cv::Scalar Scalar
Definition: d_opencv_typedefs.h:30
Definition: d_makro_osteoclasts.h:64
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 GammaSpread_1C(Mat *pMA_Out, Mat *pMA_In, double gamma, double in_min, double in_max, double out_min=0, double out_max=255, bool force_8bit=false)
Definition: d_img_proc.cpp:4649
static int Math_ImgStack_Project(Mat *pMA_Out, vector< Mat > *pvMA_In, int stat=c_STAT_MEAN_ARITMETIC)
Definition: d_img_proc.cpp:13436
D_MAKRO_Osteoclasts(D_Storage *pStorage, QWidget *parent=0)
Definition: d_makro_osteoclasts.cpp:12
void set_GV(QGraphicsView *GV_ui)
Definition: d_viewer.cpp:49
static int Floodfill(Mat *pMA_Out, Mat *pMA_In, unsigned int seed_x, unsigned int seed_y, double new_val)
Definition: d_img_proc.cpp:16690
Definition: d_analysiswindow.h:58
@ ER_other
Definition: d_enum.h:134
void mousePressEvent(QMouseEvent *event)
Definition: d_makro_osteoclasts.cpp:115
static int Reduce_Outlines(Mat *pMA_Out, Mat *pMA_In, int neighborhood=8, int thickness=1)
Definition: d_img_proc.cpp:16469
static int Threshold_Absolute_1C(Mat *pMA_Out, Mat *pMA_In, double thres_abs)
Definition: d_img_proc.cpp:6553
const QStringList QSL_StatList
Definition: d_enum.h:797
static int Convert_Mat_to_QImage(QImage *pQI_Out, Mat *pMA_In, bool use_custom_range_for_spread_non_8bit=false, double in_min=0, double in_max=1)
Definition: d_img_proc.cpp:973
~D_MAKRO_Osteoclasts()
Definition: d_makro_osteoclasts.cpp:85
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
static int Math_ImgImg_Add(Mat *pMA_Out, Mat *pMA_In1, Mat *pMA_In2)
Definition: d_img_proc.cpp:13092
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
const int BORDER_DEFAULT
Definition: d_opencv_typedefs.h:78
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
QDir * dir_M_Osteoclasts()
Definition: d_storage.h:81
void set_dir_M_Osteoclasts(QString path)
Definition: d_storage.h:109
@ c_FEAT_AREA
Definition: d_enum.h:1347
@ c_STAT_MEAN_ARITMETIC
Definition: d_enum.h:740
static int Draw_Boundaries(Mat *pMA_Target, int width=1, int val=255)
Definition: d_img_proc.cpp:18238
void closeEvent(QCloseEvent *event)
Definition: d_makro_osteoclasts.cpp:91