1 #ifndef MESH_PROCESS_HEAT_MAP_HPP
2 #define MESH_PROCESS_HEAT_MAP_HPP
10 namespace mgx {
namespace process {
12 mgxBase_EXPORT
void getBBox(
const HVec3F& pts, Point3f* bBox);
29 enum MapType { AREA, VOLUME, WALL };
40 enum PolarityType { NONE, CELL_AVERAGE, WALL_MIN };
68 bool operator()(
Mesh* mesh1,
Mesh* mesh2, MapType map, SignalType signal,
const QString& reportFile,
int report,
69 bool manualRange,
float rangeMin,
float rangeMax,
bool signalAverage,
bool globalCoordinates,
70 PolarityType polarity, MultiMapType multiMapType,
float growthTime,
float borderSize);
80 <<
"Type" <<
"Visualize" <<
"FileName" <<
"ReportFields" <<
"Man. Range" <<
"Range Min"
81 <<
"Range Max" <<
"Signal Avg" <<
"Global Coord" <<
"Polarity Type" <<
"Change Map"
82 <<
"Increasing" <<
"Diff Type" <<
"Growth Time" <<
QString(
"Border Size(%1)").
arg(UM);
87 <<
"Area: signal/geometry on curved surfaces,\n"
88 "Volume: for 3D only,\n"
89 "Walls: quantify signal or geometry at cell borders."
90 <<
"Geometry: cell areas or volume,\n"
91 "Border signal: signal associated with cell borders, within a given distance (Border Size)\n"
92 "Interior signal: total signal of a cell - border signal.\n"
93 <<
"Path to output file."
94 <<
"Options to report the following fields in spreadsheet: Geometry, Signal, Border-Interior"
95 <<
"Manually define the range of the color map."
96 <<
"Color map lower bound."
97 <<
"Color map upper bound."
98 <<
"Option to normalize the signal by cell area or volume"
99 <<
"Apply the rotation/translation of the stack to the cell center coordinates."
100 <<
"Experimental option, attempt to determine cell signal polarity based on strength of signal on "
102 "Cell Average: compare each wall signal to signal average,\n"
103 "Wall/Min: compare wall signal to the weakest wall signal in the cell."
104 <<
"Compare two meshes with each other (deformation or change in signal) .\n"
105 <<
"Increasing: the current mesh is the reference (T0), the other mesh is the changed state (T1),\n"
106 "Decreasing: the other mesh is the reference (T0), the current mesh is the changed state (T1)."
107 <<
"Ratio: area or signal in changed state(T1) / area or signal in reference (T0),\n"
108 "Difference: area or signal in changed state(T1) - area or signal in reference (T0),\n"
109 "Growth: (Ratio -1) / growth time.\n"
110 <<
"Time interval between the two samples." <<
QString(
"Border Size(%1)").
arg(UM);
115 <<
"Area" <<
"Geometry" <<
"" <<
"Geometry" <<
"No" <<
"0" <<
"65535" <<
"Yes"
116 <<
"No" <<
"None" <<
"No" <<
"Yes" <<
"Ratio" <<
".001" <<
"1.0";
123 void changeMapType(
const QString& type);
124 void selectSpreadsheetFile();
127 bool getLabelMaps(ImageHeatMaps& map,
Mesh* mesh);
135 bool globalCoordinates;
136 PolarityType polarity;
138 MultiMapType multiMapType;
154 if(!checkState().mesh(MESH_NON_EMPTY))
158 if(parms[2].isEmpty())
159 min = std::numeric_limits<float>::quiet_NaN();
161 min = parms[2].toFloat(&ok);
163 return setErrorMessage(
"Error, parameter 'Min Heat' must be either empty, or a number");
164 if(parms[3].isEmpty())
165 max = std::numeric_limits<float>::quiet_NaN();
167 max = parms[3].toFloat(&ok);
169 return setErrorMessage(
"Error, parameter 'Min Heat' must be either empty, or a number");
173 bool operator()(
Mesh* mesh,
bool rescale,
bool deleteCells,
float min,
float max);
178 "Delete labels with heat within a given range. The heat is given relative to the total range."; }
180 <<
"Rescale" <<
"Delete cells" <<
"Min Heat" <<
"Max Heat"; }
182 <<
"Redefine the lower/upper bounds of colormap to fit the range of values."
183 <<
"Delete vertices within a given range of the color map (Min Heat-Max Heat)."
184 <<
"Lower bound of color value for which the cells will be deleted (empty for current min)."
185 <<
"Upper bound of color value for which the cells will be deleted (empty for current max)."; }
190 map[0] = booleanChoice();
191 map[1] = booleanChoice();
208 if(!checkState().mesh(MESH_HEAT))
210 Mesh* m = currentMesh();
213 if(parms[0].isEmpty())
214 min = std::numeric_limits<float>::quiet_NaN();
216 min = parms[0].toFloat(&ok);
218 return setErrorMessage(
"Error, parameter 'Min' must be either empty, or a number");
219 if(parms[1].isEmpty())
220 max = std::numeric_limits<float>::quiet_NaN();
222 max = parms[1].toFloat(&ok);
224 return setErrorMessage(
"Error, parameter 'Max' must be either empty, or a number");
225 return (*
this)(m, min, max);
228 bool operator()(
Mesh* m,
float min,
float max);
235 <<
"Lower bound (empty for current)" <<
"Upper bound (empty for current)"; }
254 if(!checkState().mesh(MESH_ANY))
256 Mesh* m = currentMesh();
257 return (*
this)(m, parms[0]);
260 bool operator()(
Mesh* mesh,
const QString& filename);
291 if(!checkState().mesh(MESH_ANY))
293 Mesh* m = currentMesh();
294 return (*
this)(m, parms[0], parms[1].toInt(), parms[2].toFloat());
297 bool operator()(
Mesh* mesh,
const QString& filename,
int column,
float border_size);
301 QString description()
const {
return "Load a heat map file and set the corresponding heat for each label"; }
303 <<
"Filename" <<
"Column" <<
QString(
"Border size (%1)").
arg(UM); }
305 <<
"Path to spreadsheet file."
306 <<
"Column of the csv file to load for display.\n"
307 "Label: cell labels, Value: original computed values (e.g. growth or signal), Heat: "
308 "values scaled for visualization (always between 0-1)."
309 <<
"Width of cell outline used for vizualization of 'wall' colormaps"; }
314 void selectFile(
const QString& filename);
316 void selectColumn(
int c);
337 if(!checkState().mesh(MESH_ANY))
339 Mesh* m = currentMesh();
340 return (*
this)(m, parms[0]);
343 bool operator()(
Mesh* mesh,
const QString& filename);
367 if(!checkState().mesh(MESH_ANY))
369 Mesh* m = currentMesh();
370 return (*
this)(m, parms[0]);
373 bool operator()(
Mesh* mesh,
const QString& filename);
393 if(!checkState().mesh(MESH_ANY))
395 Mesh* m = currentMesh();
399 bool operator()(
Mesh* mesh);
Definition: MeshProcessHeatMap.hpp:52
QString name() const
Returns the name of the process.
Definition: MeshProcessHeatMap.hpp:402
QString folder() const
Folder in which to place the process.
Definition: MeshProcessHeatMap.hpp:401
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessHeatMap.hpp:268
std::map< int, HVec3U > IntHVec3uMap
Map of an integer to a host vector of 3 unsigned integers.
Definition: Mesh.hpp:68
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessHeatMap.hpp:377
QString folder() const
Folder in which to place the process.
Definition: MeshProcessHeatMap.hpp:74
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessHeatMap.hpp:404
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessHeatMap.hpp:403
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessHeatMap.hpp:233
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessHeatMap.hpp:181
std::map< IntIntPair, float > IntIntFloatMap
Map of a pair of integers to a float.
Definition: Mesh.hpp:112
arg(const QString &a, int fieldWidth=0, const QChar &fillChar=QLatin1Char( ' ')
std::map< int, float > IntFloatMap
Map of an integer to a float.
Definition: Mesh.hpp:58
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessHeatMap.hpp:379
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessHeatMap.hpp:186
Rescale the heat map, specifying new lower and upper bound.
Definition: MeshProcessHeatMap.hpp:202
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessHeatMap.hpp:347
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessHeatMap.hpp:289
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessHeatMap.hpp:301
Save the current heat map in a CSV file.
Definition: MeshProcessHeatMap.hpp:245
QString name() const
Returns the name of the process.
Definition: MeshProcessHeatMap.hpp:376
Store mapping from each label to a label in a different mesh (parent).
Definition: MeshProcessHeatMap.hpp:329
Compute heat map on the current mesh.
Definition: MeshProcessHeatMap.hpp:22
QString folder() const
Folder in which to place the process.
Definition: MeshProcessHeatMap.hpp:230
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessHeatMap.hpp:351
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessHeatMap.hpp:349
QString folder() const
Folder in which to place the process.
Definition: MeshProcessHeatMap.hpp:262
QString name() const
Returns the name of the process.
Definition: MeshProcessHeatMap.hpp:300
QString name() const
Returns the name of the process.
Definition: MeshProcessHeatMap.hpp:263
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessHeatMap.hpp:194
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessHeatMap.hpp:302
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessHeatMap.hpp:179
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessHeatMap.hpp:237
QString folder() const
Folder in which to place the process.
Definition: MeshProcessHeatMap.hpp:345
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessHeatMap.hpp:335
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessHeatMap.hpp:76
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessHeatMap.hpp:267
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessHeatMap.hpp:266
QString name() const
Returns the name of the process.
Definition: MeshProcessHeatMap.hpp:346
std::map< int, VIdSet > IntVIdSetMap
Map of an integer to a set of vertex ids.
Definition: Mesh.hpp:88
This class holds the actual mesh as a VV Graph and all sort of properties for it, including visualiza...
Definition: Mesh.hpp:167
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessHeatMap.hpp:118
QString folder() const
Folder in which to place the process.
Definition: MeshProcessHeatMap.hpp:175
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessHeatMap.hpp:381
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessHeatMap.hpp:84
Load the heat map from a CSV file.
Definition: MeshProcessHeatMap.hpp:282
QString folder() const
Folder in which to place the process.
Definition: MeshProcessHeatMap.hpp:375
Load mapping from each label to a label in a different mesh (parent).
Definition: MeshProcessHeatMap.hpp:359
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessHeatMap.hpp:310
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessHeatMap.hpp:234
QString name() const
Returns the name of the process.
Definition: MeshProcessHeatMap.hpp:176
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessHeatMap.hpp:378
File containing the definition of a Process.
ParmChoiceMap parmChoice() const
Purely for GUI purposes, provides for some of the parms parameter a choice.
Definition: MeshProcessHeatMap.hpp:187
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessHeatMap.hpp:380
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessHeatMap.hpp:77
This is the main process class, the one all process inherit from.
Definition: Process.hpp:248
QString name() const
Returns the name of the process.
Definition: MeshProcessHeatMap.hpp:75
mgx_EXPORT bool stringToBool(const QString &string)
Helper function converting a string into a boolean.
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessHeatMap.hpp:406
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessHeatMap.hpp:304
bool operator()(const QStringList &)
Implementation of the process with generic arguments.
Definition: MeshProcessHeatMap.hpp:391
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessHeatMap.hpp:265
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessHeatMap.hpp:252
QStringList parmNames() const
List of named parameters.
Definition: MeshProcessHeatMap.hpp:348
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessHeatMap.hpp:350
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessHeatMap.hpp:112
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessHeatMap.hpp:177
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessHeatMap.hpp:232
QString folder() const
Folder in which to place the process.
Definition: MeshProcessHeatMap.hpp:299
QStringList parmDefaults() const
List of default parms.
Definition: MeshProcessHeatMap.hpp:236
QString name() const
Returns the name of the process.
Definition: MeshProcessHeatMap.hpp:231
QIcon icon() const
Icon to use to represent the process in the GUI.
Definition: MeshProcessHeatMap.hpp:311
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessHeatMap.hpp:206
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessHeatMap.hpp:152
bool operator()(const QStringList &parms)
Implementation of the process with generic arguments.
Definition: MeshProcessHeatMap.hpp:365
QString description() const
Returns a description of the process for the GUI.
Definition: MeshProcessHeatMap.hpp:264
Clear label to parent mapping.
Definition: MeshProcessHeatMap.hpp:387
QStringList parmDescs() const
List of parameters descriptions.
Definition: MeshProcessHeatMap.hpp:405
Mesh processes have mutable access to meshes and non-mutable access to stacks.
Definition: Process.hpp:855
Delete labeling, and possibly cells, if their heat falls within a defined range.
Definition: MeshProcessHeatMap.hpp:148