11 #ifndef MESH_PROCESS_SEGMENTATION_HPP 12 #define MESH_PROCESS_SEGMENTATION_HPP 40 if(!checkState().mesh())
42 return (*
this)(currentMesh(), parms[0].toUInt(), currentMesh()->activeVertices());
45 bool operator()(
Mesh* mesh, uint maxsteps,
const std::vector<vertex>& to_segment);
48 return "Segmentation";
51 return "Watershed Segmentation";
54 return "Propagate labels on mesh using the watershed algorithm.";
61 return QStringList() <<
"Number of propagation steps performed before updating display. " 62 "Increase value to run faster.";
68 return QIcon(
":/images/SegmentMesh.png");
87 if(!checkState().mesh())
89 return (*
this)(currentMesh());
92 bool operator()(
Mesh* mesh);
95 return "Segmentation";
98 return "Segmentation Clear";
101 return "Clean all mesh labels.";
110 return QIcon(
":/images/SegmentClear.png");
132 if(!checkState().mesh(MESH_NON_EMPTY | MESH_LABEL))
134 Mesh* m = currentMesh();
135 int start = parms[0].toInt();
136 int step = parms[1].toInt();
137 return (*
this)(m, start, step);
140 bool operator()(
Mesh* m,
int start,
int step);
143 return "Segmentation";
149 return "Relabel a mesh randomly to use consecutive labels.";
159 <<
"Increment step.";
167 return QIcon(
":/images/Relabel.png");
186 if(!checkState().mesh(MESH_NON_EMPTY, 0).mesh(MESH_NON_EMPTY, 1))
190 if(currentMesh() == mesh(0)) {
193 }
else if(currentMesh() == mesh(1)) {
199 bool res = (*this)(mesh1, mesh2, parms[0].toFloat());
203 bool operator()(
Mesh* mesh1,
Mesh* mesh2,
float tolerance);
206 return "3D Grab Labels";
209 return "Grab labels from other mesh (3D meshes).";
212 return "Segmentation";
218 return QStringList() <<
"Maximal distance between matching cells. ";
224 return QIcon(
":/images/GrabLabels.png");
243 if(!checkState().mesh(MESH_LABEL))
245 return (*
this)(currentMesh(), parms[0].toInt());
248 bool operator()(
Mesh* mesh,
int label);
251 return "Segmentation";
254 return "Label Selected Vertices";
257 return "Label selected vertices with the same value, which can be a new label";
263 return QStringList() <<
"Asign this label to all selected vertices.";
269 return QIcon(
":/images/LabelSelected.png");
288 if(!checkState().mesh(MESH_NON_EMPTY))
290 Mesh* mesh = currentMesh();
291 bool res = (*this)(mesh, parms[0].toInt(), parms[1].toInt());
297 bool operator()(
Mesh* mesh,
int label_start,
int label_step);
300 return "Segmentation";
303 return "Relabel 3D Cells";
307 return "Relabel 3D cells (connected regions)." 308 " A start label of -1 is used to indicate continuing using current labels.";
317 return QStringList() <<
"Starting label. Use -1 to continue from last current label." 318 <<
"Increment step.";
326 return QIcon(
":/images/CellFiles3D.png");
345 if(!checkState().mesh(MESH_NON_EMPTY))
347 return (*
this)(currentMesh(), parms[0].toFloat(), parms[1].toFloat());
350 bool operator()(
Mesh* mesh,
float borderDist,
float Difference);
353 return "Segmentation";
356 return "Combine Labels";
359 return "Combine over-segmented regions, based on mesh signal.";
366 return QStringList() <<
"Half of the cell border width on the mesh." 367 <<
"Ratio of border signal over internal signal. If a border between 2 cells " 368 "has a ratio below the threshold, the cells are fused.";
376 return QIcon(
":/images/Merge.png");
396 if(!checkState().mesh(MESH_NON_EMPTY))
399 parms[3].toFloat(), parms[4].toFloat(), parms[5].toFloat(), parms[6].toFloat(),
403 bool operator()(
Mesh* mesh,
bool updateView,
bool normalize,
float gaussianRadiusCell,
float localMinimaRadius,
404 float gaussianRadiusWall,
float normalizeRadius,
float borderDist,
float threshold);
407 return "Segmentation";
410 return "Auto-Segmentation";
414 return "Auto-Segmentation of the mesh surface based on signal. Combines blurring, auto-seeding, " 415 "label propagation by watershed and fusion of over-segmented cells.";
420 <<
"Normalize" <<
QString(
"Blur Cell Radius (%1)").
arg(UM)
423 <<
"Combine Threshold";
428 <<
"Option to update mesh drawing while running processes." 429 <<
"Option to normalize mesh signal before merging the cells. Most usefull in case of low contrast mesh " 431 <<
"Radius used for gaussian blur of mesh signal. In normal cases, should be equal to auto-seed radius." 432 <<
"Radius used for auto-seeding the mesh, based on local minima of signal. Should be equal to radius " 434 <<
"Radius used for gaussian blur of signal on cell borders before watershed segmentation. Use small " 435 "values (roughly, half the border width) to avoid border signal distortion." 436 <<
"Radius used for local normalization of signal. Roughly, radius of largest cells." 437 <<
"Half of the cell border width after blurring. Used for fusion of over-segmented cells." 438 <<
"Ratio of border signal over internal signal. If a borders between 2 cells have a ratio below the " 439 "threshold, the cells are fused.";
455 map[0] = booleanChoice();
456 map[1] = booleanChoice();
460 return QIcon(
":/images/SegmentMesh.png");
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:220
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:310
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:211
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:38
Relabel 3D cells.
Definition: MeshProcessSegmentation.hpp:278
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:64
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:406
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:299
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:50
arg(const QString &a, int fieldWidth=0, const QChar &fillChar=QLatin1Char( ' ')
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:67
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:355
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:361
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:161
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:142
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: MeshProcessSegmentation.hpp:452
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:100
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:352
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:217
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:148
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:441
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:85
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:130
Combine over-segmented regions, based on mesh signal.
Definition: MeshProcessSegmentation.hpp:335
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:250
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:343
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:106
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:184
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:305
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:412
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:166
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:256
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:177
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:253
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:208
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:417
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:268
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:325
This namespace contains all the API of MorphoGraphX.
Definition: Assert.hpp:26
Segment the mesh using a seeded watershed algorithm.
Definition: MeshProcessSegmentation.hpp:30
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:394
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:364
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:59
Change the label of the selected vertices.
Definition: MeshProcessSegmentation.hpp:233
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:145
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:223
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:56
File containing the definition of a Process.
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:375
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:241
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:286
Remove any segmentation from the current mesh.
Definition: MeshProcessSegmentation.hpp:77
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:315
This is the main process class, the one all process inherit from.
Definition: Process.hpp:258
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:259
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:109
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:370
Grab labels from other mesh (3D meshes).
Definition: MeshProcessSegmentation.hpp:176
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:103
mgx_EXPORT bool stringToBool(const QString &string)
Helper function converting a string into a boolean.
Auto-Segmentation of the mesh surface based on signal.
Definition: MeshProcessSegmentation.hpp:386
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:459
This namespace contains all the classes needed to define processes.
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:47
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:320
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:265
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:156
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:53
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:358
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:151
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:94
Relabel a segmented mesh.
Definition: MeshProcessSegmentation.hpp:122
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:409
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:205
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:425
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:214
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:302
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:262
Mesh processes have mutable access to meshes and non-mutable access to stacks.
Definition: Process.hpp:865
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:97