 |
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_MANUELSEGMENTATION_H
10 #define D_MAKRO_MANUELSEGMENTATION_H
24 #include <QMainWindow>
25 #include <QFileDialog>
27 #include <QFileInfoList>
31 #include <QCloseEvent>
32 #include <QResizeEvent>
33 #include <QInputDialog>
34 #include <qplaintextedit.h>
35 #include <QColorDialog>
49 #include <opencv2/core/core.hpp>
50 #include <opencv2/highgui/highgui.hpp>
51 #include <opencv2/imgproc/imgproc.hpp>
70 void closeEvent(QCloseEvent *event);
71 void resizeEvent(QResizeEvent *event);
80 void Data_CalcContainers_Init();
82 void LoadMode_Calib();
90 void Update_Image_Draw();
91 void Update_Image_Seg();
93 void Update_SB_DrawInfo();
95 void Update_ImgProc_All();
96 void Update_ImgProc(
int step_start);
97 void Update_ImgProc_Step(
int step);
99 void Update_Calc_All();
100 void Update_Calc_Current_Feats();
101 void Update_Calc_Current_Stats();
102 void Update_Calc_Pool();
103 void Update_Calc_All_Stats();
104 void Update_Calc_Selections();
106 void Draw_RecieveClickLeft(
int x,
int y);
107 void Draw_RecieveClickRight(
int x,
int y);
108 void Draw_ConsecutiveLine_FG();
109 void Draw_ConsecutiveLine_BG();
110 void Draw_Floodfill();
113 void Draw_FillHoles();
114 void Draw_BackupCreate();
115 void Draw_WriteFile();
117 void Update_Results();
118 void Update_Table_Current_Feat();
119 void Update_Table_Current_Stat();
120 void Update_Table_All_Feat();
121 void Update_Table_All_Stat();
123 void Populate_CB_Single(QComboBox *CB, QStringList QSL,
int index_init);
124 void Populate_CB_Start();
126 void ShowList(QPlainTextEdit *text_edit, QStringList QSL_ParentList, vector<int> *vSelection);
127 void Edit_FeatsOfInterest();
128 void Edit_StatsOfInterest();
130 void Draw_Set_Tool_LineForeground();
131 void Draw_Set_Tool_LineBackground();
132 void Draw_Set_Tool_FillFlood();
135 bool Scale_GetFromFile();
136 void Scale_WriteToFile();
137 void Scale_SetToDefault();
139 void Scale_UpdateFactor();
140 void Scale_UpdateFactor_Recalculate();
142 void Overlay_Set_Color();
144 void on_doubleSpinBox_Intensity_Overlay_valueChanged(
double arg1);
145 void on_doubleSpinBox_Intensity_Backgrouond_valueChanged(
double arg1);
147 void on_spinBox_Scale_Px_valueChanged(
int arg1);
148 void on_doubleSpinBox_Scale_CutomUnit_valueChanged(
double arg1);
149 void on_lineEdit_Scale_CustomUnit_textChanged(
const QString &arg1);
152 Ui::D_MAKRO_ManuelSegmentation *ui;
153 bool ClosingPossible =
false;
159 int LoadMode_Current = LOAD_GRAY;
160 vector<int> vLoadMode_PagesOfInterest_Indices = {0};
161 vector<Mat> vLoadMode_PagesOfInterest;
162 vector<QColor> vLoadMode_Colors;
163 vector<int> vLoadMode_Colors_R;
164 vector<int> vLoadMode_Colors_G;
165 vector<int> vLoadMode_Colors_B;
166 vector<int> vLoadMode_Colors_A;
171 QFileInfoList FIL_Images;
172 QFileInfoList FIL_DrawFiles;
173 QFileInfoList FIL_Param;
174 QStringList QSL_Images_Names;
175 QStringList QSL_Images_Paths;
176 QStringList QSL_Images_Suffix;
180 vector<Mat> vMA_ProcSteps;
183 int Draw_ActiveTool = DRAW_TOOL_LINE_FG;
184 QColor Draw_OverlayColor = Qt::green;
185 vector<Point> Draw_vPoints;
186 int Draw_RememberedClicks = 0;
190 int ScaleInit_Calib_Px = 1000;
191 double ScaleInit_Calib_CustomUnit = 200;
192 double ScaleInit_Factor = 0.04;
193 QString Scale_CustomUnit =
"um";
194 vector<int> Scale_vCalib_Px;
195 vector<double> Scale_vCalib_CustomUnit;
196 vector<double> Scale_vFactor;
199 vector<int> v_FeatsOfInterest = {
c_FEAT_AREA, FEAT_CUSTOM_AREA_SCALED};
201 QStringList QSL_FeatsOfInterest;
202 QStringList QSL_StatsOfInterest;
204 QString QS_AreaScaled =
"Area in um";
207 vector<vector<double>> vv_FeatComp_Current;
208 vector<vector<double>> vv_FeatStat_Current;
209 vector<int> v_ImgAnalysed;
210 vector<vector<vector<double>>> vvv_ImgFeatComp_All;
211 vector<vector<vector<double>>> vvv_ImgFeatStat_All;
212 vector<vector<double>> vv_FeatComp_All;
213 vector<vector<double>> vv_FeatStat_All;
214 vector<vector<double>> vv_FeatComp_Current_Selection;
215 vector<vector<double>> vv_FeatStat_Current_Selection;
216 vector<vector<double>> vv_FeatComp_All_Selection;
217 vector<vector<double>> vv_FeatStat_All_Selection;
224 QLabel *pL_SB_DrawInfo_HowTo;
225 QLabel *pL_SB_DrawInfo_Selected;
234 bool state_LoadMode_Pages_Calibrated =
false;
235 bool state_Images_Loaded =
false;
236 bool state_CalcContainers_CorrectSize =
false;
237 bool state_Current_ImgProc_Done =
false;
238 bool state_Current_Calc_Done =
false;
239 bool state_All_Calc_Done =
false;
240 bool state_Selections_Calc =
false;
244 void ERR(
int err, QString func =
"no specified", QString detail =
"no specified");
247 static const int Draw_ClickMemoryCount = 5;
251 PARAM_SCALE_CUSTOM_UNIT,
254 const QStringList QSL_Param = {
261 FEAT_CUSTOM_NUMBER_OF
264 enum LOAD_MODE_COLOR {
271 const QStringList QSL_LoadModeColor = {
274 "Multipaged Grayscale Image",
275 "Multipaged Color Image"
285 STEP_SEGMENTATION_NUMBERS,
288 const QStringList QSL_ProcSteps = {
295 "Segmentation Numbers"
304 const QStringList QSL_DrawTool = {
305 "Consecutive Foreground Line",
306 "Consecutive Background Line",
318 const QStringList QSL_Results = {
321 "Current Statistics",
327 #endif // D_MAKRO_MANUELSEGMENTATION_H
cv::Mat Mat
Definition: d_opencv_typedefs.h:28
static QString Type_of_Mat(Mat *pMA_In)
Definition: d_img_proc.cpp:363
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
@ c_DIM_X
Definition: d_enum.h:235
static int Create_VD_SinglePaged(D_VisDat_Obj *pVD_New, QString QS_Path, int DimPage=c_DIM_P, int DimImgX=c_DIM_X, int DimImgY=c_DIM_Y)
Definition: d_visdat_proc.cpp:1485
void set_ClosingPossible(bool closeable)
Definition: d_makro_manuelsegmentation.h:72
The D_Viewer class Display images (Mat) in QGraphicsView in the user interface.
Definition: d_viewer.h:58
static int Copy(D_VisDat_Obj *pVD_Out, D_VisDat_Obj *pVD_In)
Definition: d_visdat_proc.cpp:3406
The D_Storage class Used for storing data. There is only one instance in D_MainWindow .
Definition: d_storage.h:49
@ c_DIM_Y
Definition: d_enum.h:236
void Update_Image(Mat *MA_new)
D_Viewer::Update_Image Set and show image.
Definition: d_viewer.cpp:2079
static int Read_2D_Plane(Mat *pMA_Out, D_VisDat_Obj *pVD_In, D_VisDat_Slice_2D InPlane)
Definition: d_visdat_proc.cpp:2946
QString Save_Table()
Definition: d_table.cpp:186
static int Labeling(Mat *pMA_Out, Mat *pMA_In, int connectivity, int out_depth)
Definition: d_img_proc.cpp:12350
void closeEvent(QCloseEvent *event)
Definition: d_makro_manuelsegmentation.cpp:109
void set_TW(QTableWidget *TW)
Definition: d_table.cpp:16
void ERR(int err, QString sender, QString func, QString detail)
D_Error_Handler::ERR pops an error message if an error occured and/or streams it to a csv file.
Definition: d_error_handler.cpp:23
const QStringList QSL_FeatureList
Definition: d_enum.h:1457
@ c_STAT_SEM_ABS_SAMPLE
Definition: d_enum.h:790
The D_VisDat_Obj class Represents a 6D image.
Definition: d_visdat_obj.h:51
static int Duplicate(Mat *pMA_Out, Mat *pMA_In)
Definition: d_img_proc.cpp:2397
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
cv::Point Point
Definition: d_opencv_typedefs.h:35
Mat * pMA_full()
Definition: d_visdat_obj.h:61
static int OverlayOverwrite(Mat *pMA_Out, Mat *pMA_In, Mat *pMA_Overlay, double intensity_overlay=1.0, double intensity_backgr=1.0)
Definition: d_img_proc.cpp:19556
QDir * dir_M_ManualSegmentation()
Definition: d_storage.h:86
int size_P()
Definition: d_visdat_dim.h:64
static int Load_From_Path_Gray(Mat *pMA_Out, QFileInfo FI_path)
Definition: d_img_proc.cpp:51
The D_Table class Display tables in QTableWidget in the user interface.
Definition: d_table.h:42
void resizeEvent(QResizeEvent *event)
Definition: d_makro_manuelsegmentation.cpp:123
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
@ ER_channel_bad
Definition: d_enum.h:144
~D_MAKRO_ManuelSegmentation()
Definition: d_makro_manuelsegmentation.cpp:104
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
cv::Scalar Scalar
Definition: d_opencv_typedefs.h:30
@ c_STAT_SUM
Definition: d_enum.h:737
The D_VisDat_Slice_2D class Represents a 2D slice through a D_VisDat_Obj.
Definition: d_visdat_slice_2d.h:18
D_VisDat_Obj get_VD(size_t pos)
Definition: d_storage.h:56
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
D_MAKRO_ManuelSegmentation(D_Storage *pStorage, QWidget *parent=0)
Definition: d_makro_manuelsegmentation.cpp:12
The D_Component_List class is a list of D_Component representing the blobs in a binary image.
Definition: d_component_list.h:46
@ c_DIM_P
Definition: d_enum.h:240
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
static int Math_ImgImg_BitOr(Mat *pMA_Out, Mat *pMA_In1, Mat *pMA_In2)
Definition: d_img_proc.cpp:13202
D_VisDat_Dim * pDim()
Definition: d_visdat_obj.h:73
static int Convert_Color(Mat *pMA_Out, Mat *pMA_In, int cvt_mode)
Definition: d_img_proc.cpp:2524
const QStringList QSL_StatList
Definition: d_enum.h:797
@ c_STAT_NUMBER_OF_STATS
Definition: d_enum.h:795
QString Save_Image()
D_Viewer::Save_Image Saves the image at FI_LastSaved.
Definition: d_viewer.cpp:2157
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
Mat * get_Adress(size_t pos)
Definition: d_storage.h:54
void set_dir_M_ManualSegmentation(QString path)
Definition: d_storage.h:114
Definition: d_makro_manuelsegmentation.h:63
static int Normalize(D_VisDat_Obj *pVD_Out, D_VisDat_Obj *pVD_In, int norm, int type, double min, double max)
Definition: d_visdat_proc.cpp:4647
static int Calc_Stats(vector< double > *v_stats, vector< double > v_data, bool calc_sorted)
Definition: d_stat.cpp:16
@ c_FEAT_NUMBER_OF_FEATS
Definition: d_enum.h:1455
@ c_FEAT_AREA
Definition: d_enum.h:1347
@ c_STAT_MEAN_ARITMETIC
Definition: d_enum.h:740