11 #ifndef FIBRIL_ORIENTATIONS_HPP
12 #define FIBRIL_ORIENTATIONS_HPP
31 setName(
"Mesh/Cell Axis/Fibril Orientations/Compute Fibril Orientations");
32 setDesc(
"Compute principle orientations of lines in the mesh signal (vertex based version). \n"
33 "Based on Boudaoud et al., 'FibrilTool, an ImageJ plug-in to \n"
34 "quantify fibrillar structures in raw microscopy images', Nature Protocols 2014");
35 setIcon(QIcon(
":/images/PrincipalOrientations.png"));
37 addParm(
"Border Size",
"Width of cell border that is not taken into account for the computation.",
"1.0");
38 addParm(
"Min Area Ratio",
"Minimum ratio of inner area (whole cell - border) vs. total area needed for compuation.",
"0.25");
39 addParm(
"Blur Radius",
"Radius to blur the signal, 0 for none",
"0.5");
40 addParm(
"Background Radius",
"Radius to use for background substraction, 0 for none",
"0.0");
45 if(!checkState().mesh(MESH_NON_EMPTY | MESH_SIGNAL))
47 Mesh* mesh = currentMesh();
48 return run(mesh, parm(
"Border Size").toDouble(), parm(
"Min Area Ratio").toDouble(),
49 parm(
"Blur Radius").toDouble(), parm(
"Background Radius").toDouble());
52 bool run(
Mesh* mesh,
double border,
double minAreaRatio,
double blurRadius,
double backRadius);
67 setName(
"Mesh/Cell Axis/Fibril Orientations/Display Fibril Orientations");
68 setDesc(
"Display the orientations of fibrils on the image (vertex based version). \n"
69 "Only the maximal direction (main orientation) is displayed as a vector.");
70 setIcon(QIcon(
":/images/PrincipalOrientations.png"));
72 addParm(
"Heatmap",
"Display orientation strength (= MaxDirection/MinDirection - 1) as a colormap.",
"none", QStringList() <<
"none" <<
"Orientation");
73 addParm(
"Line Color",
"Line Color",
"red", QColor::colorNames());
74 addParm(
"Line Width",
"Line Width",
"1.0");
75 addParm(
"Line Scale",
"Length of the vectors = Scale * orientation strength.",
"1.0");
76 addParm(
"Line Offset",
"Draw the vector ends a bit tilted up for proper display on surfaces.",
"0.1");
77 addParm(
"Threshold",
"Minimal value of orientation strength required for drawing main direction.",
"0.0");
82 if(!checkState().mesh(MESH_NON_EMPTY))
85 return run(currentMesh(), parm(
"Heatmap"), QColor(parm(
"Line Color")), parm(
"Line Width").toFloat(),
86 parm(
"Line Scale").toFloat(), parm(
"Line Offset").toFloat(), parm(
"Threshold").toFloat());
89 bool run(
Mesh* mesh,
const QString DisplayHeatMap,
const QColor& ColorMax,
90 float AxisLineWidth,
float ScaleAxisLength,
float AxisOffset,
float OrientationThreshold);
105 setName(
"Mesh/Cell Axis/Fibril Orientations/Vertex Compute Orientations");
106 setDesc(
"Compute principle orientations of lines in the mesh signal (vertex based version). \n"
107 "Based on Boudaoud et al., 'FibrilTool, an ImageJ plug-in to \n"
108 "quantify fibrillar structures in raw microscopy images', Nature Protocols 2014");
109 setIcon(QIcon(
":/images/PrincipalOrientations.png"));
111 addParm(
"Border Size",
"Width of cell border that is not taken into account for the computation.",
"1.0");
112 addParm(
"Minimum inner area ratio",
"Minimum ratio of inner area (whole cell - border) vs. total area needed for compuation.",
"0.25");
113 addParm(
"Radius",
"Radius to use for orientation",
"2.0");
114 addParm(
"Blur Radius",
"Radius to blur the signal",
"1.0");
120 if(!checkState().mesh(MESH_NON_EMPTY | MESH_SIGNAL))
122 Mesh* m = currentMesh();
124 if(currentMesh() == mesh(0))
128 return run(m, m2, parm(
"Border Size").toFloat(), parm(
"Minimum inner area ratio").toFloat(), parm(
"Radius").toFloat(), parm(
"Blur Radius").toFloat());
131 bool run(
Mesh* m,
Mesh* m2,
float border,
float minAreaRatio,
float radius,
float blurRadius);
147 setName(
"Mesh/Cell Axis/Fibril Orientations/Vertex Display Orientations");
148 setDesc(
"Display the orientations of fibrils on the image (vertex based version). \n"
149 "Only the maximal direction (main orientation) is displayed as a vector.");
150 setIcon(QIcon(
":/images/PrincipalOrientations.png"));
152 addParm(
"Heatmap",
"Display orientation strength (= MaxDirection/MinDirection - 1) as a colormap.",
"none", QStringList() <<
"none" <<
"Orientation");
153 addParm(
"Line Color",
"Line Color",
"red", QColor::colorNames());
154 addParm(
"Line Width",
"Line Width",
"1.0");
155 addParm(
"Line Scale",
"Length of the vectors = Scale * orientation strength.",
"1.0");
156 addParm(
"Line Offset",
"Draw the vector ends a bit tilted up for proper display on surfaces.",
"0.1");
157 addParm(
"Threshold",
"Minimal value of orientation strength required for drawing main direction.",
"0.0");
164 if(!checkState().mesh(MESH_NON_EMPTY))
167 return run(currentMesh(), parm(
"Heatmap"), QColor(parm(
"Line Color")), parm(
"Line Width").toFloat(),
168 parm(
"Line Scale").toFloat(), parm(
"Line Offset").toFloat(), parm(
"Threshold").toFloat());
171 bool run(
Mesh* mesh,
const QString DisplayHeatMap,
const QColor& ColorMax,
172 float AxisLineWidth,
float ScaleAxisLength,
float AxisOffset,
float OrientationThreshold);
188 setName(
"Mesh/Cell Axis/Fibril Orientations/Vertices Select");
189 setDesc(
"Selects vertices of cells that are (roughly) equally spaced and distributed.");
191 addParm(
"Min Point Distance",
"Minimum distance between two points",
"2.0");
192 addParm(
"Min Border Distance",
"Minimum distance of a generated point and a border vertex of the cell",
"0.0");
193 addParm(
"Only Cells With Parent Label",
"Only Cells With Parent Label",
"No",booleanChoice());
198 Mesh* m = currentMesh();
200 return run(m, parm(
"Min Point Distance").toDouble(), parm(
"Min Border Distance").toDouble(),
204 bool run(
Mesh* m,
double minPointDis,
double minBorderDis,
bool ignoreNoParents);