11 #ifndef TISSUECURVATURE_HPP
12 #define TISSUECURVATURE_HPP
32 setName(
"Mesh/Cell Axis/Curvature/Compute Tissue Curvature");
33 setDesc(
"Compute curvature based on simplified mesh (from Make Cells) for a neighborhood of given radius.");
34 setIcon(QIcon(
":/images/Curvature.png"));
36 addParm(
"Radius",
"Radius for curvature calculation (µm)",
"10.0");
37 addParm(
"Selected Cell",
"Compute curvature only for selected cell",
"No",booleanChoice());
42 double radius = parm(
"Radius").toDouble();
44 throw QString(
"%1::run Radius must be > 0").arg(name());
45 return run(currentMesh(), radius,
stringToBool(parm(
"Selected Cell")));
48 bool run(
Mesh* mesh,
float neighborhood,
bool checkLabel);
62 setName(
"Mesh/Cell Axis/Curvature/Display Tissue Curvature");
63 setDesc(
"Display curvature based on cellular mesh");
64 setIcon(QIcon(
":/images/Curvature.png"));
66 addParm(
"Heatmap",
"Display curvature values in max or min direction as a color map. \n"
67 "Average: (CurvMax + CurvMin)/2, SignedAverageAbs: sign(CurvMax or CurvMin) x (abs(CurvMax) + abs(CurvMin))/2,\n"
68 "Gaussian:(CurvMax x CurvMin), RootSumSquare: sqrt(CurvMax^2 + CurvMin^2), Anisotropy: (CurvMax / CurvMin).",
"SignedAverageAbs", QStringList() <<
"None" <<
"CurvMax" <<
"CurvMin" <<
"Average" <<
"SignedAverageAbs" <<
"Gaussian" <<
"RootSumSquare" <<
"Anisotropy");
69 addParm(
"Compare to 0",
"Center the color map on zero, if negtive values exist.",
"Yes",booleanChoice());
70 addParm(
"Heatmap percentile",
"Percentile of values used for color map upper-lower bounds.",
"85.0");
71 addParm(
"Show Axis",
"Draw main curvature directions as vectors, scaled by 1/(curvature radius).",
"Both", QStringList() <<
"Both" <<
"CurvMax" <<
"CurvMin" <<
"None");
72 addParm(
"Color +",
"Color used for convex (curvature > 0)",
"white", QColor::colorNames());
73 addParm(
"Color -",
"Color used for concave (curvature < 0)",
"red", QColor::colorNames());
74 addParm(
"Line Width",
"Line width",
"2.0");
75 addParm(
"Line Scale",
"Length of the vectors = Scale * 1/(curvature radius).",
"100.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 curvature required for drawing the directions.",
"0.0");
82 if(!checkState().mesh(MESH_NON_EMPTY))
86 float heatmapPercentile = parm(
"Heatmap percentile").toFloat(&ok);
88 return setErrorMessage(
"Error, argument 'Heatmap percentile' must be a number");
89 float axisLineWidth = parm(
"Line Width").toFloat(&ok);
91 return setErrorMessage(
"Error, argument 'Line Width' must be a number");
92 float axisLineScale = parm(
"Line Scale").toFloat(&ok);
94 return setErrorMessage(
"Error, argument 'Line Scale' must be a number");
95 float axisOffset = parm(
"Line Offset").toFloat(&ok);
97 return setErrorMessage(
"Error, argument 'Line Offset' must be a number");
98 float threshold = parm(
"Threshold").toFloat(&ok);
100 return setErrorMessage(
"Error, argument 'Threshold' must be a number");
102 return run(currentMesh(), parm(
"Heatmap"),
stringToBool(parm(
"Compare to 0")), heatmapPercentile,
103 parm(
"Show Axis"), QColor(parm(
"Color +")), QColor(parm(
"Color -")), axisLineWidth, axisLineScale,
104 axisOffset, threshold);
107 bool run(
Mesh* mesh, QString DisplayHeatMap,
bool compareZero,
float heatmapPercentile,
108 QString DisplayCurv,
const QColor& ColorExpansion,
const QColor& ColorShrinkage,
109 float AxisLineWidth,
float AxisLineScale,
float AxisOffset,
float CurvThreshold);