MorphoGraphX  2.0-1-227
DivisionAnalysis.hpp
Go to the documentation of this file.
1 #ifndef DIVISION_ANALYSIS_HPP
2 #define DIVISION_ANALYSIS_HPP
3 
4 #include <Process.hpp>
6 #include <CellDivision.hpp>
7 
9 
10 namespace mgx {
11 
12 
13 struct RootDivData{
14 
15  int label1, label2;
18 
19 };
20 
21 
22  typedef std::pair<vertex,vertex> VtxVtx;
23 
25 
26  struct DivisionParms{
27 
28  public:
29 
30  QString primary, secondary;
32 
34 
37  int planeNr;
38 
39  std::set<Point3d> perpNeighborPlanes;
40  std::unordered_map<Point3d, std::vector<Point3d> > perpNeighborWalls;
41 
42  };
43 
44 
45  // /**
46  // * \class CalcDivisionPlane DivisionAnalysis.hpp <DivisionAnalysis.hpp>
47  // *
48  // * CalcDivisionPlane
49  // * TBD
50  // */
51  // class CalcDivisionPlane : public Process
52  // {
53  // public:
54  // CalcDivisionPlane(const Process& process) : Process(process) {}
55 
56  // bool operator()(const QStringList& parms)
57  // {
58  // if(!checkState().store(STORE_NON_EMPTY|STORE_LABEL))
59  // return false;
60  // Stack *stk = currentStack();
61  // Store *store = stk->currentStore();
62  // return operator()(currentMesh(), store, parms[0], parms[1].toInt(), parms[2].toInt());
63  // }
64 
65  // bool operator()(Mesh* mesh, const Store* store, const QString &fileName, int id1, int id2);
66  // QString name() const { return "Mesh/Division Analysis/ToTest/Calc Division Plane"; }
67  // QString description() const { return
68  // "Compute the division plane between the two cells present in the current stack."
69  // "Place the cutting plane on the division plane."; }
70  // QStringList parmNames() const { return QStringList()
71  // << "Output" << "Cell ID 1" << "Cell ID 2"; }
72  // QStringList parmDescs() const { return QStringList()
73  // << "Output" << "Cell ID 1" << "Cell ID 2"; }
74  // QStringList parmDefaults() const { return QStringList() << "" << "-1" << "-1"; }
75  // QIcon icon() const { return QIcon(":/images/DivisionPlane.png"); }
76  // };
77 
84 class DisplayCellGraph : public Process
85  {
86  public:
87  DisplayCellGraph(const Process& process) : Process(process)
88  {
89  setName("Mesh/Division Analysis/Old/MGX3D/Cell Graph Display");
90  setDesc("Creates the cell connectivity graph from the active MGX3D mesh and saves it into the non-active mesh.\n"
91  "not really needed anymore since there is now the display option in Main/Mesh");
92  setIcon(QIcon(":/images/DivisionPlane.png"));
93 
94  addParm("Min Shared Area","","0.001");
95  }
96 
97  bool run()
98  {
99  Mesh *m = currentMesh();
100  Mesh *m2;
101  if(currentMesh() == mesh(0))
102  m2 = mesh(1);
103  else
104  m2 = mesh(0);
105  return run(m, m2, parm("Min Shared Area").toDouble());
106  }
107  bool run(Mesh *m, Mesh *m2, double minArea);
108 
109  };
110 
111 
119  {
120  public:
121  DisplayCellGraph2D(const Process& process) : Process(process)
122  {
123  setName("Mesh/Division Analysis/Tools/Cell Graph Display 2D");
124  setDesc("Creates the cell connectivity graph from the active MGX3D mesh and saves it into the non-active mesh.\n"
125  "not really needed anymore since there is now the display option in Main/Mesh");
126  setIcon(QIcon(":/images/DivisionPlane.png"));
127 
128  addParm("Min Shared Area","","0.001");
129  }
130 
131  bool run()
132  {
133  Mesh *m = currentMesh();
134  Mesh *m2;
135  if(currentMesh() == mesh(0))
136  m2 = mesh(1);
137  else
138  m2 = mesh(0);
139  return run(m, m2, parm("Min Shared Area").toDouble());
140  }
141  bool run(Mesh *m, Mesh *m2, double minArea);
142 
143  };
144 
152  {
153  public:
154  DisplayCellGraph3D(const Process& process) : Process(process)
155  {
156  setName("Mesh/Division Analysis/Tools/Cell Graph Display 3D");
157  setDesc("Creates the cell connectivity graph from the active MGX3D mesh and saves it into the non-active mesh.\n"
158  "not really needed anymore since there is now the display option in Main/Mesh");
159  setIcon(QIcon(":/images/DivisionPlane.png"));
160 
161  addParm("Min Shared Area","","0.001");
162  }
163 
164  bool run()
165  {
166  Mesh *m = currentMesh();
167  Mesh *m2;
168  if(currentMesh() == mesh(0))
169  m2 = mesh(1);
170  else
171  m2 = mesh(0);
172  return run(m, m2, parm("Min Shared Area").toDouble());
173  }
174  bool run(Mesh *m, Mesh *m2, double minArea);
175 
176  };
177 
185  class DivideCell3DMGX3D : public Process
186  {
187  public:
188  DivideCell3DMGX3D(const Process& process) : Process(process)
189  {
190 
191  setName("Mesh/Division Analysis/Old/MGX3D/Divide Cell MGX3D");
192  setDesc("Divide a cell along a specified direction through the cell center.\n"
193  " WARNING: not 100 percent bug-free. sometimes chrashes or results in a broken mesh");
194  setIcon(QIcon(":/images/DivisionPlane.png"));
195 
196  addParm("Label","Label","1");
197  addParm("Division Alg","","predefined direction", QStringList() << "shortest wall" << "random direction" << "predefined direction");
198  addParm("Custom X","Custom X","1.0");
199  addParm("Custom Y","Custom Y","0.0");
200  addParm("Custom Z","Custom Z","0.0");
201  addParm("Center Displacement" ,"Center Displacement","0.0");
202  }
203 
204  bool run()
205  {
206  Mesh *m = currentMesh();
207  return run(m, parm("Label").toInt(), parm("Division Alg"), parm("Custom X").toDouble(), parm("Custom Y").toDouble(), parm("Custom Z").toDouble(),
208  parm("Center Displacement").toDouble()/*, stringToBool(parms[6])*//*, parms[7]*/);
209  }
210  bool run(Mesh *m, int label, QString division, double x, double y, double z,
211  double displacement/*, bool newM*//*, QString fragmentHandling*/);
212 
213  };
214 
222  {
223  public:
224  TestDivisionPlanes(const Process& process) : Process(process)
225  {
226  setName("Mesh/Division Analysis/Old/MGX3D/B Cell Division Analysis");
227  setDesc("Central division analysis process that simulate cell divisions using multiple division \n"
228  "planes on a cell before the division has ocurred or on two neighobring cells after the division. \n"
229  "Calculates properties of possible divisions such as division plane area and volume of the daughter cells");
230  setIcon(QIcon(":/images/DivisionPlane.png"));
231 
232  addParm("Label Cell 1","Label of cell to be tested","1"); // 0
233  addParm("Label Cell 2 (optional)","Label of neighbor cell to be tested (after the actual division has occurred)","0"); // 1
234  addParm("Test Division Planes","Approximate number of division planes that will be tested","1000"); // 2
235  addParm("Perpendicular To Surface","Perpendicular To Surface","No",booleanChoice()); // 3
236  addParm("Perpendicular To Low Degree Neighbor Wall","Enforce that the wall is perpendicular to a neighbor cell with the lowest number of neighbors. constrained/cutting wall means that the division plane has to cut this wall.","No", QStringList() << "Yes (constrained)" << "Yes" << "No" << "No (but cutting wall)"); // 4
237  addParm("Steps Center Variance","Steps Center Variance","0"); // 5
238  addParm("Stepsize Center Variance","Stepsize Center Variance","1.0"); // 6
239  addParm("Display Result","Display Result","Yes",booleanChoice()); // 7
240  addParm("Save Result To File","Save Result To File",""); // 8
241  addParm("Weights Cell Graph","Weights Cell Graph","no weights", QStringList() << "no weights" << "no weights (dijkstra)" << "1/wallArea"); // 9
242  addParm("GPU","GPU","0"); // 10
243  addParm("Calc Betw","Calc Betw","No",booleanChoice()); // 11
244  addParm("Division Point","Division Point","Centroid",QStringList() << "Centroid" << "Center of Actual" << "Manual"); // 12
245  }
246 
248 
249  bool run()
250  {
251  Mesh *m = currentMesh();
252  Mesh *m2;
253  if(currentMesh() == mesh(0))
254  m2 = mesh(1);
255  else
256  m2 = mesh(0);
257 
258  bool constWeight = parm("Weights Cell Graph") == "1/wallArea" ? false : true;
259  bool dijk = parm("Weights Cell Graph") == "no weights" ? false : true;
260 
261  bool perpendicularNeighbor = (parm("Perpendicular To Low Degree Neighbor Wall") == "No" or parm("Perpendicular To Low Degree Neighbor Wall") == "No (but cutting wall)") ? false : true;
262  bool perpendicularConstrained = parm("Perpendicular To Low Degree Neighbor Wall") == "Yes (constrained)" ? true : false;
263  bool cuttingNeighborWall = parm("Perpendicular To Low Degree Neighbor Wall") == "No (but cutting wall)" ? true : false;
264 
266 
267  p.perpendicularNeighbor = perpendicularNeighbor;
268  p.perpendicularConstrained = perpendicularConstrained;
269  p.cuttingNeighborWall = cuttingNeighborWall;
270  p.perpendicular = stringToBool(parm("Test Division Planes"));
271 
272 
273  p.stepsCenter = parm("Steps Center Variance").toInt();
274  p.stepSizeCenter = parm("Stepsize Center Variance").toDouble();
275 
276  p.planeNr = parm("Test Division Planes").toInt();
277 
278  return run(m, m2, p, parm("Label Cell 1").toInt(), parm("Label Cell 2 (optional)").toInt(),
279  stringToBool(parm("Display Result")), parm("Save Result To File"), constWeight, dijk, parm("GPU").toInt(),
280  stringToBool(parm("Calc Betw")), parm("Division Point"));
281 
282  }
283  bool run(Mesh *m, Mesh *m2, int label1, int label2, int divPlanes, bool perpendicular, bool perpendicularNeighbor, int cellCenterVarSteps,
284  double cellCenterVarStepSize, bool displayResult, QString filename, bool constWeight, bool dijk, int percGPU, bool calcBetw,
285  QString cellCenterSelVertex, bool perpendicularConstrained, bool cuttingNeighborWall);
286 
287  bool run(Mesh *m, Mesh *m2, DivisionParms& par, int label1, int label2,
288  bool displayResult, QString filename, bool constWeight, bool dijk, int percGPU, bool calcBetw, QString cellCenterSelVertex);
289 
290 
291  //bool testDivisionPlanesFunc(Mesh *mesh, Mesh *mesh2, int label, int divPlanes, bool perpendicular, bool perpendicularNeighbor,
292  // int cellCenterVarSteps, double cellCenterVarStepSize, bool displayResult, QString filename, bool constWeight, bool dijk,
293  // int percGPU, bool calcBetw, bool overwrite, bool cellCenterSelVertex, bool perpendicularConstrained,
294  // bool cuttingNeighborWall, Point3d divisionPoint = Point3d(0,0,0), DivisionParms& par);
295 
296  bool testDivisionPlanesFunc(Mesh *mesh, Mesh *mesh2, int label, bool displayResult, QString filename, bool constWeight, bool dijk,
297  int percGPU, bool calcBetw, bool overwrite, QString cellCenterSelVertex, DivisionParms& par, Point3d divisionPoint = Point3d(0,0,0));
298 
299  };
307  {
308  public:
309  TestDivisionPlanesCellAtlas(const Process& process) : Process(process)
310  {
311  setName("Mesh/Division Analysis/Old/MGX3D/Processes Cell Atlas/Test Cell Atlas Division Planes");
312  setDesc("TBD");
313  setIcon(QIcon(":/images/DivisionPlane.png"));
314 
315  addParm("Label 1","Label of cell to be tested","1"); // 0
316  addParm("Label 2","Label of cell to be tested","2"); // 1
317  addParm("Display Result","Display Result","Yes",booleanChoice()); // 2
318 
319  }
320 
321  bool run()
322  {
323  Mesh *m = currentMesh();
324  Mesh *m2;
325  if(currentMesh() == mesh(0))
326  m2 = mesh(1);
327  else
328  m2 = mesh(0);
329 
330  RootDivData result;
331 
332  return run(m, m2, parm("Label 1").toInt(), parm("Label 2").toInt(), stringToBool(parm("Display Result")), result, true);
333  }
334 
335  bool run(Mesh *m, Mesh *m2, int label1, int label2, bool displayResult, RootDivData& result, bool copyToM2);
336 
337  };
345  {
346  public:
347  RootDivisionAnalysis(const Process& process) : Process(process)
348  {
349  setName("Mesh/Division Analysis/Old/MGX3D/Processes Cell Atlas/Root Division Analysis");
350  setDesc("TBD");
351  setIcon(QIcon(":/images/DivisionPlane.png"));
352 
353  addParm("Display Result","Display Result","Yes",booleanChoice()); // 0
354  addParm("Output File", "Output File",""); // 1
355 
356  }
357 
358  bool run()
359  {
360  Mesh *m = currentMesh();
361  Mesh *m2;
362  if(currentMesh() == mesh(0))
363  m2 = mesh(1);
364  else
365  m2 = mesh(0);
366 
367  return run(m, m2, stringToBool(parm("Display Result")), parm("Output File"));
368  }
369 
370  bool run(Mesh *m, Mesh *m2, bool displayResult, QString filename);
371 
372  };
373 
381  {
382  public:
383  DivisionAnalysisMulti3DOld(const Process& process) : Process(process)
384  {
385  setName("Mesh/Division Analysis/Old/MGX3D/Division Analysis Multi");
386  setDesc("TBD");
387  setIcon(QIcon(":/images/DivisionPlane.png"));
388 
389  addParm("Test Single","Test Single","No",booleanChoice()); // 0
390  addParm("Test Double","Test Double","Yes",booleanChoice()); // 1
391  addParm("Use Stack","Use Stack","Yes",booleanChoice()); // 1
392  addParm("Display Shortest","Display Shortest","Yes",booleanChoice()); // 2
393  addParm("Display Actual","Display Actual","Yes",booleanChoice()); // 3
394  }
395 
396  bool run()
397  {
398  Stack* s1 = currentStack();
399  Store* store1 = s1->currentStore();
400 
401  Mesh *m = currentMesh();
402  Mesh *m2 = otherMesh();
403  return run(s1, store1, m, m2,stringToBool(parm("Test Single")),stringToBool(parm("Test Double")),
404  stringToBool(parm("Use Stack")), stringToBool(parm("Display Shortest")), stringToBool(parm("Display Actual")));
405  }
406 
407  bool run(Stack* s1, Store* s, Mesh *m, Mesh *m2, bool singleCells, bool doubleCells, bool useStack, bool displayShortest, bool displayActual);
408 
409  };
410 
411  // /**
412  // * \class DivisionAnalysisMulti DivisionAnalysis.hpp <DivisionAnalysis.hpp>
413  // *
414  // * DivisionAnalysisMulti
415  // * TBD
416  // */
417  // class DivisionAnalysisMulti : public Process
418  // {
419  // public:
420  // DivisionAnalysisMulti(const Process& process) : Process(process)
421  // {
422  // setName("Mesh/Division Analysis/Analysis 3D/Division Analysis Multi");
423  // setDesc("TBD");
424  // setIcon(QIcon(":/images/DivisionPlane.png"));
425 
426  // addParm("Test Single","Test Single","No",booleanChoice()); // 0
427  // addParm("Test Double","Test Double","Yes",booleanChoice()); // 1
428  // addParm("Display Shortest","Display Shortest","Yes",booleanChoice()); // 2
429  // addParm("Display Actual","Display Actual","Yes",booleanChoice()); // 3
430  // addParm("Output File","Output File",""); // 4
431  // }
432 
433  // bool run()
434  // {
435  // Mesh *m = currentMesh();
436  // Mesh *m2;
437  // if(currentMesh() == mesh(0))
438  // m2 = mesh(1);
439  // else
440  // m2 = mesh(0);
441 
442  // return run(m, m2, stringToBool(parm("Test Single")), stringToBool(parm("Test Double")), stringToBool(parm("Display Shortest")), parm("Display Actual"));
443  // }
444 
445  // bool run(Mesh *m, Mesh *m2, bool runPre, bool runPost, bool displayResult, QString filename);
446 
447  // };
448 
455  class FlatDivisionPlane : public Process
456  {
457  public:
458  FlatDivisionPlane(const Process& process) : Process(process)
459  {
460  setName("Mesh/Division Analysis/Old/MGX3D/Division Plane Approximation");
461  setDesc("Display a planar approximation plane of a wall between two cells");
462  setIcon(QIcon(":/images/DivisionPlane.png"));
463 
464  addParm("Label 1","Label 1","1"); // 0
465  addParm("Label 2","Label 2","2"); // 1
466  addParm("Display","Overwrite the non-active mesh and display the plane","No",booleanChoice()); // 2
467  }
468 
469  bool run()
470  {
471  Mesh *m = currentMesh();
472  Mesh *m2;
473  if(currentMesh() == mesh(0))
474  m2 = mesh(1);
475  else
476  m2 = mesh(0);
477  CellDivisionAttr cda;
478  return run(m, m2, parm("Label 1").toInt(), parm("Label 2").toInt(), stringToBool(parm("Display")), dat, cda);
479  }
480 
481  bool run(Mesh *m, Mesh *m2, int label1, int label2, bool display, DivisionAnalysisData &dat, CellDivisionAttr &cdaExp);
482 
483  };
484 
485 
492  class ActualPlaneStack : public Process
493  {
494  public:
495  ActualPlaneStack(const Process& process) : Process(process)
496  {
497  setName("Mesh/Division Analysis/Old/MGX3D/Division Plane Actual Stack");
498  setDesc("Display a planar approximation plane of a wall between two cells");
499  setIcon(QIcon(":/images/DivisionPlane.png"));
500 
501  addParm("Label 1","Label 1","1"); // 0
502  addParm("Label 2","Label 2","2"); // 1
503  addParm("Display","Overwrite the non-active mesh and display the plane","No",booleanChoice()); // 2
504  }
505 
506  bool run()
507  {
508  Stack* s1 = currentStack();
509  Store* store1 = s1->currentStore();
510 
511  Mesh *m = currentMesh();
512  Mesh *m2;
513  if(currentMesh() == mesh(0))
514  m2 = mesh(1);
515  else
516  m2 = mesh(0);
517  CellDivisionAttr cda;
518  return run(s1, store1, m, m2, parm("Label 1").toInt(), parm("Label 2").toInt(),
519  stringToBool(parm("Display")), dat, cda);
520  }
521  bool run(Stack* s1, Store* s, Mesh *m, Mesh *m2, int label1, int label2, bool display, DivisionAnalysisData &dat, CellDivisionAttr &cdaExp);
522  };
523 
524 
525 
532  class AnalyzeSurface : public Process
533  {
534  public:
535  AnalyzeSurface(const Process& process) : Process(process)
536  {
537  setName("Mesh/Division Analysis/Old/MGX3D/A Pre Analysis");
538  setDesc("Requires a MGX3D mesh in the active mesh and a surface mesh in the non-active mesh \n"
539  "Also can calculate the betweenness measure (visualize with Tools/Cell Data Heatmap)");
540  setIcon(QIcon(":/images/DivisionPlane.png"));
541 
542  addParm("Calc Betweenness Centrality","Calc Betweenness Centrality","No", QStringList() << "No" << "Yes - no weights" << "Yes - 1/wallArea"); // 0
543  addParm("Calc Current Flow Betweenness","Calc Current Flow Betweenness","No", QStringList() << "No" << "Yes - no weights" << "Yes - 1/wallArea" << "Yes - no weights (GPU)" << "Yes - 1/wallArea (GPU)");
544  }
545 
546  bool run()
547  {
548  Mesh *m = currentMesh();
549  Mesh *m2;
550  if(currentMesh() == mesh(0))
551  m2 = mesh(1);
552  else
553  m2 = mesh(0);
554 /*
555  bool betw = parms[0] == "No" ? false : true;
556  bool weights = parms[0] == "Yes - 1/wallArea" ? true : false;
557 
558  bool currentFlow = parms[1] == "No" ? false : true;
559  bool weightsCur = parms[1] == "Yes - 1/wallArea" or parms[1] == "Yes - 1/wallArea (GPU)" ? true : false;
560 
561  bool useGPU = parms[1] == "Yes - no weights (GPU)" or parms[1] == "Yes - 1/wallArea (GPU)" ? true : false;
562 */
563  return run(m, m2, dat);
564  }
565 
566  bool run(Mesh *m, Mesh *m2, DivisionAnalysisData &dat);
567 
568  };
569 
570  // /**
571  // * \class DisplayHeatMaps DivisionAnalysis.hpp <DivisionAnalysis.hpp>
572  // *
573  // * DisplayHeatMaps
574  // * Displays measures of the Pre Analysis
575  // */
576  // class DisplayHeatMaps : public Process
577  // {
578  // public:
579  // DisplayHeatMaps(const Process& process) : Process(process) { }
580 
581  // bool run(const QStringList& parms){
582  // return run(parms[0]);
583  // }
584  // bool run(QString choice);
585 
586  // QStringList parmNames() const { return QStringList() << "Data"; }
587 
588  // QStringList parmDefaults() const { return QStringList() << "Betweenness Centrality"; }
589 
590  // ParmChoiceMap parmChoice() const
591  // {
592  // ParmChoiceMap map;
593  // map[0] = QStringList() << "Betweenness Centrality" << "Current Flow Betweenness";
594  // return map;
595  // }
596 
597  // QString name() const { return "Mesh/Division Analysis/Tools/Cell Data Heatmap"; }
598  // QString description() const { return "Displays cell properties as a heatmap.\n"
599  // "\n"
600  // "Requires analyzed or loaded data in the memory (Pre Analysis Process)."; }
601 
602  // QIcon icon() const { return QIcon(":/images/CellAtlas.png"); }
603 
604  // };
605 
606 
607 
608 
609 
616  class SetDivisionPoint : public Process
617  {
618  public:
619  SetDivisionPoint(const Process& process) : Process(process)
620  {
621  setName("Mesh/Division Analysis/Set Division Point");
622  setDesc("Set a custom division point (select exactly one vertex)");
623  setIcon(QIcon(":/images/CHull.png"));
624  }
625 
626  bool run()
627  {
628  Mesh *m = currentMesh();
629  return run(m);
630  }
631 
632  bool run(Mesh *m);
633 
634  };
635 
643  {
644  public:
645  DisplayOptimalPlanes(const Process& process) : Process(process)
646  {
647  setName("Mesh/Division Analysis/Old/MGX3D/Display Optimal Planes Advanced");
648  setDesc("Displays planes of the Division analysis processes");
649  setIcon(QIcon(":/images/DivisionPlane.png"));
650 
651  addParm("Custom","Custom","No",booleanChoice()); // 0
652  addParm("Primary Criteria","Primary Optimization Criteria","Wall Area", QStringList() << "Wall Area" << "Volume Ratio" << "Betweenness Centrality" << "Random Walk Betweenness" << "Neighbor Count"); // 1
653  addParm("Direction Primary Criteria","Direction Primary Criteria","Min", QStringList() << "Min" << "Max"); // 2
654  addParm("Secondary Criteria","Secondary Optimization Criteria","Volume Ratio", QStringList() << "None" << "Wall Area" << "Volume Ratio" << "Betweenness Centrality" << "Random Walk Betweenness" << "Neighbor Count"); // 3
655  addParm("Direction Secondary Criteria","Direction Secondary Criteria","Min", QStringList() << "Min" << "Max" << "Random"); // 4
656  addParm("Tolerance","Tolerance","0.01"); // 5
657  addParm("Max Planes","Max Planes","100"); // 6
658  addParm("Reset Mesh","Reset Mesh","Yes",booleanChoice()); // 7
659  addParm("Max Plane Similarity","Max Plane Similarity","100.0"); // 8
660  addParm("Plane Size","Plane Size","10.0"); // 9
661  }
662 
663  bool run()
664  {
665  Mesh *m = currentMesh();
666  Mesh *m2;
667  if(currentMesh() == mesh(0))
668  m2 = mesh(1);
669  else
670  m2 = mesh(0);
671  return run(m, m2, stringToBool(parm("Custom")), parm("Primary Criteria"), parm("Secondary Criteria"), parm("Direction Primary Criteria"), parm("Direction Secondary Criteria"), dat, parm("Tolerance").toDouble(), parm("Max Planes").toInt(), stringToBool(parm("Reset Mesh")), parm("Max Plane Similarity").toDouble(), parm("Plane Size").toDouble());
672  }
673 
674  bool run(Mesh *m, Mesh *m2, bool custom, QString primary, QString secondary, QString primaryDir, QString secondaryDir,
675  DivisionAnalysisData &dat, double tolerance, int maxPlanes, bool resetM2, double locMinSens, double planeSize);
676 
677  };
678 
679 
687  {
688  public:
689  DisplayOptimalPlanesSimple(const Process& process) : Process(process)
690  {
691  setName("Mesh/Division Analysis/Old/MGX3D/Display Optimal Planes");
692  setDesc("Displays planes of the Division analysis processes");
693  setIcon(QIcon(":/images/DivisionPlane.png"));
694 
695  addParm("Division Rule","Division Rule","Shortest Wall", QStringList() << "Shortest Wall" << "Best Volume Ratio" << "Longest Wall"); // 0
696  addParm("Max Distance to Optimum","Max Distance to Optimum","0.1"); // 1
697  addParm("Max Number of Planes","Max Number of Planes","10"); // 2
698  addParm("Max Plane Similarity","Highest allowed similarity between two showed planes. Is the norm of the scalar product of their normals (if plane position is identical)","0.99"); // 3
699  addParm("Plane Size","Plane Size","10.0"); // 4
700  addParm("Reset Planes","Reset Planes","Yes",booleanChoice()); // 5
701  }
702 
703  bool run()
704  {
705  Mesh *m = currentMesh();
706  Mesh *m2;
707  if(currentMesh() == mesh(0))
708  m2 = mesh(1);
709  else
710  m2 = mesh(0);
711  return run(m, m2, parm("Division Rule"), parm("Max Distance to Optimum").toDouble(), parm("Max Number of Planes").toInt(), parm("Max Plane Similarity").toDouble(), parm("Plane Size").toDouble(), stringToBool(parm("Reset Planes")));
712  }
713 
714  bool run(Mesh *m, Mesh *m2, QString divRule, double maxDis, int maxPlanes, double planeSim, double planeSize, bool resetMesh);
715 
716  };
717 
718 
725  class DisplayAllPlanes : public Process
726  {
727  public:
728  DisplayAllPlanes(const Process& process) : Process(process)
729  {
730  setName("Mesh/Division Analysis/To Revise/Display All Planes");
731  setDesc("TBD");
732  setIcon(QIcon(":/images/DivisionPlane.png"));
733  }
734 
735  bool run()
736  {
737  Mesh *m = currentMesh();
738  Mesh *m2;
739  if(currentMesh() == mesh(0))
740  m2 = mesh(1);
741  else
742  m2 = mesh(0);
743  return run(m, m2);
744  }
745 
746  bool run(Mesh *m, Mesh *m2);
747 
748  };
749 
756  class AnalysisDivPlanes : public Process
757  {
758  public:
759  AnalysisDivPlanes(const Process& process) : Process(process)
760  {
761  setName("Mesh/Division Analysis/Old/MGX3D/Draw Division Planes");
762  setDesc("TBD");
763  setIcon(QIcon(":/images/DivisionPlane.png"));
764 
765  addParm("Flat Plane","Flat Plane","Yes",booleanChoice()); // 0
766  addParm("Shortest","Shortest","Yes",booleanChoice()); // 1
767  addParm("Shortest Best","Shortest Best","Yes",booleanChoice()); // 2
768  addParm("Shortest Wall","Shortest Wall","Yes",booleanChoice()); // 3
769  addParm("Shortest Best Betw Centr","Shortest Best Betw Centr","No",booleanChoice()); // 4
770  addParm("Shortest Best Rand Walk Betw","Shortest Best Rand Walk Betw","No",booleanChoice()); // 5
771  }
772 
773  bool run()
774  {
775  Mesh *m = currentMesh();
776  Mesh *m2;
777  if(currentMesh() == mesh(0))
778  m2 = mesh(1);
779  else
780  m2 = mesh(0);
781  return run(m, m2, stringToBool(parm("Flat Plane")), stringToBool(parm("Shortest")), stringToBool(parm("Shortest Best")), dat);
782  }
783 
784  bool run(Mesh *m, Mesh *m2, bool flat, bool shortest, bool shortestBest, DivisionAnalysisData &dat);
785 
786  };
787 
794  // class SaveCellGraph : public Process
795  // {
796  // public:
797  // SaveCellGraph(const Process& process) : Process(process)
798  // {
799  // setName("Mesh/Division Analysis/Tools/Cell Graph Save MGX3D");
800  // setDesc("Save the cell (neighborhood) graph to a file in the format cell1 cell2 sharedWallArea");
801  // setIcon(QIcon(":/images/DivisionPlane.png"));
802 
803  // addParm("filename","Name of file to be saved",""); // 0
804  // addParm("Min Shared Area","Min shared wall area to be considered a neighbor","0.001"); // 1
805  // }
806 
807  // bool initialize(QWidget* parent);
808 
809  // bool run()
810  // {
811  // Mesh *m = currentMesh();
812  // //Mesh *m2 = mesh(0);
813  // //if(currentMesh() == mesh(0))
814  // // m2 = mesh(1);
815  // return run(m, parm("filename"), parm("Min Shared Area").toDouble());
816  // }
817 
818  // bool run(Mesh *m, QString filename, double minArea);
819 
820  // };
821 
828  class JoinCellsMGX3D : public Process
829  {
830  public:
831  JoinCellsMGX3D(const Process& process) : Process(process)
832  {
833  setName("Mesh/Cell Mesh/Tools 3D/Merge Cells MGX3D");
834  setDesc("Join specified cells of a MGX3D mesh \n"
835  "Common triangles will be deleted.");
836  setIcon(QIcon(":/images/CHull.png"));
837 
838  addParm("Cell 1","Label of cell 1","1"); // 0
839  addParm("Cell 2","Label of cell 2","2"); // 1
840 
841  }
842 
843  bool run()
844  {
845  Mesh *m = currentMesh();
846  return run(m, parm("Cell 1").toInt(), parm("Cell 2").toInt());
847  }
848 
849  bool run(Mesh *m, int label1, int label2);
850 
851  };
852 
853 
860  class MergeCellsMGXM3D : public Process
861  {
862  public:
863  MergeCellsMGXM3D(const Process& process) : Process(process)
864  {
865  setName("Mesh/Cell Mesh/Tools 3D/Merge 3D Cells");
866  setDesc("Join specified cells of a standard 3D mesh \n"
867  "Common triangles will be deleted. \n"
868  "Cells can be specified by parameter or selection (if parameters are -1) \n"
869  "Note that depending on the mesh structure errors like holes or missing triangles might occur.");
870  setIcon(QIcon(":/images/CHull.png"));
871 
872  addParm("Cell 1","Label of cell 1","-1"); // 0
873  addParm("Cell 2","Label of cell 2","-1"); // 1
874  addParm("Force Merge","If No: Abort merge if unexpected errors occur.","No",booleanChoice()); // 2
875  }
876 
877  bool run()
878  {
879  Mesh *m = currentMesh();
880  return run(m, parm("Cell 1").toInt(), parm("Cell 2").toInt(), stringToBool(parm("Force Merge")));
881  }
882 
883  bool run(Mesh *m, int label1, int label2, bool forceMerge);
884 
885  };
886 
887 
888 // /**
889 // * \class JoinCellsMGX2D DivisionAnalysis.hpp <DivisionAnalysis.hpp>
890 // *
891 // * JoinCellsMGX2D
892 // * Join the cells
893 // */
894 // class JoinCellsMGX2D : public Process
895 // {
896 // public:
897 // JoinCellsMGX2D(const Process& process) : Process(process) { }
898 
899 // bool run(const QStringList &parms)
900 // {
901 // Mesh *m = currentMesh();
902 // return run(m, parms[0].toInt(), parms[1].toInt());
903 // }
904 // bool run(Mesh *m, int label1, int label2);
905 
906 // QStringList parmNames() const { return QStringList() << "Cell 1" << "Cell 2"; }
907 // QStringList parmDefaults() const { return QStringList() << "1" << "2"; }
908 // QStringList parmDescs() const { return QStringList() << "Label of cell 1" << "Label of cell 2"; }
909 // QString name() const { return "Mesh/Division Analysis/Test/Join Cells MGX2D"; }
910 // QString description() const { return "Join specified cells of a MGX2D mesh\n"
911 // "\n"
912 // "Common vertices will be deleted"; }
913 
914 // QIcon icon() const { return QIcon(":/images/CHull.png"); }
915 
916 // ParmChoiceMap parmChoice() const {
917 // ParmChoiceMap map;
918 // return map;
919 // }
920 
921 // };
922 
923 
930  class OutsideCellWall : public Process
931  {
932  public:
933  OutsideCellWall(const Process& process) : Process(process)
934  {
935  setName("Mesh/Division Analysis/ToTest/Outside Cell Wall");
936  setDesc("Creates a heat map of the ratio of the outside cell wall area to the total cell wall area");
937  setIcon(QIcon(":/images/CHull.png"));
938  }
939 
940  bool run()
941  {
942  Mesh *m = currentMesh();
943  return run(m);
944  }
945 
946  bool run(Mesh *m);
947 
948  };
949 
957  {
958  public:
959  CreateJunctionGraph(const Process& process) : Process(process)
960  {
961  setName("Mesh/Division Analysis/Old/MGX3D/Junction Graph Stack Display");
962  setDesc("Creates a junction graph from a stack (junctions are nodes and cell walls are edges)");
963  setIcon(QIcon(":/images/CHull.png"));
964 
965  addParm("Save to file","Save to file",""); // 0
966  addParm("Create graph in active mesh","Create graph in active mesh","Yes",booleanChoice()); // 1
967  addParm("Create mesh in inactive mesh","Create mesh in inactive mesh","No",booleanChoice()); // 2
968  }
969 
970  bool initialize(QWidget* parent);
971 
972  bool run()
973  {
974  Mesh *m = currentMesh();
975  Mesh *m2;
976  if(mesh(0) == currentMesh())
977  m2 = mesh(1);
978  else
979  m2 = mesh(0);
980  return run(m, m2, parm("Save to file"), stringToBool(parm("Create graph in active mesh")), stringToBool(parm("Create mesh in inactive mesh")));
981  }
982 
983  bool run(Mesh *m, Mesh *m2, QString filename, bool createGraph, bool createMesh);
984 
985  };
986 
994  {
995  public:
996  CreateJunctionGraphStack(const Process& process) : Process(process)
997  {
998  setName("Mesh/Division Analysis/Old/MGX3D/Junction Graph Stack Display");
999  setDesc("Creates a junction graph from a stack (junctions are nodes and cell walls are edges)");
1000  setIcon(QIcon(":/images/CHull.png"));
1001 
1002  addParm("Save to file","Save to file",""); // 0
1003  addParm("Create graph in active mesh","Create graph in active mesh","Yes",booleanChoice()); // 1
1004  addParm("Create mesh in inactive mesh","Create mesh in inactive mesh","No",booleanChoice()); // 2
1005  }
1006 
1007  bool initialize(QWidget* parent);
1008 
1009  bool run()
1010  {
1011 
1012  const Stack* stack = currentStack();
1013  Mesh *m = currentMesh();
1014  Mesh *m2;
1015  if(mesh(0) == currentMesh())
1016  m2 = mesh(1);
1017  else
1018  m2 = mesh(0);
1019  return run(stack, m, m2, parm("Save to file"), stringToBool(parm("Create graph in active mesh")), stringToBool(parm("Create mesh in inactive mesh")));
1020  }
1021 
1022  bool run(const Stack* s, Mesh *m, Mesh *m2, QString filename, bool createGraph, bool createMesh);
1023 
1024  };
1025 
1033  {
1034  public:
1035  OrganDivisionSimulation(const Process& process) : Process(process)
1036  {
1037  setName("Mesh/Division Analysis/Old/MGX3D/Organ Division Simulation");
1038  setDesc("Simulates a dividing tissue by performing a division plane testing and dividing \n"
1039  "according to the specified criteria of cells with a parent label > 0.");
1040  setIcon(QIcon(":/images/CHull.png"));
1041 
1042  addParm("Division Order Criteria","Criteria determining the order the cells divide","Neighbor Count Max", QStringList() << "Neighbor Count Max" << "Parent Label Min"); // 0
1043  addParm("Primary Criteria","Primary Criteria","Wall Area", QStringList() << "Wall Area" << "Volume Ratio" << "Betweenness Centrality" << "Betweenness Centrality (weighted)" << "Random Walk Betweenness" << "Random Walk Betweenness (weighted)" << "Neighbor Count"); // 1
1044  addParm("Direction Primary Criteria","Direction Primary Criteria","Min", QStringList() << "Min" << "Max" << "Random"); // 2
1045  addParm("Secondary Criteria","Secondary Criteria","None", QStringList() << "None" << "Wall Area" << "Volume Ratio" << "Betweenness Centrality" << "Betweenness Centrality (weighted)" << "Random Walk Betweenness" << "Random Walk Betweenness (weighted)" << "Neighbor Count"); // 3
1046  addParm("Direction Secondary Criteria","Direction Secondary Criteria","Random", QStringList() << "Min" << "Max" << "Random"); // 4
1047  addParm("Tolerance","Tolerance","0.01"); // 5
1048  addParm("Div Planes","Div Planes","1000"); // 6
1049  addParm("Perpendicular To Surface","Perpendicular To Surface","No",booleanChoice()); // 7
1050  addParm("Perpendicular To Low Degree Neighbor Wall","Perpendicular To Low Degree Neighbor Wall","No", QStringList() << "Yes (constrained)" << "Yes" << "No" << "No (but cutting wall)"); // 8
1051  addParm("Steps Center","Steps Center","0"); // 9
1052  addParm("Stepsize Center","Stepsize Center","0.0"); // 10
1053  }
1054 
1055  bool run()
1056  {
1057  Mesh *m = currentMesh();
1058  Mesh *m2;
1059  if(currentMesh() == mesh(0))
1060  m2 = mesh(1);
1061  else
1062  m2 = mesh(0);
1063 
1064  //bool perpendicularNeighbor =
1065  //bool perpendicularConstrained = parms[8] == "Yes (constrained)" ? true : false;
1066  //bool cuttingNeighborWall = parms[8] == "No (but cutting wall)" ? true : false;
1067 
1068  DivisionParms p;
1069 
1070  p.perpendicular = stringToBool(parm("Perpendicular To Surface"));
1071 
1072  p.perpendicularNeighbor = (parm("Perpendicular To Low Degree Neighbor Wall") == "No" or parm("Perpendicular To Low Degree Neighbor Wall") == "No (but cutting wall)") ? false : true;
1073  p.perpendicularConstrained = parm("Perpendicular To Low Degree Neighbor Wall") == "Yes (constrained)" ? true : false;
1074  p.cuttingNeighborWall = parm("Perpendicular To Low Degree Neighbor Wall") == "No (but cutting wall)" ? true : false;
1075 
1076  p.primary = parm("Primary Criteria");
1077  p.primaryDir = parm("Direction Primary Criteria");
1078 
1079  p.secondary = parm("Secondary Criteria");
1080  p.secondaryDir = parm("Direction Secondary Criteria");
1081 
1082  p.stepsCenter = parm("Steps Center").toInt();
1083  p.stepSizeCenter = parm("Stepsize Center").toDouble();
1084 
1085  p.planeNr = parm("Div Planes").toInt();
1086 
1087  //return run(m, m2, parms[0], parms[1], parms[3], parms[2], parms[4],
1088  // parms[5].toDouble(), parms[6].toInt(), stringToBool(parms[7]), p.perpendicularNeighbor,
1089  // parms[9].toInt(), parms[10].toDouble(), p.perpendicularConstrained, p.cuttingNeighborWall);
1090  return run(m, m2, parm("Division Order Criteria"), p, parm("Tolerance").toDouble());
1091  }
1092  //bool run(Mesh *m, Mesh *m2, QString order, QString primary, QString secondary, QString primaryDir, QString secondaryDir,
1093  // double tolerance, int planeNr, bool perpendicular, bool perpendicularNeighbor, int stepsCenter, double stepSizeCenter,
1094  // bool perpendicularConstrained, bool cuttingNeighborWall);
1095 
1096  bool run(Mesh *m, Mesh *m2, QString order, DivisionParms& p,
1097  double tolerance);
1098 
1099  };
1100 
1101 
1102 
1110  {
1111  public:
1112  DivisionPlaneHeat(const Process& process) : Process(process)
1113  {
1114  setName("Mesh/Z Old Processes/Division Analysis/Set Div Plane Heat");
1115  setDesc("Displays planes of the Division analysis processes");
1116  setIcon(QIcon(":/images/CHull.png"));
1117 
1118  addParm("Heat Map","Heat Map","Area", QStringList() << "None" << "Area" << "Angle to Actual" << "Volume Ratio"); // 0
1119  }
1120 
1121  bool run()
1122  {
1123  Mesh *m = currentMesh();
1124  return run(m, parm("Heat Map"));
1125  }
1126 
1127  bool run(Mesh *m, QString option);
1128 
1129  };
1130 
1138  {
1139  public:
1140  MeasureBetweenessCentrality(const Process& process) : Process(process)
1141  {
1142  setName("Mesh/Heat Map/Measures/Network/Betweenness Centrality");
1143  setDesc("Generate heat map of the betweenness centrality of the cells weighted by a property.");
1144  setIcon(QIcon(":/images/CHull.png"));
1145 
1146  addParm("Weights","Weights on the edges between cells. None means all weights are 1. Wall Length ist the length of the shared wall. Euclidean is the distance between the cell centers.","1 / Wall Area", QStringList() << "None" << "Wall Area" << "1 / Wall Area"); // 0
1147  }
1148  bool run()
1149  {
1150  Mesh *m = currentMesh();
1151  return run(m, m->labelHeat(), parm("Weights"));
1152  }
1153 
1154  bool run(Mesh *m, IntFloatAttr& heatMap, QString weightType);
1155 
1156  };
1157 
1165  {
1166  public:
1167  MeasureBetweenessCentrality3D(const Process& process) : Process(process)
1168  {
1169  setName("Mesh/Heat Map/Measures 3D/Network/Betweenness Centrality");
1170  setDesc("Generate heat map of the betweenness centrality of the 3D cells weighted by a property.");
1171  setIcon(QIcon(":/images/CHull.png"));
1172 
1173  addParm("Weights","Weights on the edges between cells. None means all weights are 1. Wall Length ist the length of the shared wall. Euclidean is the distance between the cell centers.","1 / Wall Area", QStringList() << "None" << "Wall Area" << "1 / Wall Area"); // 0
1174  }
1175 
1176  bool run()
1177  {
1178  Mesh *m = currentMesh();
1179  return run(m, m->labelHeat(), parm("Weights"));
1180  }
1181 
1182  bool run(Mesh *m, IntFloatAttr& heatMap, QString weightType);
1183 
1184  };
1185 
1186 
1194  {
1195  public:
1196  MeasureBetweenessCurrentFlow(const Process& process) : Process(process)
1197  {
1198  setName("Mesh/Heat Map/Measures/Network/Betweenness Current Flow");
1199  setDesc("Generate heat map of the current flow betweenness of the cells weighted by a property");
1200  setIcon(QIcon(":/images/CHull.png"));
1201 
1202  addParm("Weights","Weights on the edges between cells. None means all weights are 1. Wall Length ist the length of the shared wall. Euclidean is the distance between the cell centers.","1 / Wall Area", QStringList() << "None" << "Wall Area" << "1 / Wall Area"); // 0
1203  }
1204 
1205  bool run()
1206  {
1207  Mesh *m = currentMesh();
1208  return run(m, m->labelHeat(), parm("Weights"));
1209  }
1210 
1211  bool run(Mesh *m, IntFloatAttr& heatMap, QString weightType);
1212 
1213 
1214  };
1215 
1223  {
1224  public:
1226  {
1227  setName("Mesh/Heat Map/Measures 3D/Network/Betweenness Current Flow");
1228  setDesc("Generate heat map of the current flow betweenness of the cells weighted by a property");
1229  setIcon(QIcon(":/images/CHull.png"));
1230 
1231  addParm("Weights","Weights on the edges between cells. None means all weights are 1. Wall Length ist the length of the shared wall. Euclidean is the distance between the cell centers.","1 / Wall Area", QStringList() << "None" << "Wall Area" << "1 / Wall Area"); // 0
1232  }
1233 
1234  bool run()
1235  {
1236  Mesh *m = currentMesh();
1237  return run(m, m->labelHeat(), parm("Weights"));
1238  }
1239 
1240  bool run(Mesh *m, IntFloatAttr& heatMap, QString weightType);
1241 
1242  };
1243 
1251  {
1252  public:
1253  CreatePlaneFromSelectedVtxs(const Process& process) : Process(process)
1254  {
1255  setName("Mesh/Division Analysis/To Revise/Create Plane From Selected Vtxs");
1256  setDesc("Create Plane From Selected Vtxs");
1257  setIcon(QIcon(":/images/CHull.png"));
1258 
1259  addParm("Plane Size","Plane Size","15.0"); // 0
1260  addParm("Overwrite Other Mesh","Overwrite Other Mesh","No", booleanChoice()); // 0
1261  }
1262 
1263  bool run()
1264  {
1265  Mesh *m = currentMesh();
1266  Mesh *m2 = otherMesh();
1267  return run(m, m2, parm("Plane Size").toDouble(), stringToBool(parm("Overwrite Other Mesh")));
1268  }
1269 
1270  bool run(Mesh *m, Mesh *m2, double size, bool overwrite);
1271 
1272  };
1273 
1280  class AngleTwoPlanes : public Process
1281  {
1282  public:
1283  AngleTwoPlanes(const Process& process) : Process(process)
1284  {
1285  setName("Mesh/Division Analysis/To Revise/Angle Two Selected Planes");
1286  setDesc("Angle Two Selected Planes");
1287  setIcon(QIcon(":/images/CHull.png"));
1288 
1289  }
1290 
1291  bool run()
1292  {
1293  Mesh *m = currentMesh();
1294  return run(m);
1295  }
1296 
1297  bool run(Mesh *m);
1298 
1299  };
1300 
1301 
1308  class ExportPlaneData : public Process
1309  {
1310  public:
1311  ExportPlaneData(const Process& process) : Process(process)
1312  {
1313  setName("Mesh/Division Analysis/Export Plane Data");
1314  setDesc("Export Division Plane Data to a csv file");
1315  setIcon(QIcon(":/images/CHull.png"));
1316 
1317  addParm("Filename","Filename","");
1318  addParm("Export","Export","Actual Planes", QStringList() << "Actual Planes" << "Simulated Planes" << "Filtered Planes");
1319  }
1320 
1321  bool initialize(QWidget* parent);
1322 
1323  bool run()
1324  {
1325  Mesh *m = currentMesh();
1326  return run(m, parm("Filename"), parm("Export"));
1327  }
1328 
1329  bool run(Mesh *m, QString filename, QString mode);
1330 
1331  };
1332 
1340  {
1341  public:
1342  FlatDivisionPlane3D(const Process& process) : Process(process)
1343  {
1344  setName("Mesh/Division Analysis/Analysis 3D/Division Plane Approximation");
1345  setDesc("Display a planar approximation plane of a wall between two cells");
1346  setIcon(QIcon(":/images/DivisionPlane.png"));
1347 
1348  addParm("Display Plane","Overwrite the non-active mesh and display the plane","Yes",booleanChoice());
1349  addParm("Plane Size","Plane Size","10.0");
1350  addParm("Reset Mesh","Reset Mesh","No",booleanChoice());
1351 
1352  }
1353 
1354  bool run()
1355  {
1356  Mesh *m = currentMesh();
1357  Mesh *m2;
1358  if(currentMesh() == mesh(0))
1359  m2 = mesh(1);
1360  else
1361  m2 = mesh(0);
1362  return run(m, m2, stringToBool(parm("Display Plane")), parm("Plane Size").toDouble(), stringToBool(parm("Reset Mesh")));
1363  }
1364  bool run(Mesh *m, Mesh *m2, bool display, double planeSize, bool resetMesh, int label = 0);
1365 
1366  };
1367 
1368 
1376  {
1377  public:
1378  TestDivisionPlanes3D(const Process& process) : Process(process)
1379  {
1380  setName("Mesh/Division Analysis/Analysis 3D/Division Analysis");
1381  setDesc("Division Testing for 3D cells");
1382  setIcon(QIcon(":/images/CHull.png"));
1383 
1384  addParm("Nr of Planes","Approx number of planes to be tested","1000");
1385  addParm("Steps Center Displacement","Displacement steps from the cell center","0");
1386  addParm("Stepsize Center Displacement","Displacement step size from the cell center","0.0");
1387  addParm("Division Point","Division Point", "Centroid",QStringList() << "Centroid" << "Center Actual" << "Custom Vertex");
1388  //addParm("Draw Plane","Draw Plane","Yes",booleanChoice());
1389 
1390  }
1391 
1392  bool run()
1393  {
1394  std::cout << "Div analysis s1" << std::endl;
1395  Mesh *m = currentMesh();
1396  Mesh *m2;
1397  if(currentMesh() == mesh(0))
1398  m2 = mesh(1);
1399  else
1400  m2 = mesh(0);
1401  return run(m, m2, parm("Nr of Planes").toInt(), parm("Steps Center Displacement").toInt(), parm("Stepsize Center Displacement").toDouble(),
1402  parm("Division Point"), -1);
1403  }
1404  bool run(Mesh *m, Mesh *m2, int divPlanes, int centerDisplSteps, double centerDisplStepSize, QString divCenter, int parentLabel);
1405 
1406  };
1407 
1415  {
1416  public:
1417  DivisionAnalysisMulti3D(const Process& process) : Process(process)
1418  {
1419  setName("Mesh/Division Analysis/Analysis 3D/Division Analysis Multi");
1420  setDesc("Multi cell analysis of divisions in 3D meshes");
1421  setIcon(QIcon(":/images/CHull.png"));
1422 
1423  addParm("Test Single","Test Single","No",booleanChoice());
1424  addParm("Test Double","Test Double","Yes",booleanChoice());
1425  }
1426 
1427  bool run()
1428  {
1429  std::cout << "Div analysis Multi1" << std::endl;
1430  Mesh *m = currentMesh();
1431  Mesh *m2;
1432  if(currentMesh() == mesh(0))
1433  m2 = mesh(1);
1434  else
1435  m2 = mesh(0);
1436 
1437  return run(m, m2, stringToBool(parm("Test Single")), stringToBool(parm("Test Double")));
1438  }
1439  bool run(Mesh *m, Mesh *m2, bool singleCells, bool doubleCells);
1440 
1441  };
1442 
1443 }
1444 
1445 #endif
mgx::MergeCellsMGXM3D::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:877
mgx::MeasureBetweenessCentrality::MeasureBetweenessCentrality
MeasureBetweenessCentrality(const Process &process)
Definition: DivisionAnalysis.hpp:1140
mgx::CreateJunctionGraph
Definition: DivisionAnalysis.hpp:956
mgx::FlatDivisionPlane3D
Definition: DivisionAnalysis.hpp:1339
mgx::SetDivisionPoint::SetDivisionPoint
SetDivisionPoint(const Process &process)
Definition: DivisionAnalysis.hpp:619
mgx::AngleTwoPlanes::AngleTwoPlanes
AngleTwoPlanes(const Process &process)
Definition: DivisionAnalysis.hpp:1283
mgx::RootDivData::dirLong
CellDivision dirLong
Definition: DivisionAnalysis.hpp:17
mgx::DisplayAllPlanes
Definition: DivisionAnalysis.hpp:725
mgx::TestDivisionPlanes::testDivisionPlanesFunc
bool testDivisionPlanesFunc(Mesh *mesh, Mesh *mesh2, int label, bool displayResult, QString filename, bool constWeight, bool dijk, int percGPU, bool calcBetw, bool overwrite, QString cellCenterSelVertex, DivisionParms &par, Point3d divisionPoint=Point3d(0, 0, 0))
mgx::RootDivData::dirRad
CellDivision dirRad
Definition: DivisionAnalysis.hpp:17
mgx::RootDivData::coordLong
double coordLong
Definition: DivisionAnalysis.hpp:16
mgx::ExportPlaneData
Definition: DivisionAnalysis.hpp:1308
mgx::DisplayOptimalPlanes::DisplayOptimalPlanes
DisplayOptimalPlanes(const Process &process)
Definition: DivisionAnalysis.hpp:645
mgx::ProcessParms::addParm
bool addParm(const QString &parmName, const QString &desc, const QString &def, const QStringList &choices=QStringList())
Add a parameter to the list.
mgx::MeasureBetweenessCurrentFlow3D::MeasureBetweenessCurrentFlow3D
MeasureBetweenessCurrentFlow3D(const Process &process)
Definition: DivisionAnalysis.hpp:1225
Process.hpp
mgx::DisplayOptimalPlanes
Definition: DivisionAnalysis.hpp:642
mgx::FlatDivisionPlane::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:469
DivisionAnalysisData.hpp
mgx::DivisionParms
Definition: DivisionAnalysis.hpp:26
mgx::AnalysisDivPlanes::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:773
mgx::TestDivisionPlanes3D::TestDivisionPlanes3D
TestDivisionPlanes3D(const Process &process)
Definition: DivisionAnalysis.hpp:1378
mgx::RootDivData::label1
int label1
Definition: DivisionAnalysis.hpp:15
mgx::Process::otherMesh
Mesh * otherMesh()
Returns the other mesh (i.e.
mgx::DisplayCellGraph2D
Definition: DivisionAnalysis.hpp:118
mgx::DivisionAnalysisMulti3DOld::DivisionAnalysisMulti3DOld
DivisionAnalysisMulti3DOld(const Process &process)
Definition: DivisionAnalysis.hpp:383
mgx::TestDivisionPlanesCellAtlas
Definition: DivisionAnalysis.hpp:306
mgx::OutsideCellWall::OutsideCellWall
OutsideCellWall(const Process &process)
Definition: DivisionAnalysis.hpp:933
mgx::FlatDivisionPlane
Definition: DivisionAnalysis.hpp:455
mgx::DisplayCellGraph3D
Definition: DivisionAnalysis.hpp:151
mgx::DisplayCellGraph2D::DisplayCellGraph2D
DisplayCellGraph2D(const Process &process)
Definition: DivisionAnalysis.hpp:121
mgx::DivisionAnalysisMulti3DOld::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:396
mgx::DisplayAllPlanes::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:735
mgx::CreateJunctionGraphStack::CreateJunctionGraphStack
CreateJunctionGraphStack(const Process &process)
Definition: DivisionAnalysis.hpp:996
mgx::DivisionParms::secondaryDir
QString secondaryDir
Definition: DivisionAnalysis.hpp:31
mgx::DisplayOptimalPlanesSimple
Definition: DivisionAnalysis.hpp:686
mgx::AngleTwoPlanes
Definition: DivisionAnalysis.hpp:1280
mgx::MeasureBetweenessCentrality3D::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:1176
mgx::ExportPlaneData::initialize
bool initialize(QWidget *parent)
Initialize the process.
mgx::MeasureBetweenessCurrentFlow3D::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:1234
mgx::DisplayOptimalPlanesSimple::DisplayOptimalPlanesSimple
DisplayOptimalPlanesSimple(const Process &process)
Definition: DivisionAnalysis.hpp:689
mgx::DivisionParms::perpendicularNeighbor
bool perpendicularNeighbor
Definition: DivisionAnalysis.hpp:33
mgx::Stack::currentStore
const Store * currentStore() const
Returns the current store.
Definition: Stack.hpp:120
mgx::Process::p
PrivateProcess * p
Definition: Process.hpp:748
mgx::ExportPlaneData::ExportPlaneData
ExportPlaneData(const Process &process)
Definition: DivisionAnalysis.hpp:1311
mgx::ProcessParms::booleanChoice
static QStringList booleanChoice()
Helper function that provides a list of choices for a boolean argument.
Definition: ProcessParms.hpp:83
mgx::ActualPlaneStack::ActualPlaneStack
ActualPlaneStack(const Process &process)
Definition: DivisionAnalysis.hpp:495
mgx::TestDivisionPlanes3D
Definition: DivisionAnalysis.hpp:1375
mgx::CreateJunctionGraph::CreateJunctionGraph
CreateJunctionGraph(const Process &process)
Definition: DivisionAnalysis.hpp:959
mgx::Stack
Definition: Stack.hpp:33
mgx::FlatDivisionPlane::FlatDivisionPlane
FlatDivisionPlane(const Process &process)
Definition: DivisionAnalysis.hpp:458
mgx::DisplayCellGraph::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:97
mgx::CellDivision
Definition: CellDivision.hpp:176
mgx::CreateJunctionGraphStack::initialize
bool initialize(QWidget *parent)
Initialize the process.
mgx::RootDivData
Definition: DivisionAnalysis.hpp:13
mgx::DisplayAllPlanes::DisplayAllPlanes
DisplayAllPlanes(const Process &process)
Definition: DivisionAnalysis.hpp:728
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::MeasureBetweenessCurrentFlow3D
Definition: DivisionAnalysis.hpp:1222
mgx::FlatDivisionPlane3D::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:1354
mgx::RootDivisionAnalysis::RootDivisionAnalysis
RootDivisionAnalysis(const Process &process)
Definition: DivisionAnalysis.hpp:347
mgx::DivisionAnalysisMulti3D::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:1427
mgx::RootDivData::dirReal
CellDivision dirReal
Definition: DivisionAnalysis.hpp:17
mgx::MeasureBetweenessCentrality::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:1148
mgx::VtxVtx
std::pair< vertex, vertex > VtxVtx
Definition: DivisionAnalysis.hpp:22
mgx::RootDivData::label2
int label2
Definition: DivisionAnalysis.hpp:15
mgx::OutsideCellWall
Definition: DivisionAnalysis.hpp:930
mgx::DivideCell3DMGX3D
Definition: DivisionAnalysis.hpp:185
mgx::ProcessParms::setIcon
bool setIcon(const QIcon &icon)
Set the icon.
CellDivision.hpp
mgx::TestDivisionPlanes::datTest
DivisionAnalysisData datTest
Definition: DivisionAnalysis.hpp:247
mgx::RootDivisionAnalysis::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:358
mgx::AnalyzeSurface::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:546
mgx::DisplayCellGraph3D::DisplayCellGraph3D
DisplayCellGraph3D(const Process &process)
Definition: DivisionAnalysis.hpp:154
mgx::MeasureBetweenessCurrentFlow::MeasureBetweenessCurrentFlow
MeasureBetweenessCurrentFlow(const Process &process)
Definition: DivisionAnalysis.hpp:1196
mgx::DivisionPlaneHeat::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:1121
mgx::Process
Definition: Process.hpp:219
mgx::OrganDivisionSimulation::OrganDivisionSimulation
OrganDivisionSimulation(const Process &process)
Definition: DivisionAnalysis.hpp:1035
mgx::FlatDivisionPlane3D::FlatDivisionPlane3D
FlatDivisionPlane3D(const Process &process)
Definition: DivisionAnalysis.hpp:1342
mgx::DisplayCellGraph3D::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:164
mgx::stringToBool
mgx_EXPORT bool stringToBool(const QString &string)
Helper function converting a string into a boolean.
mgx::ExportPlaneData::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:1323
mgx::TestDivisionPlanesCellAtlas::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:321
mgx::Point3d
Vector< 3, double > Point3d
Definition: Geometry.hpp:56
mgx::DivisionParms::perpNeighborPlanes
std::set< Point3d > perpNeighborPlanes
Definition: DivisionAnalysis.hpp:39
mgx::DivideCell3DMGX3D::DivideCell3DMGX3D
DivideCell3DMGX3D(const Process &process)
Definition: DivisionAnalysis.hpp:188
mgx::DivisionAnalysisMulti3D
Definition: DivisionAnalysis.hpp:1414
mgx::MeasureBetweenessCentrality3D
Definition: DivisionAnalysis.hpp:1164
mgx::DivisionParms::perpendicular
bool perpendicular
Definition: DivisionAnalysis.hpp:33
mgx::AngleTwoPlanes::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:1291
mgx::DivisionAnalysisData
Definition: DivisionAnalysisData.hpp:46
mgx::OrganDivisionSimulation
Definition: DivisionAnalysis.hpp:1032
mgx::CreateJunctionGraphStack
Definition: DivisionAnalysis.hpp:993
mgx::DivisionPlaneHeat::DivisionPlaneHeat
DivisionPlaneHeat(const Process &process)
Definition: DivisionAnalysis.hpp:1112
mgx::MeasureBetweenessCentrality
Definition: DivisionAnalysis.hpp:1137
mgx::AnalyzeSurface
Definition: DivisionAnalysis.hpp:532
mgx::ActualPlaneStack::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:506
mgx::CreateJunctionGraph::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:972
mgx::ProcessParms::setDesc
bool setDesc(const QString &description)
Set the description.
mgx::DivisionParms::perpendicularConstrained
bool perpendicularConstrained
Definition: DivisionAnalysis.hpp:33
mgx::DivisionParms::stepSizeCenter
double stepSizeCenter
Definition: DivisionAnalysis.hpp:36
mgx::SetDivisionPoint
Definition: DivisionAnalysis.hpp:616
mgx::Mesh::labelHeat
IntFloatAttr & labelHeat()
Reference to map of heat data by label.
Definition: Mesh.hpp:901
mgx::TestDivisionPlanesCellAtlas::TestDivisionPlanesCellAtlas
TestDivisionPlanesCellAtlas(const Process &process)
Definition: DivisionAnalysis.hpp:309
mgx::dat
DivisionAnalysisData dat
Definition: DivisionAnalysis.hpp:24
mgx::Mesh
Definition: Mesh.hpp:54
mgx::TestDivisionPlanes3D::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:1392
mgx::DivisionParms::primary
QString primary
Definition: DivisionAnalysis.hpp:30
mgx::Vector< 3, double >
mgx::RootDivData::dirCirc
CellDivision dirCirc
Definition: DivisionAnalysis.hpp:17
mgx::DivisionPlaneHeat
Definition: DivisionAnalysis.hpp:1109
mgx::MeasureBetweenessCurrentFlow::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:1205
mgx::CellDivisionAttr
Definition: CellDivision.hpp:36
mgx::DivisionParms::primaryDir
QString primaryDir
Definition: DivisionAnalysis.hpp:31
mgx::CreateJunctionGraph::initialize
bool initialize(QWidget *parent)
Initialize the process.
mgx::RootDivisionAnalysis
Definition: DivisionAnalysis.hpp:344
mgx::OutsideCellWall::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:940
mgx::DisplayCellGraph2D::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:131
mgx::TestDivisionPlanes
Definition: DivisionAnalysis.hpp:221
mgx::CreateJunctionGraphStack::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:1009
mgx::TestDivisionPlanes::TestDivisionPlanes
TestDivisionPlanes(const Process &process)
Definition: DivisionAnalysis.hpp:224
mgx::AnalyzeSurface::AnalyzeSurface
AnalyzeSurface(const Process &process)
Definition: DivisionAnalysis.hpp:535
mgx::TestDivisionPlanes::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:249
mgx::Process::stack
Stack * stack(int i)
Returns the ith stack, or 0 if there is no such stack.
mgx::JoinCellsMGX3D::JoinCellsMGX3D
JoinCellsMGX3D(const Process &process)
Definition: DivisionAnalysis.hpp:831
mgx::DisplayCellGraph
Definition: DivisionAnalysis.hpp:84
mgx::Process::mesh
Mesh * mesh(int i)
Returns the ith mesh.
mgx::JoinCellsMGX3D
Definition: DivisionAnalysis.hpp:828
mgx::DivisionAnalysisMulti3DOld
Definition: DivisionAnalysis.hpp:380
mgx::MergeCellsMGXM3D
Definition: DivisionAnalysis.hpp:860
mgx::CreatePlaneFromSelectedVtxs::CreatePlaneFromSelectedVtxs
CreatePlaneFromSelectedVtxs(const Process &process)
Definition: DivisionAnalysis.hpp:1253
mgx::RootDivData::coordCirc
double coordCirc
Definition: DivisionAnalysis.hpp:16
mgx::DisplayOptimalPlanesSimple::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:703
mgx::Process::currentStack
Stack * currentStack()
Returns the current stack (i.e.
mgx::DivisionParms::secondary
QString secondary
Definition: DivisionAnalysis.hpp:30
mgx::ProcessParms::setName
bool setName(const QString &name)
Set the name.
mgx::DivisionAnalysisMulti3D::DivisionAnalysisMulti3D
DivisionAnalysisMulti3D(const Process &process)
Definition: DivisionAnalysis.hpp:1417
mgx::SetDivisionPoint::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:626
mgx::MeasureBetweenessCentrality3D::MeasureBetweenessCentrality3D
MeasureBetweenessCentrality3D(const Process &process)
Definition: DivisionAnalysis.hpp:1167
mgx::DivideCell3DMGX3D::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:204
mgx::DisplayCellGraph::DisplayCellGraph
DisplayCellGraph(const Process &process)
Definition: DivisionAnalysis.hpp:87
mgx::DivisionParms::stepsCenter
int stepsCenter
Definition: DivisionAnalysis.hpp:35
mgx::JoinCellsMGX3D::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:843
mgx::MeasureBetweenessCurrentFlow
Definition: DivisionAnalysis.hpp:1193
mgx::ActualPlaneStack
Definition: DivisionAnalysis.hpp:492
mgx::OrganDivisionSimulation::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:1055
mgx::CreatePlaneFromSelectedVtxs
Definition: DivisionAnalysis.hpp:1250
mgx::ProcessParms::parm
QString parm(const QString &name) const
Get a single parameter value by name.
mgx::RootDivData::coordRad
double coordRad
Definition: DivisionAnalysis.hpp:16
mgx::Process::currentMesh
Mesh * currentMesh()
Returns the current mesh (i.e.
mgx::DivisionParms::perpNeighborWalls
std::unordered_map< Point3d, std::vector< Point3d > > perpNeighborWalls
Definition: DivisionAnalysis.hpp:40
mgx::MergeCellsMGXM3D::MergeCellsMGXM3D
MergeCellsMGXM3D(const Process &process)
Definition: DivisionAnalysis.hpp:863
mgx::DivisionParms::planeNr
int planeNr
Definition: DivisionAnalysis.hpp:37
mgx::DivisionParms::cuttingNeighborWall
bool cuttingNeighborWall
Definition: DivisionAnalysis.hpp:33
mgx::AttrMap< int, float >
mgx::CreatePlaneFromSelectedVtxs::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:1263
mgx::AnalysisDivPlanes::AnalysisDivPlanes
AnalysisDivPlanes(const Process &process)
Definition: DivisionAnalysis.hpp:759
mgx::AnalysisDivPlanes
Definition: DivisionAnalysis.hpp:756
mgx::DisplayOptimalPlanes::run
bool run()
Runs the process.
Definition: DivisionAnalysis.hpp:663
mgx::Store
Definition: Store.hpp:33
DivisionAnalysisProcesses.hpp