6 #include <Information.hpp>
10 #include <QStringList>
35 Stack* stk = currentStack();
38 QString correction = parms[1].trimmed();
40 if(correction ==
"Ellipsoid")
41 correcting_factor = sqrt(5);
42 else if(correction ==
"Cuboid")
43 correcting_factor = sqrt(3);
44 else if(correction ==
"Elliptical Cylinder")
45 correcting_factor =
Point3f(sqrt(3), sqrt(4), sqrt(4));
46 else if(correction ==
"Maximum Span")
47 correcting_factor = 0;
53 correcting_factor = -cr / 100.f;
60 float cr = correction.
toFloat(&ok);
62 correcting_factor = cr;
66 correcting_factor.
x() = vs[0].toFloat(&ok);
71 correcting_factor.
y() = vs[1].toFloat(&ok);
76 correcting_factor.
z() = vs[2].toFloat(&ok);
83 ", 'Cuboid', 'Elliptical Cylinder', Maximum Span', a percentage, a single "
84 "value or three values"));
89 bool draw_result =
false;
91 =
operator()(stk, store, fn, parms[3].toInt(), parms[2], correcting_factor, parms[4].toInt(), draw_result);
92 if(res and draw_result) {
115 Point3f correcting_factor,
int slices,
bool& draw_result);
118 return "Shape Analysis";
125 return "Compute the principle components of the image. If the threshold is -1, then all the values are used, \n"
126 "as is. If 'Draw Result' is set to true, the current mesh will be erased and replaced with shapes \n"
127 "representing the cells fit. 'Splan Correction' can be either a shape, a single value of a vector \n"
128 "of 3 values, corresponding to the correction to apply for the eigen-values on all three directions.";
140 return QStringList() <<
"File to write the output to"
141 <<
"Span correction can be made using pre-computed formula for regular shapes, or a "
142 "percentage of the PC."
143 <<
"Shape used to display the result"
144 <<
"If the stack is not labeled, a single volume is considered with all voxels of "
145 "intensity greater than this threshold."
146 <<
"How finely to draw the shape (for cylinders or ellipsoids)";
161 <<
"Elliptical Cylinder"
170 return QIcon(
":/images/PCAnalysis.png");
176 #endif // PCAnalysis_HPP
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: PCAnalysis.hpp:169
void showSurface()
Show the surface to the user.
Definition: Mesh.hpp:791
QString folder() const
Folder in which to place the process.
Definition: PCAnalysis.hpp:117
int id() const
Id of a stack.
Definition: Stack.hpp:49
split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive)
const Store * currentStore() const
Returns the current store.
Definition: Stack.hpp:112
CU_HOST_DEVICE void x(const T &v)
Short access to the first element.
Definition: Vector.hpp:651
Process()
Default constructor.
QStringList parmDescs() const
List of parameters descriptions.
Definition: PCAnalysis.hpp:138
CheckState checkState()
Call this function and convert the result to a boolean.
The Store class holds the actual 3D data and properties specific to it.
Definition: Store.hpp:25
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:167
endsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive)
CU_HOST_DEVICE void y(const T &v)
Short access to the second element.
Definition: Vector.hpp:660
bool setErrorMessage(const QString &str)
Set an error message that will be displayed if the process returns false.
QStringList parmDefaults() const
List of default parms.
Definition: PCAnalysis.hpp:148
void showLabel()
Show the labels of the surface triangles.
Definition: Mesh.hpp:810
QString name() const
Returns the name of the process.
Definition: PCAnalysis.hpp:120
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
QStringList parmNames() const
List of named parameters.
Definition: PCAnalysis.hpp:130
Global processes have full mutable access to all properties of the process.
Definition: Process.hpp:894
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: PCAnalysis.hpp:31
CU_HOST_DEVICE void z(const T &v)
Short access to the third element.
Definition: Vector.hpp:669
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: PCAnalysis.hpp:156
QString description() const
Returns a description of the process for the GUI.
Definition: PCAnalysis.hpp:123
Perform a PCA on each labeled regions of the segmented stack, and create shapes in the mesh reflectin...
Definition: PCAnalysis.hpp:23