11 #ifndef MESH_PROCESS_MEASURES_HPP
12 #define MESH_PROCESS_MEASURES_HPP
22 typedef std::pair<vertex, vertex>
VertexPr;
23 typedef std::set<vertex>
Set;
34 setName(
"Mesh/Heat Map/Measures/Signal/Signal Parameters");
35 setDesc(
"Generate heat map based on signal for the current mesh");
36 setIcon(QIcon(
":/images/MakeHeatMap.png"));
38 addParm(
"Type",
"Type of signal",
"Cell Total", QStringList() <<
"Cell Total" <<
"Cell Border" <<
"Cell Interior" <<
"Cell Border/Total" <<
"Cell Interior/Total" <<
"Cell Border/Interior");
39 addParm(
"Average",
"Count the signal average or total?",
"Yes",booleanChoice());
40 addParm(
"Border Size",
"Size of the cell border",
"1.0");
46 if(!checkState().mesh(MESH_ANY))
48 Mesh *mesh = currentMesh();
49 return run(mesh, mesh->
labelHeat(), parm(
"Type"),
stringToBool(parm(
"Average")), parm(
"Border Size").toDouble());
53 bool run(
Mesh* mesh,
IntFloatAttr& heatMap, QString type,
bool signalAvg,
double borderSize);
63 setName(
"Mesh/Heat Map/Measures/Signal/Signal Border");
64 setDesc(
"Generate heat map based on signal close to the cell border for the current mesh");
65 setIcon(QIcon(
":/images/MakeHeatMap.png"));
70 if(!checkState().mesh(MESH_ANY))
72 Mesh *mesh = currentMesh();
87 setName(
"Mesh/Heat Map/Measures/Signal/Signal Interior");
88 setDesc(
"Generate heat map based on signal in the cell interior for the current mesh");
89 setIcon(QIcon(
":/images/MakeHeatMap.png"));
94 if(!checkState().mesh(MESH_ANY))
96 Mesh *mesh = currentMesh();
111 setName(
"Mesh/Heat Map/Measures/Signal/Signal Total");
112 setDesc(
"Generate heat map based on signal in the cells of the current mesh");
113 setIcon(QIcon(
":/images/MakeHeatMap.png"));
118 if(!checkState().mesh(MESH_ANY))
120 Mesh *mesh = currentMesh();
134 setName(
"Mesh/Heat Map/Measures/Geometry/Area");
135 setDesc(
"Computes area of cells on the mesh.");
136 setIcon(QIcon(
":/images/MakeHeatMap.png"));
143 if(!checkState().mesh(MESH_ANY))
145 Mesh *mesh = currentMesh();
159 setName(
"Mesh/Heat Map/Measures/Geometry/Perimeter");
160 setDesc(
"Computes the perimeter of cells on the mesh");
161 setIcon(QIcon(
":/images/MakeHeatMap.png"));
168 if(!checkState().mesh(MESH_ANY))
170 Mesh *mesh = currentMesh();
182 setName(
"Mesh/Heat Map/ToBeDeleted/Measures/Shape/Bending");
183 setDesc(
"Computes bending of cells on the mesh.\n"
184 "adds up the norm of the scalar product of the border segments.");
185 setIcon(QIcon(
":/images/MakeHeatMap.png"));
192 if(!checkState().mesh(MESH_ANY))
194 Mesh *mesh = currentMesh();
207 setName(
"Mesh/Heat Map/ToBeDeleted/Measures/Shape/Common Bending");
208 setDesc(
"Computes bending of a cell together with its closest neighbor on the mesh");
209 setIcon(QIcon(
":/images/MakeHeatMap.png"));
216 if(!checkState().mesh(MESH_ANY))
218 Mesh *mesh = currentMesh();
231 setName(
"Mesh/Heat Map/Measures/Geometry/Aspect Ratio");
232 setDesc(
"Computes the ratio of the length of the major over the minor axis of the cells by using the PCA Shape Analysis 2D process in Cell Axis");
233 setIcon(QIcon(
":/images/MakeHeatMap.png"));
241 if(!checkState().mesh(MESH_ANY))
243 Mesh *mesh = currentMesh();
260 setName(
"Mesh/Heat Map/Measures/Geometry/Length Major Axis");
261 setDesc(
"Computes the length of the major axis of the cells by using the PCA Shape Analysis 2D process in Cell Axis");
262 setIcon(QIcon(
":/images/MakeHeatMap.png"));
269 if(!checkState().mesh(MESH_ANY))
271 Mesh *mesh = currentMesh();
285 setName(
"Mesh/Heat Map/Measures/Geometry/Length Minor Axis");
286 setDesc(
"Computes the length of the minor axis of the cells by using the PCA Shape Analysis 2D process in Cell Axis");
287 setIcon(QIcon(
":/images/MakeHeatMap.png"));
294 if(!checkState().mesh(MESH_ANY))
296 Mesh *mesh = currentMesh();
309 setName(
"Mesh/Heat Map/Measures/Network/Neighbors");
310 setDesc(
"Computes the number of neighbors of cells");
311 setIcon(QIcon(
":/images/MakeHeatMap.png"));
314 void findNeighbourVertices(
vvGraph& S,
std::map<
int, std::set<vertex> > &Nhbr);
320 if(!checkState().mesh(MESH_ANY))
322 Mesh *mesh = currentMesh();
335 setName(
"Mesh/Heat Map/Measures/Geometry/Minimum Radius");
336 setDesc(
"Computes the minimum distance from the cell center to the border");
337 setIcon(QIcon(
":/images/MakeHeatMap.png"));
342 if(!checkState().mesh(MESH_ANY))
344 Mesh *mesh = currentMesh();
357 setName(
"Mesh/Heat Map/Measures/Geometry/Maximum Radius");
358 setDesc(
"Computes the maximum distance from the cell center to the border");
359 setIcon(QIcon(
":/images/MakeHeatMap.png"));
364 if(!checkState().mesh(MESH_ANY))
366 Mesh *mesh = currentMesh();
379 setName(
"Mesh/Heat Map/Measures/Geometry/Average Radius");
380 setDesc(
"Computes the average distance from the cell center to the border");
381 setIcon(QIcon(
":/images/MakeHeatMap.png"));
386 if(!checkState().mesh(MESH_ANY))
388 Mesh *mesh = currentMesh();
401 setName(
"Mesh/Heat Map/Measures/Location/Distance to Mesh");
402 setDesc(
"Computes the closest distance to the other mesh");
403 setIcon(QIcon(
":/images/MakeHeatMap.png"));
408 if(!checkState().mesh(MESH_ANY))
410 Mesh *m = currentMesh();
414 Stack *s1 = currentStack();
415 Stack *s2 = stack(1);
418 return run(s1, s2, m, m2, m->
labelHeat());
430 setName(
"Mesh/Heat Map/Measures/Location/Major Axis Theta");
431 setDesc(
"Computes the angle between the major axis of a cell and a reference direction");
432 setIcon(QIcon(
":/images/MakeHeatMap.png"));
434 addParm(
"Reference Direction",
"Reference Direction",
"X-Axis",QStringList() <<
"X-Axis" <<
"Y-Axis" <<
"Z-Axis" <<
"Custom X"<<
"Custom Y"<<
"Custom Z");
439 if(!checkState().mesh(MESH_ANY))
441 Mesh *mesh = currentMesh();
442 Stack *s1 = currentStack();
443 return run(s1, mesh, mesh->
labelHeat(), parm(
"Reference Direction"));
455 setName(
"Mesh/Heat Map/Measures/Location/Distance to Bezier");
456 setDesc(
"Computes for each cell the distance to a defined Bezier grid or line");
457 setIcon(QIcon(
":/images/MakeHeatMap.png"));
459 addParm(
"Consider Orientation",
"Consider Orientation",
"Yes",booleanChoice());
460 addParm(
"Reverse Orientation",
"Reverse Orientation",
"No",booleanChoice());
467 if(!checkState().mesh(MESH_ANY))
469 Mesh *mesh = currentMesh();
470 Stack *s1 = currentStack();
483 setName(
"Mesh/Heat Map/Measures/Location/Bezier Coord");
484 setDesc(
"Computes for each cell centroid the nearest point on a Bezier grid or line and assigns it the Bezier coordinate");
485 setIcon(QIcon(
":/images/MakeHeatMap.png"));
487 addParm(
"Coordinate",
"Coordinate",
"X", QStringList() <<
"X" <<
"Y");
492 if(!checkState().mesh(MESH_ANY))
494 Mesh *mesh = currentMesh();
495 Stack *s1 = currentStack();
496 return run(s1, mesh, parm(
"Coordinate"), mesh->
labelHeat());
507 setName(
"Mesh/Heat Map/Measures/Location/Bezier Line Coord");
508 setDesc(
"Computes for each cell centroid the nearest point on a Bezier grid or line and assigns it the Bezier coordinate");
509 setIcon(QIcon(
":/images/MakeHeatMap.png"));
511 addParm(
"Reverse Line",
"Reverse Line",
"No", booleanChoice());
516 if(!checkState().mesh(MESH_ANY))
518 Mesh *mesh = currentMesh();
519 Stack *s1 = currentStack();
533 setName(
"Mesh/Heat Map/Measures/Location/Polar Coord");
534 setDesc(
"Computes a position of cells according to a defined polar coordinate system.\n"
535 "This process writes all coordinates in attribute maps and shows the selected option as heat map.");
536 setIcon(QIcon(
":/images/MakeHeatMap.png"));
538 addParm(
"Central Axis",
"Central Axis",
"Z", QStringList() <<
"X" <<
"Y" <<
"Z");
539 addParm(
"Coordinate",
"Coordinate",
"Longitudinal", QStringList() <<
"Longitudinal" <<
"Radial" <<
"Circumferential");
544 if(!checkState().mesh(MESH_ANY))
546 Mesh *mesh = currentMesh();
547 Stack *s1 = currentStack();
548 return run(s1, mesh, parm(
"Central Axis"), parm(
"Coordinate"), mesh->
labelHeat());
559 setName(
"Mesh/Heat Map/ToBeDeleted/Measures/Shape/Variability Radius");
560 setDesc(
"Computes variability of radius of 2 similar cells on the mesh");
561 setIcon(QIcon(
":/images/MakeHeatMap.png"));
564 void findCommonNeighbors(
vvGraph& S, std::map<VertexPr, Set> &NhbrElem);
570 if(!checkState().mesh(MESH_ANY))
572 Mesh *mesh = currentMesh();
585 setName(
"Mesh/Heat Map/ToBeDeleted/Measures/Shape/Common Neighbors");
586 setDesc(
"Computes Common neighbors of 2 similar cells on the mesh");
587 setIcon(QIcon(
":/images/MakeHeatMap.png"));
592 void calculateClosestNhbr(
vvGraph& S, std::set<VertexPr> &NeighbourMap);
596 if(!checkState().mesh(MESH_ANY))
598 Mesh *mesh = currentMesh();
612 setName(
"Mesh/Heat Map/ToBeDeleted/Measures/Shape/Stomata Area");
613 setDesc(
"Computes Common neighbors of 2 similar cells on the mesh");
614 setIcon(QIcon(
":/images/MakeHeatMap.png"));
621 if(!checkState().mesh(MESH_ANY))
623 Mesh *mesh = currentMesh();
636 setName(
"Mesh/Heat Map/ToBeDeleted/Measures/Neighborhood/Area");
637 setDesc(
"Computes average area of neighborhood cells on the mesh");
638 setIcon(QIcon(
":/images/MakeHeatMap.png"));
643 if(!checkState().mesh(MESH_ANY))
645 Mesh *mesh = currentMesh();
658 setName(
"Mesh/Heat Map/ToBeDeleted/Measures/Neighborhood/Perimeter");
659 setDesc(
"Computes average perimeter of neighborhood cells on the mesh");
660 setIcon(QIcon(
":/images/MakeHeatMap.png"));
665 if(!checkState().mesh(MESH_ANY))
667 Mesh *mesh = currentMesh();
680 setName(
"Mesh/Heat Map/ToBeDeleted/Measures/Neighborhood/Aspect Ratio");
681 setDesc(
"Computes LenBr of cells on the mesh");
682 setIcon(QIcon(
":/images/MakeHeatMap.png"));
689 if(!checkState().mesh(MESH_ANY))
691 Mesh *mesh = currentMesh();
704 setName(
"Mesh/Heat Map/ToBeDeleted/Measures/Neighborhood/Neighbors");
705 setDesc(
"Computes neighbors of cells on the mesh");
706 setIcon(QIcon(
":/images/MakeHeatMap.png"));
711 if(!checkState().mesh(MESH_ANY))
713 Mesh *mesh = currentMesh();
726 setName(
"Mesh/Heat Map/ToBeDeleted/Measures/Neighborhood/Variability Radius");
727 setDesc(
"Computes variability of radius of 2 similar cells on the mesh");
728 setIcon(QIcon(
":/images/MakeHeatMap.png"));
733 if(!checkState().mesh(MESH_ANY))
735 Mesh *mesh = currentMesh();
748 setName(
"Mesh/Heat Map/Measures/Location/Cell Distance");
749 setDesc(
"Computes the shortest path between selected cells and the remaining cells");
750 setIcon(QIcon(
":/images/MakeHeatMap.png"));
752 addParm(
"Wall Weights",
"Wall Weights",
"Euclidean", QStringList() <<
"1 / Wall Length" <<
"1" <<
"Euclidean");
753 addParm(
"Restrict connectivity to same cell type",
"Restrict connectivity to same cell type",
"No", booleanChoice());
759 if(!checkState().mesh(MESH_ANY))
761 Mesh *mesh = currentMesh();
762 return run(mesh, parm(
"Wall Weights"),
stringToBool(parm(
"Restrict connectivity to same cell type")), mesh->
labelHeat());
765 bool run(
Mesh* mesh, QString weight,
bool cellTypes,
IntFloatAttr &heatmap);
774 setName(
"Mesh/Heat Map/Measures/Location/Cell Coordinate");
775 setDesc(
"Computes the shortest path between selected cells and the remaining cells");
776 setIcon(QIcon(
":/images/MakeHeatMap.png"));
778 addParm(
"Dimension",
"Dimension",
"X", QStringList() <<
"X" <<
"Y" <<
"Z" <<
"Distance Origin");
784 if(!checkState().mesh(MESH_ANY))
786 Mesh *mesh = currentMesh();
787 Stack* s = currentStack();
788 return run(s, mesh, parm(
"Dimension"), mesh->
labelHeat());
808 setName(
"Mesh/Heat Map/Measures/Geometry/Junction Distance");
809 setDesc(
"Calculates the distance between junctions of a cell.");
810 setIcon(QIcon(
":/images/MakeHeatMap.png"));
812 addParm(
"Mode",
"Min or Max",
"Min", QStringList() <<
"Min" <<
"Max");
813 addParm(
"Direct Junctions Only",
"Consider Only Direct Cell Junctions. If No then also neighboring cell junctions will be considered.",
"No",booleanChoice());
814 addParm(
"Ignore Border Cells",
"Heat values for border cells should be ignored for this Measure",
"Yes",booleanChoice());
820 Mesh *m = currentMesh();
824 bool run(
Mesh *m, QString mode,
bool onlyDirect,
bool ignoreBorderCells,
IntFloatAttr& heatMap);