1 #ifndef STACKPROCESSMORPHOLOGY_HPP
2 #define STACKPROCESSMORPHOLOGY_HPP
25 if(!checkState().store(STORE_NON_EMPTY | STORE_NON_LABEL))
27 Stack* stack = currentStack();
30 bool res = (*this)(store, work, parms[0].toFloat(), parms[1].toFloat(), parms[2].toFloat(), parms[3].toUInt());
38 bool operator()(
Store* input,
Store* output,
float threshold,
float multiplier,
float factor, uint fillValue);
48 return "Do a multipass edge detection in Z direction.\n"
49 "Stack is turned into a mask (0 or fill value)";
60 return QStringList() <<
"Values of signal that should not belong to surface."
61 <<
"Multiplicative factor for the threshold."
62 <<
"Adaptative factor for threshold."
63 <<
"Value to fill the mask with.";
73 return QIcon(
":/images/EdgeDetect.png");
98 if(!checkState().store(STORE_NON_EMPTY))
100 Stack* s = currentStack();
103 bool res = (*this)(s, input, output, parms[0].toUInt(), parms[1].toUInt(), parms[2].toUInt(),
111 bool operator()(
Stack* stack,
const Store* input,
Store* output, uint xradius, uint yradius, uint zradius,
112 bool auto_resize =
true);
121 return "Morphological dilation (max filter) on stack";
147 map[3] = booleanChoice();
151 return QIcon(
":/images/Dilate.png");
176 if(!checkState().store(STORE_NON_EMPTY))
178 Stack* s = currentStack();
181 bool res = (*this)(s, input, output, parms[0].toUInt(), parms[1].toUInt(), parms[2].toUInt(),
189 bool operator()(
Stack* stack,
const Store* input,
Store* output, uint xradius, uint yradius, uint zradius,
190 bool auto_resize =
true);
199 return "Morphological erosion on stack";
225 map[3] = booleanChoice();
229 return QIcon(
":/images/Erode.png");
252 if(!checkState().store(STORE_NON_EMPTY))
254 Stack* s = currentStack();
257 bool res = (*this)(s, input, output, parms[0].toUInt(), parms[1].toUInt(), parms[2].toUInt());
264 bool operator()(
Stack* stack,
const Store* input,
Store* output, uint xradius, uint yradius, uint zradius);
273 return "Morphological closure (i.e. dilatation followed erosion) on stack";
294 return QIcon(
":/images/Closing.png");
318 if(!checkState().store(STORE_NON_EMPTY))
320 Stack* s = currentStack();
323 bool res = (*this)(s, input, output, parms[0].toUInt(), parms[1].toUInt(), parms[2].toUInt());
330 bool operator()(
Stack* stack,
const Store* input,
Store* output, uint xradius, uint yradius, uint zradius);
339 return "Morphological opening (i.e. erosion followed dilatation) on stack";
360 return QIcon(
":/images/Opening.png");
374 if(!checkState().store(STORE_NON_EMPTY | STORE_NON_LABEL))
376 Stack* s = currentStack();
379 bool res = (*this)(input, output, parms[0].toUInt(), parms[1].toUInt(), parms[2].toUInt(), parms[3].toUInt());
386 bool operator()(
const Store* input,
Store* output, uint xradius, uint yradius, uint threshold, uint fillValue);
396 return "Fill holes in stack.\n"
397 "Use after Edge Detect.";
409 <<
"Y Radius of hole"
410 <<
"Minimal signal value to fill the hole."
411 <<
"Filling value. Usually same as Edge Detect.";
421 return QIcon(
":/images/FillHoles.png");
444 if(!checkState().store(STORE_NON_EMPTY | STORE_LABEL))
446 Stack* s = currentStack();
449 bool res = (*this)(s, input, output, parms[0].toUInt(), parms[1].toUInt(), parms[2].toUInt());
456 bool operator()(
Stack* stack,
const Store* input,
Store* output, uint xradius, uint yradius, uint zradius);
462 return "Open by label";
465 return "Morphological opening on a labeled stack";
486 return QIcon(
":/images/Opening.png");
511 if(!checkState().store(STORE_NON_EMPTY | STORE_LABEL))
513 Stack* s = currentStack();
516 bool res = (*this)(s, input, output, parms[0].toUInt(), parms[1].toUInt(), parms[2].toUInt());
523 bool operator()(
Stack* stack,
const Store* input,
Store* output, uint xradius, uint yradius, uint zradius);
529 return "Close by label";
532 return "Morphological closure on a labeled stack";
553 return QIcon(
":/images/Closing.png");
583 if(!checkState().store(STORE_NON_EMPTY))
585 Stack* stack = currentStack();
588 bool res = (*this)(stack, input, output, parms[0], parms[1].toUInt());
601 return "Apply Mask to Stack";
604 return "Apply the work mask to the main replacing work";
630 return QIcon(
":/images/Mask.png");
655 if(!checkState().store(STORE_NON_EMPTY))
657 Stack* stack = currentStack();
660 bool res = (*this)(stack, input, output, parms[0].toUInt(),
stringToBool(parms[1]));
664 output->setLabels(
true);
668 bool operator()(
Stack* stack,
const Store* input,
Store* output,
bool invert, uint threshold);
674 return "Apply Mask to Labels";
677 return "Apply mask in work stack to labels in main stack, replacing work";
697 map[0] = booleanChoice();
701 return QIcon(
":/images/MaskLabels.png");
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: StackProcessMorphology.hpp:222
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessMorphology.hpp:413
QString folder() const
Folder in which to place the process.
Definition: StackProcessMorphology.hpp:114
QString folder() const
Folder in which to place the process.
Definition: StackProcessMorphology.hpp:40
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessMorphology.hpp:479
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessMorphology.hpp:150
Close the gray-level stack using a cubic kernel.
Definition: StackProcessMorphology.hpp:242
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessMorphology.hpp:420
QString folder() const
Folder in which to place the process.
Definition: StackProcessMorphology.hpp:332
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: StackProcessMorphology.hpp:621
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessMorphology.hpp:338
QStringList parmNames() const
List of named parameters.
Definition: StackProcessMorphology.hpp:275
QString name() const
Returns the name of the process.
Definition: StackProcessMorphology.hpp:117
QString folder() const
Folder in which to place the process.
Definition: StackProcessMorphology.hpp:192
QStringList parmNames() const
List of named parameters.
Definition: StackProcessMorphology.hpp:467
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: StackProcessMorphology.hpp:694
QString name() const
Returns the name of the process.
Definition: StackProcessMorphology.hpp:528
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessMorphology.hpp:684
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessMorphology.hpp:700
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessMorphology.hpp:581
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessMorphology.hpp:485
const Store * currentStore() const
Returns the current store.
Definition: Stack.hpp:112
Open the gray-level stack using a cubic kernel.
Definition: StackProcessMorphology.hpp:308
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessMorphology.hpp:616
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessMorphology.hpp:347
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessMorphology.hpp:473
QStringList parmNames() const
List of named parameters.
Definition: StackProcessMorphology.hpp:341
QString name() const
Returns the name of the process.
Definition: StackProcessMorphology.hpp:673
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessMorphology.hpp:611
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessMorphology.hpp:552
Definition: StackProcessMorphology.hpp:364
QString name() const
Returns the name of the process.
Definition: StackProcessMorphology.hpp:195
QStringList parmNames() const
List of named parameters.
Definition: StackProcessMorphology.hpp:679
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessMorphology.hpp:120
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessMorphology.hpp:509
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessMorphology.hpp:629
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessMorphology.hpp:406
Apply a mask to labels.
Definition: StackProcessMorphology.hpp:645
QStringList parmNames() const
List of named parameters.
Definition: StackProcessMorphology.hpp:51
QString name() const
Returns the name of the process.
Definition: StackProcessMorphology.hpp:461
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessMorphology.hpp:137
The Store class holds the actual 3D data and properties specific to it.
Definition: Store.hpp:25
Erode the gray-level stack using a cubic kernel.
Definition: StackProcessMorphology.hpp:166
QString name() const
Returns the name of the process.
Definition: StackProcessMorphology.hpp:335
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessMorphology.hpp:353
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessMorphology.hpp:359
QString name() const
Returns the name of the process.
Definition: StackProcessMorphology.hpp:600
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessMorphology.hpp:228
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessMorphology.hpp:293
QString folder() const
Folder in which to place the process.
Definition: StackProcessMorphology.hpp:266
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: StackProcessMorphology.hpp:144
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessMorphology.hpp:531
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessMorphology.hpp:46
QString folder() const
Folder in which to place the process.
Definition: StackProcessMorphology.hpp:670
TODO: This class needs documenting!
Definition: StackProcessMorphology.hpp:15
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessMorphology.hpp:96
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessMorphology.hpp:394
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessMorphology.hpp:208
QString name() const
Returns the name of the process.
Definition: StackProcessMorphology.hpp:43
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessMorphology.hpp:540
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessMorphology.hpp:281
QString folder() const
Folder in which to place the process.
Definition: StackProcessMorphology.hpp:458
Close a labeled stack.
Definition: StackProcessMorphology.hpp:501
QStringList parmNames() const
List of named parameters.
Definition: StackProcessMorphology.hpp:123
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessMorphology.hpp:464
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessMorphology.hpp:58
File containing the definition of a Process.
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessMorphology.hpp:689
QString name() const
Returns the name of the process.
Definition: StackProcessMorphology.hpp:391
QString folder() const
Folder in which to place the process.
Definition: StackProcessMorphology.hpp:597
The Stack class represent the dimensions of the 3D data, and the frames transformations.
Definition: Stack.hpp:25
QStringList parmNames() const
List of named parameters.
Definition: StackProcessMorphology.hpp:399
QStringList parmNames() const
List of named parameters.
Definition: StackProcessMorphology.hpp:201
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessMorphology.hpp:653
This is the main process class, the one all process inherit from.
Definition: Process.hpp:248
QString folder() const
Folder in which to place the process.
Definition: StackProcessMorphology.hpp:388
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessMorphology.hpp:174
void hide()
Ask the user interface to hide this store.
Definition: Store.hpp:173
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessMorphology.hpp:198
mgx_EXPORT bool stringToBool(const QString &string)
Helper function converting a string into a boolean.
QStringList parmNames() const
List of named parameters.
Definition: StackProcessMorphology.hpp:606
Dilate the gray-level stack using a cubic kernel.
Definition: StackProcessMorphology.hpp:88
const Store * work() const
Access the work store.
Definition: Stack.hpp:93
QString name() const
Returns the name of the process.
Definition: StackProcessMorphology.hpp:269
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessMorphology.hpp:546
Apply a mask to a grey-level image.
Definition: StackProcessMorphology.hpp:573
QString folder() const
Folder in which to place the process.
Definition: StackProcessMorphology.hpp:525
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessMorphology.hpp:215
const Store * main() const
Access the main store.
Definition: Stack.hpp:74
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessMorphology.hpp:603
Stack processes have non-mutable access to meshes and mutable access to stacks.
Definition: Process.hpp:819
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessMorphology.hpp:72
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessMorphology.hpp:250
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessMorphology.hpp:65
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessMorphology.hpp:372
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessMorphology.hpp:676
QStringList parmNames() const
List of named parameters.
Definition: StackProcessMorphology.hpp:534
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessMorphology.hpp:130
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessMorphology.hpp:23
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessMorphology.hpp:442
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessMorphology.hpp:316
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessMorphology.hpp:272
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessMorphology.hpp:287
Open a labeled stack.
Definition: StackProcessMorphology.hpp:434