11 #ifndef STACKPROCESSLABELS_HPP
12 #define STACKPROCESSLABELS_HPP
30 setName(
"Stack/Segmentation/Watershed3D");
31 setDesc(
"3D Watershed on the current labeled stack.");
32 setIcon(QIcon(
":/images/SegmentMesh.png"));
37 if(!checkState().store(STORE_MAIN | STORE_VISIBLE | STORE_NON_LABEL)
38 .store(STORE_WORK | STORE_VISIBLE | STORE_LABEL))
40 Stack* stack = currentStack();
43 return run(stack, main, labels);
61 setName(
"Stack/Segmentation/Consolidate Regions");
62 setDesc(
"Consilodate regions after watershed overseeding");
63 setIcon(QIcon(
":/images/Consolidate.png"));
65 addParm(
"Threshold",
"Threshold",
"5000");
66 addParm(
"Min Voxels",
"Min Voxels",
"100");
71 if(!checkState().store(STORE_MAIN | STORE_VISIBLE | STORE_NON_LABEL)
72 .store(STORE_WORK | STORE_VISIBLE | STORE_LABEL))
74 Stack* stack = currentStack();
77 return run(main, labels, parm(
"Threshold").toUInt(), parm(
"Min Voxels").toUInt());
94 setName(
"Stack/Segmentation/Consolidate Regions Normalized");
95 setDesc(
"Consolidate regions with normalization (slower)");
96 setIcon(QIcon(
":/images/Consolidate.png"));
98 addParm(
"Tolerance",
"Tolerance",
"0.3");
103 if(!checkState().store(STORE_MAIN | STORE_VISIBLE | STORE_NON_LABEL)
104 .store(STORE_WORK | STORE_VISIBLE | STORE_LABEL))
106 Stack* stack = currentStack();
109 return run(main, labels, parm(
"Tolerance").toFloat());
112 bool run(
Store* data,
Store* labels,
float tolerance);
127 setName(
"Stack/Segmentation/Delete Labels by Threshold");
128 setDesc(
"Delete Labels above/below voxel thresholds");
129 setIcon(QIcon(
":/images/DeleteLabel.png"));
131 addParm(
"Min voxels",
"Min voxels",
"1000");
132 addParm(
"Max voxels",
"Max voxels",
"0");
137 if(!checkState().store(STORE_LABEL))
139 Stack* stack = currentStack();
144 bool res = run(input, output, parm(
"Min voxels").toInt(), parm(
"Max voxels").toInt());
168 setName(
"Stack/Segmentation/Local Maxima");
169 setDesc(
"Find local maxima and possibly number them");
170 setIcon(QIcon(
":/images/LocalMaxima.png"));
172 addParm(
"X Radius",
"X Radius (µm)",
"5.0");
173 addParm(
"Y Radius",
"Y Radius (µm)",
"5.0");
174 addParm(
"Z Radius",
"Z Radius (µm)",
"5.0");
175 addParm(
"Start Label",
"Start Label",
"2");
176 addParm(
"Threshold",
"Only consider voxel values larger than this value as maxima",
"10000");
177 addParm(
"Value",
"Value to set voxel if not labeling",
"60000");
182 if(!checkState().store(STORE_NON_LABEL))
184 Stack* stack = currentStack();
189 Point3f radius(parm(
"X Radius").toFloat(), parm(
"Y Radius").toFloat(), parm(
"Z Radius").toFloat());
190 uint label = parm(
"Start Label").toUInt();
191 uint threshold = parm(
"Threshold").toUInt();
192 uint value = parm(
"Value").toUInt();
193 bool res = run(input, output, radius, label, threshold, value);
214 setName(
"Stack/Segmentation/Fill Label");
215 setDesc(
"Replace a label with another one");
216 setIcon(QIcon(
":/images/FillLabel.png"));
218 addParm(
"Filled label",
"Filled label",
"1000");
219 addParm(
"New label",
"New label",
"0");
224 if(!checkState().store(STORE_LABEL))
226 Stack* stack = currentStack();
231 bool res = run(input, output, parm(
"Filled label").toUShort(), parm(
"New label").toUShort());
253 setName(
"Stack/Segmentation/Erase at Border");
254 setDesc(
"Erase any labelled region touching the border of the image");
255 setIcon(QIcon(
":/images/EraseLabel.png"));
260 if(!checkState().store(STORE_LABEL))
262 Stack* stack = currentStack();
267 bool res = run(input, output);
290 setName(
"Stack/Segmentation/Export by Label");
291 setDesc(
" Export stack to individual files, one per label");
293 addParm(
"File Prefix",
"Prefix for file name",
"Cell");