11 #ifndef STACKPROCESSFILTERS_HPP 12 #define STACKPROCESSFILTERS_HPP 34 if(!checkState().store(STORE_NON_EMPTY))
36 Store* input = currentStack()->currentStore();
37 Store* output = currentStack()->work();
38 Point3i r(parms[0].toInt(), parms[1].toInt(), parms[2].toInt());
39 bool res = (*this)(input, output, r, parms[3].toUInt());
75 if(!checkState().store(STORE_NON_EMPTY))
77 Stack* s = currentStack();
80 bool res = (*this)(input, output, parms[0].toFloat());
87 bool operator()(
const Store* input,
Store* output,
float brightness);
92 "Brighten or Darken stack.\n" 93 "A value > 1 will brighten the stack, < 1 will darken it.\n" 94 "To convert from a 12bit to a 16bit stack, use 16.\n" 95 "To convert from a 8bit to a 16bit stack, use 256.\n"; }
118 if(!checkState().store(STORE_NON_EMPTY))
120 Stack* s = currentStack();
123 bool res = (*this)(input, output, parms[0].toUShort());
130 bool operator()(
const Store* input,
Store* output, ushort threshold);
140 return "Transform the stack to binary (65535 or 0).\n" 141 "All voxels with an intensity greater than the threshold to 65535, while to others are set to 0.";
147 return QStringList() <<
"Voxels above this threshold will be assigned 1.";
153 return QIcon(
":/images/Brightness.png");
172 if(!checkState().store(STORE_NON_EMPTY))
174 Stack* s = currentStack();
177 bool res = (*this)(input, output, parms[0].toFloat());
184 bool operator()(
const Store* input,
Store* output,
float colorGradDiv);
190 return "Color Gradient";
193 return "Compute color gradient in Z direction";
199 return QStringList() <<
"Factor by which the gradient is divided by.";
205 return QIcon(
":/images/ColorGrad.png");
224 if(!checkState().store(STORE_NON_EMPTY))
226 Stack* s = currentStack();
229 bool res = (*this)(input, output);
236 bool operator()(
const Store* input,
Store* output);
245 return "Invert the stack";
254 return QIcon(
":/images/Invert.png");
273 if(!checkState().store(STORE_NON_EMPTY))
275 Stack* s = currentStack();
278 bool res = (*this)(input, output, parms[0].toUInt(), parms[1].toUInt());
285 bool operator()(
const Store* input,
Store* output, uint lowFilter, uint highFilter);
291 return "Trim high/low values";
295 return "Clip the voxel intensities to the interval [Low Threshold, High Threshold].";
313 return QIcon(
":/images/Filter.png");
335 if(!checkState().store(STORE_NON_EMPTY))
337 Stack* s = currentStack();
340 Point3f sigma(parms[0].toFloat(), parms[1].toFloat(), parms[2].toFloat());
341 bool res = (*this)(input, output, sigma);
354 return "Gaussian Blur Stack";
357 return "Blur the stack, radius = 3 x Sigma";
376 return QIcon(
":/images/Blur.png");
399 if(!checkState().store(STORE_NON_EMPTY))
401 Stack* s = currentStack();
404 Point3f sigma(parms[0].toFloat(), parms[1].toFloat(), parms[2].toFloat());
405 bool res = (*this)(input, output, sigma, parms[3].toFloat());
412 bool operator()(
const Store* input,
Store* output,
const Point3f sigma,
const float amount);
418 return "Sharpen Stack";
421 return "Sharpen the stack, radius = 3 x Sigma";
426 <<
QString(
"Z Sigma (%1)").
arg(UM) <<
"Amount";
431 <<
QString(
"Z Sigma (%1)").
arg(UM) <<
"Amount";
441 return QIcon(
":/images/Sharpen.png");
463 if(!checkState().store(STORE_NON_EMPTY))
465 Stack* s = currentStack();
470 QString fields[3] = {
"x",
"y",
"z" };
471 for(
int i = 0; i < 3; i++) {
474 kernels[i].resize(field_values.size());
475 for(
size_t j = 0; j < (size_t)field_values.size(); ++j) {
476 kernels[i][j] = field_values[j].toFloat(&ok);
478 return setErrorMessage(
479 QString(
"Value %1 of field %2 if not a valid number.").arg(j).arg(fields[i]));
483 bool res = (*this)(input, output, kernels[0], kernels[1], kernels[2]);
490 bool operator()(
const Store* input,
Store* output,
const HVecF& kernelX,
const HVecF& kernelY,
491 const HVecF& kernelZ);
497 return "Apply Separable Kernel";
500 return "Kernel must have odd number of values";
521 return QIcon(
":/images/Kernel.png");
544 if(!checkState().store(STORE_NON_EMPTY))
546 Stack* s = currentStack();
549 Point3f radius(parms[0].toFloat(), parms[1].toFloat(), parms[2].toFloat());
550 Point3f sigma(parms[3].toFloat(), parms[4].toFloat(), parms[5].toFloat());
551 bool res = (*this)(input, output, radius, sigma, parms[6].toUInt(), parms[7].toFloat());
558 bool operator()(
const Store* input,
Store* output,
Point3f radius,
Point3f sigma, uint threshold,
float blurFactor);
564 return "Normalize Stack";
567 return "Normalize the stack";
579 <<
QString(
"Y Radius (%1) for the locality of normalization").
arg(UM)
580 <<
QString(
"Z Radius (%1) for the locality of normalization").
arg(UM)
581 <<
QString(
"X Sigma (%1) for pre-blur").
arg(UM)
582 <<
QString(
"Y Sigma (%1) for pre-blur").
arg(UM)
583 <<
QString(
"Z Sigma (%1) for pre-blur").
arg(UM)
584 <<
"Threshold under which pixels are cleared considered as background" 585 <<
"Relative contribution of blurred vs unblurred dilation";
599 return QIcon(
":/images/Normalize.png");
618 if(!checkState().store(STORE_NON_EMPTY))
620 Stack* s = currentStack();
623 bool res = (*this)(input, output, parms[0].toUInt());
631 bool operator()(
const Store* input,
Store* output, uint radius);
637 return "Cimg Gaussian Blur";
640 return "Cimg Gaussian Blur";
652 return QIcon(
":/images/Blur.png");
671 if(!checkState().store(STORE_NON_EMPTY))
673 Stack* s = currentStack();
676 bool res = (*this)(input, output);
683 bool operator()(
const Store* input,
Store* output);
689 return "CImg Laplace Transform";
692 return "CImg Laplace transform of stack";
701 return QIcon(
":/images/Laplace.png");
708 #endif // STACKPROCESSFILTERS_HPP QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:152
void show()
Ask the user interface to show this store.
Definition: Store.hpp:177
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:697
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:51
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:312
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:73
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:375
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:499
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:55
Change the global luminosity of the stack.
Definition: StackProcessFilters.hpp:69
Blur the stack using a Gaussian kernel or specified radius.
Definition: StackProcessFilters.hpp:325
split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive)
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:146
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:192
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:616
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:440
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:587
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: StackProcessFilters.hpp:99
const Store * currentStore() const
Returns the current store.
Definition: Stack.hpp:122
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:297
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:138
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:685
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:195
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:356
Compute the local average of each voxel of the stack.
Definition: StackProcessFilters.hpp:28
Compute the gradient of the image in the Z axis of the image.
Definition: StackProcessFilters.hpp:162
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:189
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:569
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:633
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:135
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:271
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:89
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:201
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:700
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:417
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:238
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:639
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:143
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:98
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:97
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:359
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:52
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:333
Invert the intensity of all voxels in the stack.
Definition: StackProcessFilters.hpp:214
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:642
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:566
Apply a user-defined convolution kernel to the current image.
Definition: StackProcessFilters.hpp:453
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:253
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:53
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:293
The Store class holds the actual 3D data and properties specific to it.
Definition: Store.hpp:35
Compute the Laplacian of the stack (using CImg).
Definition: StackProcessFilters.hpp:661
Binarize the stack: set the intensity of any voxel greater than the threshold to 65535 and all other ...
Definition: StackProcessFilters.hpp:108
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:149
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:54
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:669
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:307
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:598
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:542
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:96
CImg implementation of the gaussian blur.
Definition: StackProcessFilters.hpp:608
This namespace contains all the API of MorphoGraphX.
Definition: Assert.hpp:26
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:636
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:461
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:50
Namespace containing all the utility classes.
Definition: Vector.hpp:47
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:170
Apply an "unsharp" filter to the stack.
Definition: StackProcessFilters.hpp:389
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:691
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:520
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:247
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:563
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:287
File containing the definition of a Process.
The Stack class represent the dimensions of the 3D data, and the frames transformations.
Definition: Stack.hpp:35
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:496
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:241
This is the main process class, the one all process inherit from.
Definition: Process.hpp:258
void hide()
Ask the user interface to hide this store.
Definition: Store.hpp:183
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:576
This namespace contains all the classes needed to define processes.
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:350
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:428
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:502
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:651
const Store * work() const
Access the work store.
Definition: Stack.hpp:103
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:49
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:198
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:645
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:91
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:508
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:244
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:250
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:648
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:302
Clip the intensity of the stack to the interval [Low Threshold, High Threshold].
Definition: StackProcessFilters.hpp:263
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:414
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:90
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:694
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:186
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:433
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:364
Normalize the intensity of the stack.
Definition: StackProcessFilters.hpp:534
Stack processes have non-mutable access to meshes and mutable access to stacks.
Definition: Process.hpp:829
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:493
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:132
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:32
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:397
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:369
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:420
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:423
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:222
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:204
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:560
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:290
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:353
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:514
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:116
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:688