MorphoGraphX
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MeshProcessFibril.hpp
1 #ifndef PRINCIPAL_ORIENTATIONS_HPP
2 #define PRINCIPAL_ORIENTATIONS_HPP
3 
4 #include <Process.hpp>
5 
6 namespace mgx {
7 namespace process {
10 
18 public:
19  FibrilOrientations(const MeshProcess& process)
20  : Process(process)
21  , MeshProcess(process)
22  {
23  }
24 
25  bool operator()(const QStringList& parms)
26  {
28  return false;
29  Mesh* mesh = currentMesh();
30  return operator()(mesh, parms[0].toFloat(), parms[1].toFloat());
31  }
32 
33  bool operator()(Mesh* mesh, float border, float minAreaRatio);
34 
35  QString folder() const {
36  return "Cell Axis/Fibril Orientations";
37  }
38  QString name() const {
39  return "Compute Fibril Orientations";
40  }
42  {
43  return "Compute principle orientations of lines in the mesh signal.\n"
44  "Based on Boudaoud et al., 'FibrilTool, an ImageJ plug-in to\n"
45  "quantify fibrillar structures in raw microscopy images', Nature Protocols 2014";
46  }
48  {
49  return QStringList() << "Border Size"
50  << "Minimum inner area ratio";
51  }
53  {
54  return QStringList()
55  << "Width of cell border that is not taken into account for the computation."
56  << "Minimum ratio of inner area (whole cell - border) vs. total area needed for compuation.";
57  }
59  {
60  return QStringList() << "1.0"
61  << "0.25";
62  }
63  QIcon icon() const {
64  return QIcon(":/images/PrincipalOrientations.png");
65  }
66 };
67 
74 class mgxBase_EXPORT DisplayFibrilOrientations : public MeshProcess {
75 public:
77  : Process(process)
78  , MeshProcess(process)
79  {
80  }
81 
82  bool operator()(const QStringList& parms)
83  {
84  if(!checkState().mesh(MESH_NON_EMPTY))
85  return false;
86 
87  return (*this)(currentMesh(), parms[0], QColor(parms[1]), parms[2].toFloat(), parms[3].toFloat(),
88  parms[4].toFloat(), parms[5].toFloat());
89  }
90 
91  bool operator()(Mesh* mesh, const QString DisplayHeatMap, const QColor& ColorMax, float AxisLineWidth,
92  float ScaleAxisLength, float AxisOffset, float OrientationThreshold);
93 
94  QString folder() const {
95  return "Cell Axis/Fibril Orientations";
96  }
97  QString name() const {
98  return "Display Fibril Orientations";
99  }
101  {
102  return "Display the orientations of fibrils on the image.\n"
103  "Only the maximal direction (main orientation) is displayed as a vector.";
104  }
106  {
107  return QStringList() << "Heatmap"
108  << "Line Color"
109  << "Line Width"
110  << "Line Scale"
111  << "Line Offset"
112  << "Threshold";
113  }
115  {
116  return QStringList() << "Display orientation strength (= MaxDirection/MinDirection - 1) as a colormap."
117  << "Line Color"
118  << "Line Width"
119  << "Length of the vectors = Scale * orientation strength."
120  << "Draw the vector ends a bit tilted up for proper display on surfaces."
121  << "Minimal value of orientation strength required for drawing main direction.";
122  }
124  {
125  return QStringList() << "none"
126  << "red"
127  << "5.0"
128  << "10.0"
129  << "0.1"
130  << "0.0";
131  }
133  {
134  ParmChoiceMap map;
135  map[0] = QStringList() << "none"
136  << "Orientation";
137  map[1] = QColor::colorNames();
138  return map;
139  }
140  QIcon icon() const {
141  return QIcon(":/images/PrincipalOrientations.png");
142  }
143 };
145 } // namespace process
146 } // namespace mgx
147 
148 #endif
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessFibril.hpp:140
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessFibril.hpp:105
Change the representation of the fibril orientation after it has been computed.
Definition: MeshProcessFibril.hpp:74
QString folder() const
Folder in which to place the process.
Definition: MeshProcessFibril.hpp:35
QString name() const
Returns the name of the process.
Definition: MeshProcessFibril.hpp:97
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessFibril.hpp:123
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessFibril.hpp:25
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessFibril.hpp:63
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessFibril.hpp:114
Process()
Default constructor.
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessFibril.hpp:52
CheckState checkState()
Call this function and convert the result to a boolean.
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessFibril.hpp:47
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:167
QString folder() const
Folder in which to place the process.
Definition: MeshProcessFibril.hpp:94
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessFibril.hpp:82
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessFibril.hpp:58
colorNames()
QString name() const
Returns the name of the process.
Definition: MeshProcessFibril.hpp:38
File containing the definition of a Process.
Mesh * mesh(int i)
Returns the ith mesh.
This is the main process class, the one all process inherit from.
Definition: Process.hpp:248
Show the signal.
Definition: Process.hpp:671
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessFibril.hpp:41
Non-empty mesh.
Definition: Process.hpp:664
Compute principle orientations of lines in the mesh signal.
Definition: MeshProcessFibril.hpp:17
Mesh * currentMesh()
Returns the current mesh (i.e.
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessFibril.hpp:100
Mesh processes have mutable access to meshes and non-mutable access to stacks.
Definition: Process.hpp:855
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: MeshProcessFibril.hpp:132