11 #ifndef PCAnalysis_HPP 12 #define PCAnalysis_HPP 16 #include <Information.hpp> 20 #include <QStringList> 45 Stack* stk = currentStack();
48 QString correction = parms[1].trimmed();
50 if(correction ==
"Ellipsoid")
51 correcting_factor = sqrt(5);
52 else if(correction ==
"Cuboid")
53 correcting_factor = sqrt(3);
54 else if(correction ==
"Elliptical Cylinder")
55 correcting_factor =
Point3f(sqrt(3), sqrt(4), sqrt(4));
56 else if(correction ==
"Maximum Span")
57 correcting_factor = 0;
63 correcting_factor = -cr / 100.f;
70 float cr = correction.
toFloat(&ok);
72 correcting_factor = cr;
76 correcting_factor.
x() = vs[0].toFloat(&ok);
81 correcting_factor.
y() = vs[1].toFloat(&ok);
86 correcting_factor.
z() = vs[2].toFloat(&ok);
93 ", 'Cuboid', 'Elliptical Cylinder', Maximum Span', a percentage, a single " 94 "value or three values"));
99 bool draw_result =
false;
101 =
operator()(stk, store, fn, parms[3].toInt(), parms[2], correcting_factor, parms[4].toInt(), draw_result);
102 if(res and draw_result) {
103 Mesh* m = mesh(stk->
id());
125 Point3f correcting_factor,
int slices,
bool& draw_result);
128 return "Shape Analysis";
135 return "Compute the principle components of the image. If the threshold is -1, then all the values are used, \n" 136 "as is. If 'Draw Result' is set to true, the current mesh will be erased and replaced with shapes \n" 137 "representing the cells fit. 'Splan Correction' can be either a shape, a single value of a vector \n" 138 "of 3 values, corresponding to the correction to apply for the eigen-values on all three directions.";
150 return QStringList() <<
"File to write the output to" 151 <<
"Span correction can be made using pre-computed formula for regular shapes, or a " 152 "percentage of the PC." 153 <<
"Shape used to display the result" 154 <<
"If the stack is not labeled, a single volume is considered with all voxels of " 155 "intensity greater than this threshold." 156 <<
"How finely to draw the shape (for cylinders or ellipsoids)";
171 <<
"Elliptical Cylinder" 180 return QIcon(
":/images/PCAnalysis.png");
186 #endif // PCAnalysis_HPP QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: PCAnalysis.hpp:179
void showSurface()
Show the surface to the user.
Definition: Mesh.hpp:801
QString folder() const
Folder in which to place the process.
Definition: PCAnalysis.hpp:127
int id() const
Id of a stack.
Definition: Stack.hpp:59
split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive)
const Store * currentStore() const
Returns the current store.
Definition: Stack.hpp:122
CU_HOST_DEVICE void x(const T &v)
Short access to the first element.
Definition: Vector.hpp:661
Process()
Default constructor.
QStringList parmDescs() const
List of parameters descriptions.
Definition: PCAnalysis.hpp:148
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:35
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:177
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:670
This namespace contains all the API of MorphoGraphX.
Definition: Assert.hpp:26
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:158
void showLabel()
Show the labels of the surface triangles.
Definition: Mesh.hpp:820
QString name() const
Returns the name of the process.
Definition: PCAnalysis.hpp:130
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
QStringList parmNames() const
List of named parameters.
Definition: PCAnalysis.hpp:140
Global processes have full mutable access to all properties of the process.
Definition: Process.hpp:904
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: PCAnalysis.hpp:41
This namespace contains all the classes needed to define processes.
CU_HOST_DEVICE void z(const T &v)
Short access to the third element.
Definition: Vector.hpp:679
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: PCAnalysis.hpp:166
QString description() const
Returns a description of the process for the GUI.
Definition: PCAnalysis.hpp:133
Perform a PCA on each labeled regions of the segmented stack, and create shapes in the mesh reflectin...
Definition: PCAnalysis.hpp:33