1 #ifndef STACKPROCESSFILTERS_HPP
2 #define STACKPROCESSFILTERS_HPP
6 namespace mgx {
namespace process
24 if(!checkState().store(STORE_NON_EMPTY))
26 Store* input = currentStack()->currentStore();
27 Store* output = currentStack()->work();
28 Point3i r(parms[0].toInt(), parms[1].toInt(), parms[2].toInt());
29 bool res = (*this)(input, output, r, parms[3].toUInt());
65 if(!checkState().store(STORE_NON_EMPTY))
67 Stack* s = currentStack();
70 bool res = (*this)(input, output, parms[0].toFloat());
77 bool operator()(
const Store* input,
Store* output,
float brightness);
82 "Brighten or Darken stack.\n"
83 "A value > 1 will brighten the stack, < 1 will darken it.\n"
84 "To convert from a 12bit to a 16bit stack, use 16.\n"
85 "To convert from a 8bit to a 16bit stack, use 256.\n"; }
108 if(!checkState().store(STORE_NON_EMPTY))
110 Stack* s = currentStack();
113 bool res = (*this)(input, output, parms[0].toUShort());
120 bool operator()(
const Store* input,
Store* output, ushort threshold);
130 return "Transform the stack to binary (65535 or 0).\n"
131 "All voxels with an intensity greater than the threshold to 65535, while to others are set to 0.";
137 return QStringList() <<
"Voxels above this threshold will be assigned 1.";
143 return QIcon(
":/images/Brightness.png");
162 if(!checkState().store(STORE_NON_EMPTY))
164 Stack* s = currentStack();
167 bool res = (*this)(input, output, parms[0].toFloat());
174 bool operator()(
const Store* input,
Store* output,
float colorGradDiv);
180 return "Color Gradient";
183 return "Compute color gradient in Z direction";
189 return QStringList() <<
"Factor by which the gradient is divided by.";
195 return QIcon(
":/images/ColorGrad.png");
214 if(!checkState().store(STORE_NON_EMPTY))
216 Stack* s = currentStack();
219 bool res = (*this)(input, output);
226 bool operator()(
const Store* input,
Store* output);
235 return "Invert the stack";
244 return QIcon(
":/images/Invert.png");
263 if(!checkState().store(STORE_NON_EMPTY))
265 Stack* s = currentStack();
268 bool res = (*this)(input, output, parms[0].toUInt(), parms[1].toUInt());
275 bool operator()(
const Store* input,
Store* output, uint lowFilter, uint highFilter);
281 return "Trim high/low values";
285 return "Clip the voxel intensities to the interval [Low Threshold, High Threshold].";
303 return QIcon(
":/images/Filter.png");
325 if(!checkState().store(STORE_NON_EMPTY))
327 Stack* s = currentStack();
330 Point3f sigma(parms[0].toFloat(), parms[1].toFloat(), parms[2].toFloat());
331 bool res = (*this)(input, output, sigma);
344 return "Gaussian Blur Stack";
347 return "Blur the stack, radius = 3 x Sigma";
366 return QIcon(
":/images/Blur.png");
389 if(!checkState().store(STORE_NON_EMPTY))
391 Stack* s = currentStack();
394 Point3f sigma(parms[0].toFloat(), parms[1].toFloat(), parms[2].toFloat());
395 bool res = (*this)(input, output, sigma, parms[3].toFloat());
402 bool operator()(
const Store* input,
Store* output,
const Point3f sigma,
const float amount);
408 return "Sharpen Stack";
411 return "Sharpen the stack, radius = 3 x Sigma";
416 <<
QString(
"Z Sigma (%1)").
arg(UM) <<
"Amount";
421 <<
QString(
"Z Sigma (%1)").
arg(UM) <<
"Amount";
431 return QIcon(
":/images/Sharpen.png");
453 if(!checkState().store(STORE_NON_EMPTY))
455 Stack* s = currentStack();
460 QString fields[3] = {
"x",
"y",
"z" };
461 for(
int i = 0; i < 3; i++) {
464 kernels[i].resize(field_values.size());
465 for(
size_t j = 0; j < (size_t)field_values.size(); ++j) {
466 kernels[i][j] = field_values[j].toFloat(&ok);
468 return setErrorMessage(
469 QString(
"Value %1 of field %2 if not a valid number.").arg(j).arg(fields[i]));
473 bool res = (*this)(input, output, kernels[0], kernels[1], kernels[2]);
480 bool operator()(
const Store* input,
Store* output,
const HVecF& kernelX,
const HVecF& kernelY,
481 const HVecF& kernelZ);
487 return "Apply Separable Kernel";
490 return "Kernel must have odd number of values";
511 return QIcon(
":/images/Kernel.png");
534 if(!checkState().store(STORE_NON_EMPTY))
536 Stack* s = currentStack();
539 Point3f radius(parms[0].toFloat(), parms[1].toFloat(), parms[2].toFloat());
540 Point3f sigma(parms[3].toFloat(), parms[4].toFloat(), parms[5].toFloat());
541 bool res = (*this)(input, output, radius, sigma, parms[6].toUInt(), parms[7].toFloat());
548 bool operator()(
const Store* input,
Store* output,
Point3f radius,
Point3f sigma, uint threshold,
float blurFactor);
554 return "Normalize Stack";
557 return "Normalize the stack";
569 <<
QString(
"Y Radius (%1) for the locality of normalization").
arg(UM)
570 <<
QString(
"Z Radius (%1) for the locality of normalization").
arg(UM)
571 <<
QString(
"X Sigma (%1) for pre-blur").
arg(UM)
572 <<
QString(
"Y Sigma (%1) for pre-blur").
arg(UM)
573 <<
QString(
"Z Sigma (%1) for pre-blur").
arg(UM)
574 <<
"Threshold under which pixels are cleared considered as background"
575 <<
"Relative contribution of blurred vs unblurred dilation";
589 return QIcon(
":/images/Normalize.png");
608 if(!checkState().store(STORE_NON_EMPTY))
610 Stack* s = currentStack();
613 bool res = (*this)(input, output, parms[0].toUInt());
621 bool operator()(
const Store* input,
Store* output, uint radius);
627 return "Cimg Gaussian Blur";
630 return "Cimg Gaussian Blur";
642 return QIcon(
":/images/Blur.png");
661 if(!checkState().store(STORE_NON_EMPTY))
663 Stack* s = currentStack();
666 bool res = (*this)(input, output);
673 bool operator()(
const Store* input,
Store* output);
679 return "CImg Laplace Transform";
682 return "CImg Laplace transform of stack";
691 return QIcon(
":/images/Laplace.png");
698 #endif // STACKPROCESSFILTERS_HPP
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:142
void show()
Ask the user interface to show this store.
Definition: Store.hpp:167
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:687
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:41
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:302
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:63
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:365
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:489
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:45
Change the global luminosity of the stack.
Definition: StackProcessFilters.hpp:59
Blur the stack using a Gaussian kernel or specified radius.
Definition: StackProcessFilters.hpp:315
split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive)
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:136
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:182
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:606
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:430
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:577
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:89
const Store * currentStore() const
Returns the current store.
Definition: Stack.hpp:112
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:287
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:128
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:675
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:185
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:346
Compute the local average of each voxel of the stack.
Definition: StackProcessFilters.hpp:18
Compute the gradient of the image in the Z axis of the image.
Definition: StackProcessFilters.hpp:152
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:179
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:559
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:623
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:125
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:261
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:79
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:191
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:690
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:407
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:228
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:629
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:133
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:88
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:87
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:349
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:42
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:323
Invert the intensity of all voxels in the stack.
Definition: StackProcessFilters.hpp:204
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:632
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:556
Apply a user-defined convolution kernel to the current image.
Definition: StackProcessFilters.hpp:443
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:243
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:43
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:283
The Store class holds the actual 3D data and properties specific to it.
Definition: Store.hpp:25
Compute the Laplacian of the stack (using CImg).
Definition: StackProcessFilters.hpp:651
Binarize the stack: set the intensity of any voxel greater than the threshold to 65535 and all other ...
Definition: StackProcessFilters.hpp:98
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:139
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:44
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:659
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:297
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:588
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:532
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:86
CImg implementation of the gaussian blur.
Definition: StackProcessFilters.hpp:598
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:626
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:451
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:40
Namespace containing all the utility classes.
Definition: Vector.hpp:37
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:160
Apply an "unsharp" filter to the stack.
Definition: StackProcessFilters.hpp:379
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:681
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:510
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:237
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:553
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:277
File containing the definition of a Process.
The Stack class represent the dimensions of the 3D data, and the frames transformations.
Definition: Stack.hpp:25
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:486
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:231
This is the main process class, the one all process inherit from.
Definition: Process.hpp:248
void hide()
Ask the user interface to hide this store.
Definition: Store.hpp:173
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:566
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:340
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:418
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:492
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:641
const Store * work() const
Access the work store.
Definition: Stack.hpp:93
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:39
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:188
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:635
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:81
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:498
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:234
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:240
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:638
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:292
Clip the intensity of the stack to the interval [Low Threshold, High Threshold].
Definition: StackProcessFilters.hpp:253
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:404
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:80
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:684
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:176
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:423
QStringList parmDescs() const
List of parameters descriptions.
Definition: StackProcessFilters.hpp:354
Normalize the intensity of the stack.
Definition: StackProcessFilters.hpp:524
Stack processes have non-mutable access to meshes and mutable access to stacks.
Definition: Process.hpp:819
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:483
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:122
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:22
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:387
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:359
QString description() const
Returns a description of the process for the GUI.
Definition: StackProcessFilters.hpp:410
QStringList parmNames() const
List of named parameters.
Definition: StackProcessFilters.hpp:413
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:212
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: StackProcessFilters.hpp:194
QString folder() const
Folder in which to place the process.
Definition: StackProcessFilters.hpp:550
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:280
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:343
QStringList parmDefaults() const
List of default parms.
Definition: StackProcessFilters.hpp:504
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: StackProcessFilters.hpp:106
QString name() const
Returns the name of the process.
Definition: StackProcessFilters.hpp:678