1 #ifndef MESH_PROCESS_SEGMENTATION_HPP
2 #define MESH_PROCESS_SEGMENTATION_HPP
30 if(!checkState().mesh())
32 return (*
this)(currentMesh(), parms[0].toUInt(), currentMesh()->activeVertices());
35 bool operator()(
Mesh* mesh, uint maxsteps,
const std::vector<vertex>& to_segment);
38 return "Segmentation";
41 return "Watershed Segmentation";
44 return "Propagate labels on mesh using the watershed algorithm.";
51 return QStringList() <<
"Number of propagation steps performed before updating display. "
52 "Increase value to run faster.";
58 return QIcon(
":/images/SegmentMesh.png");
77 if(!checkState().mesh())
79 return (*
this)(currentMesh());
82 bool operator()(
Mesh* mesh);
85 return "Segmentation";
88 return "Segmentation Clear";
91 return "Clean all mesh labels.";
100 return QIcon(
":/images/SegmentClear.png");
122 if(!checkState().mesh(MESH_NON_EMPTY | MESH_LABEL))
124 Mesh* m = currentMesh();
125 int start = parms[0].toInt();
126 int step = parms[1].toInt();
127 return (*
this)(m, start, step);
130 bool operator()(
Mesh* m,
int start,
int step);
133 return "Segmentation";
139 return "Relabel a mesh randomly to use consecutive labels.";
149 <<
"Increment step.";
157 return QIcon(
":/images/Relabel.png");
176 if(!checkState().mesh(MESH_NON_EMPTY, 0).mesh(MESH_NON_EMPTY, 1))
180 if(currentMesh() == mesh(0)) {
183 }
else if(currentMesh() == mesh(1)) {
189 bool res = (*this)(mesh1, mesh2, parms[0].toFloat());
193 bool operator()(
Mesh* mesh1,
Mesh* mesh2,
float tolerance);
196 return "3D Grab Labels";
199 return "Grab labels from other mesh (3D meshes).";
202 return "Segmentation";
208 return QStringList() <<
"Maximal distance between matching cells. ";
214 return QIcon(
":/images/GrabLabels.png");
233 if(!checkState().mesh(MESH_LABEL))
235 return (*
this)(currentMesh(), parms[0].toInt());
238 bool operator()(
Mesh* mesh,
int label);
241 return "Segmentation";
244 return "Label Selected Vertices";
247 return "Label selected vertices with the same value, which can be a new label";
253 return QStringList() <<
"Asign this label to all selected vertices.";
259 return QIcon(
":/images/LabelSelected.png");
278 if(!checkState().mesh(MESH_NON_EMPTY))
280 Mesh* mesh = currentMesh();
281 bool res = (*this)(mesh, parms[0].toInt(), parms[1].toInt());
287 bool operator()(
Mesh* mesh,
int label_start,
int label_step);
290 return "Segmentation";
293 return "Relabel 3D Cells";
297 return "Relabel 3D cells (connected regions)."
298 " A start label of -1 is used to indicate continuing using current labels.";
307 return QStringList() <<
"Starting label. Use -1 to continue from last current label."
308 <<
"Increment step.";
316 return QIcon(
":/images/CellFiles3D.png");
337 return (*
this)(
currentMesh(), parms[0].toFloat(), parms[1].toFloat());
343 return "Segmentation";
346 return "Combine Labels";
349 return "Combine over-segmented regions, based on mesh signal.";
356 return QStringList() <<
"Half of the cell border width on the mesh."
357 <<
"Ratio of border signal over internal signal. If a border between 2 cells "
358 "has a ratio below the threshold, the cells are fused.";
366 return QIcon(
":/images/Merge.png");
389 parms[3].toFloat(), parms[4].toFloat(), parms[5].toFloat(), parms[6].toFloat(),
393 bool operator()(
Mesh*
mesh,
bool updateView,
bool normalize,
float gaussianRadiusCell,
float localMinimaRadius,
394 float gaussianRadiusWall,
float normalizeRadius,
float borderDist,
float threshold);
397 return "Segmentation";
400 return "Auto-Segmentation";
404 return "Auto-Segmentation of the mesh surface based on signal. Combines blurring, auto-seeding, "
405 "label propagation by watershed and fusion of over-segmented cells.";
410 <<
"Normalize" <<
QString(
"Blur Cell Radius (%1)").
arg(UM)
413 <<
"Combine Threshold";
418 <<
"Option to update mesh drawing while running processes."
419 <<
"Option to normalize mesh signal before merging the cells. Most usefull in case of low contrast mesh "
421 <<
"Radius used for gaussian blur of mesh signal. In normal cases, should be equal to auto-seed radius."
422 <<
"Radius used for auto-seeding the mesh, based on local minima of signal. Should be equal to radius "
424 <<
"Radius used for gaussian blur of signal on cell borders before watershed segmentation. Use small "
425 "values (roughly, half the border width) to avoid border signal distortion."
426 <<
"Radius used for local normalization of signal. Roughly, radius of largest cells."
427 <<
"Half of the cell border width after blurring. Used for fusion of over-segmented cells."
428 <<
"Ratio of border signal over internal signal. If a borders between 2 cells have a ratio below the "
429 "threshold, the cells are fused.";
450 return QIcon(
":/images/SegmentMesh.png");
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:210
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:300
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:201
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:28
Relabel 3D cells.
Definition: MeshProcessSegmentation.hpp:268
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:54
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:396
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:289
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:40
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:57
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:345
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:351
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:151
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:132
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: MeshProcessSegmentation.hpp:442
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:90
Process()
Default constructor.
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:342
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:207
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:138
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:431
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:75
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:120
Combine over-segmented regions, based on mesh signal.
Definition: MeshProcessSegmentation.hpp:325
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:240
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:333
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:96
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:174
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:295
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:402
CheckState checkState()
Call this function and convert the result to a boolean.
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:156
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:246
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:167
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:243
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:198
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:407
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:258
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:315
Segment the mesh using a seeded watershed algorithm.
Definition: MeshProcessSegmentation.hpp:20
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:384
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:354
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:49
Change the label of the selected vertices.
Definition: MeshProcessSegmentation.hpp:223
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:135
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:213
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:46
File containing the definition of a Process.
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:365
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:231
Mesh * mesh(int i)
Returns the ith mesh.
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessSegmentation.hpp:276
Remove any segmentation from the current mesh.
Definition: MeshProcessSegmentation.hpp:67
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:305
This is the main process class, the one all process inherit from.
Definition: Process.hpp:248
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:249
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:99
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:360
Grab labels from other mesh (3D meshes).
Definition: MeshProcessSegmentation.hpp:166
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:93
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:376
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessSegmentation.hpp:449
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:37
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:310
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessSegmentation.hpp:255
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:146
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:43
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessSegmentation.hpp:348
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:141
Non-empty mesh.
Definition: Process.hpp:664
QString folder() const
Folder in which to place the process.
Definition: MeshProcessSegmentation.hpp:84
QStringList booleanChoice() const
Helper function that provides a list of choices for a boolean argument.
Definition: Process.hpp:599
Relabel a segmented mesh.
Definition: MeshProcessSegmentation.hpp:112
Mesh * currentMesh()
Returns the current mesh (i.e.
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:399
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:195
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:415
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessSegmentation.hpp:204
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:292
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessSegmentation.hpp:252
Mesh processes have mutable access to meshes and non-mutable access to stacks.
Definition: Process.hpp:855
QString name() const
Returns the name of the process.
Definition: MeshProcessSegmentation.hpp:87