11 #ifndef MESH_PROCESSS_PDG_HPP
12 #define MESH_PROCESSS_PDG_HPP
33 setName(
"Mesh/Cell Axis/PDG/Check Correspondence");
34 setDesc(
"Find matching cell junctions between 2 meshes based on parent labeling.\n"
35 "Both meshes are simplified with Make Cells to keep only the cell junctions and centers.\n"
36 "SAVE your meshes before running!");
37 setIcon(QIcon(
":/images/CorrespondenceJunctions.png"));
39 addParm(
"Show correspondence",
"Draw connecting lines between corresponding junctions.",
"No",booleanChoice());
40 addParm(
"Convert to Cell Mesh",
"Convert the meshes into cell meshes",
"No",booleanChoice());
41 addParm(
"New",
"New",
"No",booleanChoice());
46 if(!checkState().mesh(MESH_NON_EMPTY, 0).mesh(MESH_NON_EMPTY, 1))
49 if(currentMesh() == mesh(0)) {
52 }
else if(currentMesh() == mesh(1)) {
62 bool run(
Mesh* mesh1,
Mesh* mesh2,
bool ShowVVCorrespondence,
bool convert,
bool newMethod =
false);
101 setName(
"Mesh/Cell Axis/PDG/Compute Growth Directions");
102 setDesc(
"Compute PDGs based on correspondence between junctions.\n"
103 "Adapted from Goodall and Green, 'Quantitative Analysis of Surface Growth.'Botanical Gazette (1986) \n"
104 "and Dumais and Kwiatkowska, 'Analysis of surface growth in shoot apices.'Plant Journal (2002)");
105 setIcon(QIcon(
":/images/PDG.png"));
109 if(!checkState().mesh(MESH_NON_EMPTY, 0).mesh(MESH_NON_EMPTY, 1))
113 if(currentMesh() == mesh(0)) {
116 }
else if(currentMesh() == mesh(1)) {
122 bool res = run(mesh1, mesh2);
136 pColorPos, pColorNeg, pAxisWidth, pAxisScale, pAxisOffset, pAnisotropyThreshold, pCustomShear, pNumParms};
140 setName(
"Mesh/Cell Axis/PDG/Display Growth Directions");
141 setDesc(
"Display the principle growth directions on a vertex level");
142 setIcon(QIcon(
":/images/PDG.png"));
144 addParm(
"Heatmap",
"Display stretch ratio values in max or min direction as a color map.\n"
145 "stretch ratio = (length after/length before). No deformation means stretch ratio = 1.",
"StretchMax", QStringList() <<
"None" <<
"StretchMax" <<
"StretchMin" <<
"Aniso=StretchMax/StretchMin" <<
"StretchMax-StretchMin" <<
"ProductStretches" <<
"StretchCustomX" <<
"StretchCustomY" <<
"StretchCustomX-StretchCustomY" <<
"CustomX Growth Proportion" <<
"CustomY Growth Proportion" <<
"AnisoCustom" <<
"Shear" <<
"AnisoRatio");
146 addParm(
"ScaleHeat",
"Scale heat map",
"Auto", QStringList() <<
"None" <<
"Auto" <<
"Manual");
147 addParm(
"Heat min",
"High bound heat map",
"1");
148 addParm(
"Heat max",
"Low bound heat map",
"3");
149 addParm(
"Show Axis",
"Draw directions as vectors, scaled by strain.\n"
150 "strain = (stretch ratio - 1). No deformation means strain = 0.",
"Both", QStringList() <<
"Both" <<
"StrainMax" <<
"StretchMax-StretchMin" <<
"StrainMin" <<
"BothCustom" <<
"StrainCustomX" <<
"StrainCustomY" <<
"None");
151 addParm(
"Color +",
"Color used for expansion (strain > 0)",
"white", QColor::colorNames());
152 addParm(
"Color -",
"Color used for shrinkage (strain < 0)",
"red", QColor::colorNames());
153 addParm(
"Line Width",
"Line Width",
"2.0");
154 addParm(
"Line Scale",
"Length of the vectors = Scale * Strain.",
"2.0");
155 addParm(
"Line Offset",
"Draw the vector ends a bit tilted up for proper display on surfaces.",
"0.1");
156 addParm(
"Threshold",
"Minimal value of anisotropy (= stretchMax/StretchMin) required for drawing PDGs. \n"
157 "Use a value above 1.",
"0.0");
158 addParm(
"Custom Dir Shear",
"Custom Direction Shear",
"No",booleanChoice());
159 addParm(
"Min Dis Vtx",
"Min Dis Vtx",
"1.0");
162 bool initialize(QWidget* parent);
169 if(!checkState().mesh(MESH_NON_EMPTY))
171 return run(currentMesh());
177 return run(mesh, DisplayHeatMap,
ScaleHeatMap, RangeHeat, DisplayAxis,
178 ColorPos, ColorNeg, AxisWidth, AxisScale, AxisOffset, AnisotropyThreshold, CustomShear);
182 bool run(
Mesh* mesh,
const QString displayHeatMap,
const QString scaleHeatMap,
const Point2d &rangeHeat,
183 const QString displayAxis,
const QColor& colorPos,
const QColor& colorNeg,
float axisWidth,
float axisScale,
184 float axisOffset,
float anisotropyThreshold,
bool customShear);
190 QString DisplayHeatMap;
199 float AnisotropyThreshold;
212 pColorPos, pColorNeg, pAxisWidth, pAxisScale, pAxisOffset, pAnisotropyThreshold, pCustomShear,
pVtxMinDis, pNumParms};
216 setName(
"Mesh/Cell Axis/Deformation Gradient/Display Vertex Gradient");
217 setDesc(
"Display the principle growth directions on a vertex level");
218 setIcon(QIcon(
":/images/PDG.png"));
220 addParm(
"Heatmap",
"Display stretch ratio values in max or min direction as a color map.\n"
221 "stretch ratio = (length after/length before). No deformation means stretch ratio = 1.",
"StretchMax", QStringList() <<
"None" <<
"StretchMax" <<
"StretchMin" <<
"Aniso" <<
"StretchMax-StretchMin" <<
"ProductStretches" <<
"StretchCustomX" <<
"StretchCustomY" <<
"StretchCustomX-StretchCustomY" <<
"CustomX Growth Proportion" <<
"CustomY Growth Proportion" <<
"AnisoCustom" <<
"Shear" <<
"AnisoRatio");
222 addParm(
"ScaleHeat",
"Scale heat map",
"Auto", QStringList() <<
"None" <<
"Auto" <<
"Manual");
223 addParm(
"Heat min",
"High bound heat map",
"1");
224 addParm(
"Heat max",
"Low bound heat map",
"3");
225 addParm(
"Show Axis",
"Draw directions as vectors, scaled by strain.\n"
226 "strain = (stretch ratio - 1). No deformation means strain = 0.",
"Both", QStringList() <<
"Both" <<
"StrainMax" <<
"StretchMax-StretchMin" <<
"StrainMin" <<
"BothCustom" <<
"StrainCustomX" <<
"StrainCustomY" <<
"None");
227 addParm(
"Color +",
"Color used for expansion (strain > 0)",
"white", QColor::colorNames());
228 addParm(
"Color -",
"Color used for shrinkage (strain < 0)",
"red", QColor::colorNames());
229 addParm(
"Line Width",
"Line Width",
"2.0");
230 addParm(
"Line Scale",
"Length of the vectors = Scale * Strain.",
"2.0");
231 addParm(
"Line Offset",
"Draw the vector ends a bit tilted up for proper display on surfaces.",
"0.1");
232 addParm(
"Threshold",
"Minimal value of anisotropy (= stretchMax/StretchMin) required for drawing PDGs.\n"
233 "Use a value above 1.",
"0.0");
234 addParm(
"Custom Dir Shear",
"Custom Direction Shear",
"No",booleanChoice());
235 addParm(
"Min Dis Vtx",
"Min Dis Vtx",
"1.0");
238 bool initialize(QWidget* parent);
245 if(!checkState().mesh(MESH_NON_EMPTY))
247 return run(currentMesh());
253 return run(mesh, DisplayHeatMap,
ScaleHeatMap, RangeHeat, DisplayAxis,
254 ColorPos, ColorNeg, AxisWidth, AxisScale, AxisOffset, AnisotropyThreshold, CustomShear, vtxMinDis);
257 bool run(
Mesh* mesh,
const QString displayHeatMap,
const QString scaleHeatMap,
const Point2d &rangeHeat,
258 const QString displayPDGs,
const QColor& colorPos,
const QColor& colorNeg,
float axisLineWidth,
259 float scaleAxisLength,
float axisOffset,
float anisotropyThreshold,
bool customShear,
double vtxMinDis);
262 QString DisplayHeatMap;
271 float AnisotropyThreshold;
282 setName(
"Mesh/Cell Axis/PDG/Average Growth Directions");
283 setDesc(
"Averages growth directions of neighboring cells");
284 setIcon(QIcon(
":/images/PDG.png"));
286 addParm(
"Project Directions on Surface",
"Project Directions on Surface",
"Yes",booleanChoice());
287 addParm(
"Weighting",
"Weighting",
"none",QStringList() <<
"none" <<
"n"<<
"area"<<
"geometric mean"<<
"area weighted geometric mean");
293 if(!checkState().mesh(MESH_NON_EMPTY))
295 return run(currentMesh(),
stringToBool(parm(
"Project Directions on Surface")),parm(
"Weighting"));
297 bool run(
Mesh *m,
bool projSurf,QString avgType);