MorphoGraphX
MeshProcessFibril.hpp
1 //
2 // This file is part of MorphoGraphX - http://www.MorphoGraphX.org
3 // Copyright (C) 2012-2015 Richard S. Smith and collaborators.
4 //
5 // If you use MorphoGraphX in your work, please cite:
6 // http://dx.doi.org/10.7554/eLife.05864
7 //
8 // MorphoGraphX is free software, and is licensed under under the terms of the
9 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
10 //
11 #ifndef PRINCIPAL_ORIENTATIONS_HPP
12 #define PRINCIPAL_ORIENTATIONS_HPP
13 
14 #include <Process.hpp>
15 
16 namespace mgx {
17 namespace process {
20 
28 public:
30  : Process(process)
31  , MeshProcess(process)
32  {
33  }
34 
35  bool operator()(const QStringList& parms)
36  {
38  return false;
39  Mesh* mesh = currentMesh();
40  return operator()(mesh, parms[0].toFloat(), parms[1].toFloat());
41  }
42 
43  bool operator()(Mesh* mesh, float border, float minAreaRatio);
44 
45  QString folder() const {
46  return "Cell Axis/Fibril Orientations";
47  }
48  QString name() const {
49  return "Compute Fibril Orientations";
50  }
52  {
53  return "Compute principle orientations of lines in the mesh signal.\n"
54  "Based on Boudaoud et al., 'FibrilTool, an ImageJ plug-in to\n"
55  "quantify fibrillar structures in raw microscopy images', Nature Protocols 2014";
56  }
58  {
59  return QStringList() << "Border Size"
60  << "Minimum inner area ratio";
61  }
63  {
64  return QStringList()
65  << "Width of cell border that is not taken into account for the computation."
66  << "Minimum ratio of inner area (whole cell - border) vs. total area needed for compuation.";
67  }
69  {
70  return QStringList() << "1.0"
71  << "0.25";
72  }
73  QIcon icon() const {
74  return QIcon(":/images/PrincipalOrientations.png");
75  }
76 };
77 
84 class mgxBase_EXPORT DisplayFibrilOrientations : public MeshProcess {
85 public:
87  : Process(process)
88  , MeshProcess(process)
89  {
90  }
91 
92  bool operator()(const QStringList& parms)
93  {
95  return false;
96 
97  return (*this)(currentMesh(), parms[0], QColor(parms[1]), parms[2].toFloat(), parms[3].toFloat(),
98  parms[4].toFloat(), parms[5].toFloat());
99  }
100 
101  bool operator()(Mesh* mesh, const QString DisplayHeatMap, const QColor& ColorMax, float AxisLineWidth,
102  float ScaleAxisLength, float AxisOffset, float OrientationThreshold);
103 
104  QString folder() const {
105  return "Cell Axis/Fibril Orientations";
106  }
107  QString name() const {
108  return "Display Fibril Orientations";
109  }
111  {
112  return "Display the orientations of fibrils on the image.\n"
113  "Only the maximal direction (main orientation) is displayed as a vector.";
114  }
116  {
117  return QStringList() << "Heatmap"
118  << "Line Color"
119  << "Line Width"
120  << "Line Scale"
121  << "Line Offset"
122  << "Threshold";
123  }
125  {
126  return QStringList() << "Display orientation strength (= MaxDirection/MinDirection - 1) as a colormap."
127  << "Line Color"
128  << "Line Width"
129  << "Length of the vectors = Scale * orientation strength."
130  << "Draw the vector ends a bit tilted up for proper display on surfaces."
131  << "Minimal value of orientation strength required for drawing main direction.";
132  }
134  {
135  return QStringList() << "none"
136  << "red"
137  << "5.0"
138  << "10.0"
139  << "0.1"
140  << "0.0";
141  }
143  {
144  ParmChoiceMap map;
145  map[0] = QStringList() << "none"
146  << "Orientation";
147  map[1] = QColor::colorNames();
148  return map;
149  }
150  QIcon icon() const {
151  return QIcon(":/images/PrincipalOrientations.png");
152  }
153 };
155 } // namespace process
156 } // namespace mgx
157 
158 #endif
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessFibril.hpp:150
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessFibril.hpp:115
Change the representation of the fibril orientation after it has been computed.
Definition: MeshProcessFibril.hpp:84
QString folder() const
Folder in which to place the process.
Definition: MeshProcessFibril.hpp:45
QString name() const
Returns the name of the process.
Definition: MeshProcessFibril.hpp:107
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessFibril.hpp:133
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessFibril.hpp:35
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessFibril.hpp:73
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessFibril.hpp:124
Process()
Default constructor.
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessFibril.hpp:62
CheckState checkState()
Call this function and convert the result to a boolean.
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessFibril.hpp:57
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:177
QString folder() const
Folder in which to place the process.
Definition: MeshProcessFibril.hpp:104
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessFibril.hpp:92
This namespace contains all the API of MorphoGraphX.
Definition: Assert.hpp:26
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessFibril.hpp:68
colorNames()
QString name() const
Returns the name of the process.
Definition: MeshProcessFibril.hpp:48
File containing the definition of a Process.
Mesh * mesh(int i)
Returns the ith mesh.
Show the signal.
Definition: Process.hpp:681
This namespace contains all the classes needed to define processes.
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessFibril.hpp:51
Non-empty mesh.
Definition: Process.hpp:674
Compute principle orientations of lines in the mesh signal.
Definition: MeshProcessFibril.hpp:27
Mesh * currentMesh()
Returns the current mesh (i.e.
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessFibril.hpp:110
Mesh processes have mutable access to meshes and non-mutable access to stacks.
Definition: Process.hpp:865
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: MeshProcessFibril.hpp:142