MorphoGraphX  2.0-1-227
RootCellProcessing.hpp
Go to the documentation of this file.
1 //
2 // This file is part of 3DCellAtlas.
3 // Copyright (C) 2015 George W. Bassel and collaborators.
4 //
5 // If you use 3DCellAtlas in your work, please cite:
6 // http://dx.doi.org/10.1105/tpc.15.00175
7 //
8 // 3DCellAtlas is an AddOn for MorphoGraphX - http://www.MorphoGraphX.org
9 // Copyright (C) 2012-2015 Richard S. Smith and collaborators.
10 //
11 // 3DCellAtlas and MorphoGraphX are free software, and are licensed under under the terms of the
12 // GNU General (GPL) Public License version 2.0, http://www.gnu.org/licenses.
13 //
14 #ifndef RootCellProcessing_H
15 #define RootCellProcessing_H
16 
17 #include "Geometry.hpp"
18 #include "Mesh.hpp"
19 
20 #include <CellAtlasUtils.hpp>
21 
22 using namespace std;
23 
24 namespace mgx
25 {
26  // for the stack projection
28  {
29  std::map<int, Point3d> bez, diffBez, bMapRadRef;
31 
33 
34  bool operator==(const primDataStructure &other) const
35  {
36  if(bez == other.bez and diffBez == other.diffBez and bMapRadRef == other.bMapRadRef and
37  meshTris == other.meshTris)
38  return true;
39  return false;
40  }
41  };
42 
43  // data structure for attribute map
45  {
46 
47  // simple data structures
49 
50  bool twoParts;
51 
52  bool analyzed, cellTypesAssigned;
53 
54  int labelFirstCell, labelLastRootCapCell;
55 
56  int primCounter; // for meristem, counter on how many primordia there are
57 
58  //GUI options (not functional yet)
59  int part1ChosenX, part2ChosenX, part1ChosenY, part2ChosenY;
60  double sigma1, sigma2;
61  std::vector<std::pair<int,Point2i> > clusters1, clusters2;
62 
63  // complicated data structures
64 
65  //map from cell label -> index in CellAtlasData
66  std::map<int,int> labelIdxMap;
67 
68  // map from [label1,label2] -> shared wall area
69  std::map<IntInt, double> wallArea;
70 
71  std::map<int, Point3d> bez, diffBezInterp;
72 
73  //double bezLength;
74 
75  //std::map<int, Point3d> bez, diffBez, bMapRadRef;
76  //std::map<int, Point3d> diffBezInterp, bezInterp;
77 
79 
80  bool operator==(const CellAtlasConfig &other) const
81  {
82  if(cellAtlasType == other.cellAtlasType and twoParts == other.twoParts and analyzed == other.analyzed and
83  cellTypesAssigned == other.cellTypesAssigned and labelFirstCell == other.labelFirstCell and
84  labelLastRootCapCell == other.labelLastRootCapCell and primCounter == other.primCounter and
85  part1ChosenX == other.part1ChosenX and part2ChosenX == other.part2ChosenX and
86  part1ChosenY == other.part1ChosenY and part2ChosenY == other.part2ChosenY and
87  sigma1 == other.sigma1 and sigma2 == other.sigma2 and clusters1 == other.clusters1 and
88  clusters2 == other.clusters2 and labelIdxMap == other.labelIdxMap and wallArea == other.wallArea and
89  bez == other.bez /*and bezLength == other.bezLength*/ and diffBezInterp == other.diffBezInterp and prim1 == other.prim1 and prim2 == other.prim2)
90  return true;
91  return false;
92  }
93  };
94 
95  // data structure for attribute map
97  {
98  int cellLabel, parentLabel;
99 
100  bool isColumella, isPart1, isPart2;
101 
103 
105 
106  Point3d dirLong, dirCirc, dirRad;
107 
108  double coordLong, coordLongUM, coordLongMinUM, coordLongMaxUM, coordCirc, coordRad, coordRadAbs;
109  double volume, wallArea, nrNeighbors;
110  double sizeLong, sizeCirc, sizeRad;
112 
113  double outsideWallArea, outsideWallAreaPercent;
114 
116 
118  bool badCell;
119 
121 
122  bool operator==(const CellAtlasData &other) const
123  {
124  if(cellLabel == other.cellLabel and parentLabel == other.parentLabel
125  and isColumella == other.isColumella and isPart1 == other.isPart1
126  and isPart2 == other.isPart2 and centroid == other.centroid
127  and signalCentroid == other.signalCentroid and nearestSurfacePoint == other.nearestSurfacePoint
128  and dirLong == other.dirLong and dirCirc == other.dirCirc and dirRad == other.dirRad
129  and coordLong == other.coordLong and coordLongUM == other.coordLongUM
130  and coordCirc == other.coordCirc and coordLongMinUM == other.coordLongMinUM and coordLongMaxUM == other.coordLongMaxUM
131  and coordRad == other.coordRad and coordRadAbs == other.coordRadAbs
132  and volume == other.volume and wallArea == other.wallArea and nrNeighbors == other.nrNeighbors and sizeLong == other.sizeLong
133  and sizeCirc == other.sizeCirc and sizeRad == other.sizeRad
134  and associatedCorticalCell == other.associatedCorticalCell
135  and outsideWallArea == other.outsideWallArea
136  and outsideWallAreaPercent == other.outsideWallAreaPercent
137  and correctedLengths == other.correctedLengths and mislabelled == other.mislabelled
138  and badCell == other.badCell)
139  return true;
140  return false;
141  }
142  };
143 
144  // Read/write attr map
145  bool inline readAttr(CellAtlasData &m, const QByteArray &ba, size_t &pos)
146  {
147  return readChar((char *)&m, sizeof(CellAtlasData), ba, pos);
148  }
149  bool inline writeAttr(const CellAtlasData &m, QByteArray &ba)
150  {
151  return writeChar((char *)&m, sizeof(CellAtlasData), ba);
152  }
153 
154  // Read/write attr map
155  bool inline readAttr(CellAtlasConfig &data, const QByteArray &ba, size_t &pos)
156  {
157  readAttr(data.cellAtlasType, ba, pos);
158 
159  readAttr(data.twoParts, ba, pos);
160 
161  readAttr(data.analyzed, ba, pos);
162  readAttr(data.cellTypesAssigned, ba, pos);
163 
164  readAttr(data.labelFirstCell, ba, pos);
165  readAttr(data.labelLastRootCapCell, ba, pos);
166 
167  //readAttr(data.bezLength, ba, pos);
168 
169  readAttr(data.primCounter, ba, pos);
170 
171  readAttr(data.part1ChosenX, ba, pos);
172  readAttr(data.part2ChosenX, ba, pos);
173  readAttr(data.part1ChosenY, ba, pos);
174  readAttr(data.part2ChosenY, ba, pos);
175 
176  uint sz;
177  readAttr(sz, ba, pos);
178  for(uint i = 0; i<sz; i++){
179  int key;
180  int value;
181  readAttr(key, ba, pos);
182  readAttr(value, ba, pos);
183  data.labelIdxMap[key] = value;
184  }
185 
186  readAttr(sz, ba, pos);
187  for(uint i = 0; i<sz; i++){
188  IntInt key;
189  double value = 0;
190  readAttr(key, ba, pos);
191  readAttr(value, ba, pos);
192  data.wallArea[key] = value;
193  }
194 
195  readAttr(sz, ba, pos);
196  for(uint i = 0; i<sz; i++){
197  int key;
198  Point3d value;
199  readAttr(key, ba, pos);
200  readAttr(value, ba, pos);
201  data.bez[key] = value;
202  }
203 
204  readAttr(sz, ba, pos);
205  for(uint i = 0; i<sz; i++){
206  int key;
207  Point3d value;
208  readAttr(key, ba, pos);
209  readAttr(value, ba, pos);
210  data.diffBezInterp[key] = value;
211  }
212  //return readChar((char *)&data, sizeof(CellAtlasConfig), ba, pos);
213  return true;
214  }
215  bool inline writeAttr(const CellAtlasConfig &data, QByteArray &ba)
216  {
217 
218  writeChar((char *)&data.cellAtlasType, sizeof(int), ba);
219 
220  writeChar((char *)&data.twoParts, sizeof(bool), ba);
221 
222  writeChar((char *)&data.analyzed, sizeof(bool), ba);
223  writeChar((char *)&data.cellTypesAssigned, sizeof(bool), ba);
224 
225  writeChar((char *)&data.labelFirstCell, sizeof(int), ba);
226  writeChar((char *)&data.labelLastRootCapCell, sizeof(int), ba);
227 
228  //writeChar((char *)&data.bezLength, sizeof(double), ba);
229 
230  writeChar((char *)&data.primCounter, sizeof(int), ba);
231 
232  writeChar((char *)&data.part1ChosenX, sizeof(int), ba);
233  writeChar((char *)&data.part2ChosenX, sizeof(int), ba);
234  writeChar((char *)&data.part1ChosenY, sizeof(int), ba);
235  writeChar((char *)&data.part2ChosenY, sizeof(int), ba);
236 
237  //writeAttr(data.labelIdxMap, ba);
238  uint sz;
239 
240  sz = data.labelIdxMap.size();
241  writeChar((char *)&sz, sizeof(uint), ba);
242  for(std::map<int,int>::const_iterator it = data.labelIdxMap.begin(); it!=data.labelIdxMap.end(); it++){
243  writeAttr(it->first, ba);
244  writeAttr(it->second, ba);
245  }
246 
247  //writeAttr(data.wallArea, ba);
248 
249  sz = data.wallArea.size();
250  writeChar((char *)&sz, sizeof(uint), ba);
251  for(std::map<IntInt,double>::const_iterator it = data.wallArea.begin(); it!=data.wallArea.end(); it++){
252  writeAttr(it->first, ba);
253  writeAttr(it->second, ba);
254  }
255 
256  //writeAttr(data.bez, ba);
257 
258  sz = data.bez.size();
259  writeChar((char *)&sz, sizeof(uint), ba);
260  for(std::map<int,Point3d>::const_iterator it = data.bez.begin(); it!=data.bez.end(); it++){
261  writeAttr(it->first, ba);
262  writeAttr(it->second, ba);
263  }
264 
265  sz = data.diffBezInterp.size();
266  writeChar((char *)&sz, sizeof(uint), ba);
267  for(std::map<int,Point3d>::const_iterator it = data.diffBezInterp.begin(); it!=data.diffBezInterp.end(); it++){
268  writeAttr(it->first, ba);
269  writeAttr(it->second, ba);
270  }
271 
272  return true;
273  }
274 
277 
278 
279 
280  // structure that saves general root cell information
282  {
284 
286 
287  int rootType; // 1 = embryo, 2 = hypocotyl, 3 = root
288 
289  // first and last root cap
290  int labelFirstCell, labelLastRootCapCell;
291 
293 
294  // vector with all labels
295  std::vector<int> uniqueLabels;
296 
297  int numCells; // number of cells
298 
299  //intToVec cellConnections;
300  //intToVec cellWallAreas;
301  //P2iDMap
302  std::map<IntInt, double> wallArea;
303  std::map<int,double> cellWallArea;
304  std::map<int,double> outsideWallArea, nrNeighbors;
305 
306 
307  std::map<int,double> correctedLengths;
308 
309  std::map<int, Point3d> bez, diffBez, bMapRadRef;
310  std::map<int, Point3d> diffBezInterp, bezInterp;
311 
313 
314  std::map<int,bool> mislabelled;
315 
316  double bezLength;
317 
318  // currently not needed
319  // map of: label -> all vertices
320  //labelVertexMap lvMap;
321 
322  // currently not needed
323  // map of: label -> all unique triangles
324  //labelTriMap cellTriangles;
325 
327 
328  // currently not needed
329  // label -> center of cell
330  //labelPosMap cellCentroids;
331 
332  // label -> volume of cell
333  std::map<int,double> cellVolumes;
334 
335  // label -> boolean that is true when cell is bad (too small or no ray intercept)
336  std::map<int, bool> cellBad;
337 
338  std::map<int,double> radialDis;
339  std::map<int,double> scaledRadialDis;
340  std::map<int,double> azimuthal;
341 
342  std::map<int, Point3d> cellCentroids;
343 
344  std::map<int, Point3d> signalCentroids;
345 
346  std::map<int, Point3d> nearestSurfacePoint;
347 
348  // label -> location on Bezier (0...1)
349  std::map<int,double> arclengths;
350  std::map<int,double> arclengthsUM;
351  std::map<int,double> arclengthsMinUM;
352  std::map<int,double> arclengthsMaxUM;
353 
354  // label -> radial/longitudinal/circumferential vector
355  std::map<int, Point3d> dirRad, dirLong, dirCirc;
356 
357  // label -> radial/longitudinal/circumferential cell length
358  std::map<int,double> lengthRad, lengthLong, lengthCirc;
359 
360  };
361 
362  // structure that saves heatmap specific data
364  {
365  // labeldata maps for the generation of the landscape
366  std::map<int, double> x, y;
367  int chosenY;
368  int chosenX;
369 
370  int gridSize;
371  double sigma;
374 
375  // label -> boolean mainBody, rootCap, columella
376  //std::map<int, bool> cells;
377  std::set<int> cells;
378  int cellCounter; // cell counter columella
379 
380  // landscape function of 2 characteristics with gaussian bell for each cell
382  double high;
383 
384  // location of all cells within the heatmap
386  std::map<Point2d,int> pointsLabel;
387  std::map<int,Point2d> pointsPos;
388 
389  std::map<int,Point2d> maximaHeatMapAll;
390  std::map<int,Point2d> maximaHeatMapSelected;
392 
393  // map that relates each cell to the nearest maximum
394  std::map<int, double> nearestMaximumOfCell;
395 
397 
400 
401  std::map<int, bool> preselect;
402 
403  std::map<int, double> cellLabel;
404 
405  heatMapDataStructure() : maximaHeatMapSelectedCounter(0) {}
406  };
407 
409  {
410 
411  public:
412 
416 
417  int numCells;
418  std::map<int,int> labelMap, parentsMap;
419 
421 
422 
423  void createHeatMapNoCellAtlas(AttrMap<int, double>& dataX, AttrMap<int, double>& dataY);
424  void associateNearestCluster(heatMapDataStructure& body);
425 
426  RootCellProcessing(): pointersSet(false), outlierDetection(true) {}
427 
428  void setDataPointers(CellAtlasAttr *cellAtlasAttr, CellAtlasConfigAttr *cellAtlasConfigAttr){
429  data = cellAtlasAttr;
430  config = cellAtlasConfigAttr;
431  pointersSet = true;
432  numCells = (*data).size();
433  std::map<int,int> newLabelMap;
434  for(int i = 0; i<numCells; i++){
435  int currentLabel = (*data)[i].cellLabel;
436  newLabelMap[i] = currentLabel;
437  }
438  labelMap = newLabelMap;
439  }
440 
441  //void setHeatMaps();
442 
443  std::map<int, double> getMapFromAttributes(QString mapName);
444 
445  void initHeatMapDataStructure(heatMapDataStructure& body, double sig, int& chosenX, int& chosenY);
446 
447 
448  // double interpolateArrayIndex(double value, double min, double max, double newRange);
449 
450  // finds min, max, avg and std of the cells, needed for scaling the heatmap size
451  void findHeatStatistics(heatMapDataStructure& body);
452 
453  // generates the heatmap (=cellMorphLandscape) of the cell set (=body)
454  cellMorphLandscape generateCellMorphologyLandscape(heatMapDataStructure& body);
455 
456  // find all local maxima in a cellMorphLandscape (=heatmap) and save their positions
457  std::map<int,Point2d> findMaxima(cellMorphLandscape& landsc);
458 
459  // label all cells according to a label-to-maximum and a maximum-to-referenceMaximum map
460  std::map<int,double> labelCells(std::map<int,double>& labelToMax, std::map<int,double>& maxToRef,
461  heatMapDataStructure& body);
462 
463  // reverse the arclengths if the root has the wrong orientation
464  void correctDirections();
465 
466  // assign the root regions according the selected cells and arclengths
467  void assignRootRegions();
468 
469  // relate each cell in the root to a maxima in the heatmap by following the steepest
470  // gradient upwards until a maximum is reached
471  std::map<int,double> relateCellstoMaxima(heatMapDataStructure& body, cellMorphLandscape& landsc,
472  std::map<int,double>& x, std::map<int,double>& y, std::map<int,Point2d> maxima);
473 
474  // calculates the mininmum distance to a maximum from a given maximum
475  double minDisToMax(std::map<int,Point2d>& maxima, std::map<int,double>& usedMax, int currentIdx);
476 
477  // function to assign cluster automatically by selecting the highest maxima
478  void findAutomaticCluster(heatMapDataStructure& body, int nrOfClusters);
479 
480  void setAutoCluster(int nrCluster, bool ismainBody);
481 
482  // deletes a cluster from the current selected ones
483  void delIdx(heatMapDataStructure& body, int idx);
484 
485  // big procedure to find the correct labels, calls earlier functions
486  std::map<int,double> clusterCells(heatMapDataStructure& body);
487 
488  // sets parameters that come from MGX
489  void setParameter(bool outputType, int label1, int label2);
490 
491  // finds highest heatmap value for scaling the colours in the heatmap
492  double findHighMax(heatMapDataStructure& body);
493 
494  // sets the X coord of the heatmap
495  void setHeatmap(heatMapDataStructure& body, QString optionGUI, int& chosenOption, bool x);
496 
497  // big procedure to generate the heatmap and label the cells
498  void geometryBasedLabelling();
499 
500  // reset preselection
501  void resetHeat(heatMapDataStructure& body);
502 
503  // take all currently selected clusters, look for nearest maximum and handle
504  // them as preselected and remove them from the heatmap
505  void preselectCells(heatMapDataStructure& body);
506 
507  // label columella cells
508  // cells with small wall area to neighbors become root cap
509  // remaining cells: small become vasc, big col
510  //void reassignColumella(int labelRootCap, int labelCol);//, int labelVasc)
511 
512 
513  void assignColumella(int labelRootCap, int labelCol, double rat_val, double sca_val);
514 
515 
516  // assign cortical cells subroutine to create the correctedlengths and to dffind
517  // the min and max of the arclengths
518  void assignCortCellsGetMinMax(int labelCort, double& minS, double& maxS);
519 
520  // assign the cortical cell number to each cell in the root
521  void assignCortCells(int labelCort, std::vector<double>& sSmooth, std::map<int, Point3d>& bMapS, int length);
522 
523 
525 
529  //labelDataMap cellLabel;
530 
532 
533  };
534 
535  void writeAttrMaps(RootCellProcessing rcp, CellAtlasAttr *cellAtlasAttr, CellAtlasConfigAttr *cellAtlasConfigAttr);
536  /*
537  // if in 2D mode only key 0 and 1 are used
538  struct ManualCluster{
539 
540  std::map<int, double> val;
541  int label;
542 
543  };
544  */
545  /*
546  double realToImageCoord(Point2d minMax, double value, double gridSize);
547  double imageToRealCoord(Point2d minMax, double value, double gridSize);
548  Point2d minMaxFromMap(AttrMap<int,double>& inputMap, std::set<int>& keys);
549 
550  // TODO refactor
551  // new class just to take care of the heatmap
552  class ClusterMap{
553 
554  public:
555 
556  // cell data points
557  std::set<int> cellLabels;
558  std::vector<AttrMap<int, double> > cellFeatures;
559  std::map<QString, int> attrIdxMap;
560 
561  std::vector<Point2d> minMaxV;
562 
563  // min and max values for the display
564  Point2d xMinMax;
565  Point2d yMinMax;
566 
567  bool customMinMax;
568 
569  bool mode2D;
570  std::pair<int, int> attrIdx2D;
571 
572  double heatMax;
573 
574  bool showParentLabels;
575 
576  // manually specified clusters
577  std::vector<ManualCluster> cluster; // each cluster is a double (pos) defined by the attrIdx
578 
579  int activeCluster;
580 
581  std::vector<Point2d> maximaHeatMap;
582  std::map<int,int> cellLabelMaximaIdxMap;
583  std::map<int,int> maximaIdxManualClusterIdxMap;
584 
585  QString selectedX, selectedY, selectedHeat;
586 
587  // gaussian clusters
588  double sigma;
589 
590  // size of the GUI image
591  bool largeDots;
592 
593  int gridSize;
594  int gridFactor;
595  // view array (data of the GUI image)
596  std::vector<std::vector<double> > viewData;
597 
598  // the current QImage
599  QImage clusterMapImage;
600 
601  std::map<int, int> parentLabels;
602  std::map<std::pair<int, int>, int> imageLabelMap;
603 
604 
605  // input values
606  void addCellFeature(QString featureName, AttrMap<int, double>& newFeature) {
607  if(cellFeatures.size() == 0){
608  typedef std::pair<int, double> IntDoubleP;
609  std::set<int> allLabels;
610  forall(IntDoubleP p, newFeature){
611  allLabels.insert(p.first);
612  }
613  cellLabels = allLabels;
614 
615  }
616  std::cout << "in add " << featureName.toLocal8Bit().constData() << std::endl;
617  if(attrIdxMap.find(featureName) == attrIdxMap.end()){
618  std::cout << "added " << std::endl;
619  cellFeatures.push_back(newFeature);
620  attrIdxMap[featureName] = cellFeatures.size();
621  Point2d minMax = minMaxFromMap(cellFeatures[attrIdxMap[featureName]-1], cellLabels);
622  minMaxV.push_back(minMax);
623  }
624 
625  }
626  double scaledValue(double value, int measureIdx)
627  {
628  double diff = minMaxV[measureIdx].y()-minMaxV[measureIdx].x();
629  if(diff == 0) return 0;
630  return ((value - minMaxV[measureIdx].x())/diff);
631  }
632 
633  void resetCellFeatures() {
634  std::vector<AttrMap<int, double> > cellFeaturesNew;
635  std::vector<Point2d> minMaxVNew;
636 
637  std::map<QString, int> attrIdxMapNew;
638  cellFeatures = cellFeaturesNew;
639  attrIdxMap = attrIdxMapNew;
640  minMaxV = minMaxVNew;
641  }
642 
643  void setActiveMeasures(QString measure1, QString measure2, QString measureHeat);
644 
645  // create the cell display
646  void createCellView();
647 
648  // create the heatmap display
649  void createHeatMap2D();
650 
651  QImage createImage(bool heatMapMode); // in heatmapsmode: draw local maxima crosses and scale automatically
652 
653  // set cluster postion
654  void addCluster(QString measure1, QString measure2, double value1, double value2);
655  void updateCluster(int clusterIdx, QString measure, double value, bool xCoord = true);
656  bool nearbyManualCluster(QString measure1, QString measure2, Point2d pos, int& maxIdx);
657  void resetClusters(){
658  std::vector<ManualCluster> newClusters;
659  cluster = newClusters;
660  }
661 
662  void setParentsCellView();
663  void setParentsHeatMapView();
664 
665  void findMaximaHeatMap();
666  void relateCellsToMaxima();
667 
668  // initialize the data array with the right size (gridSize)
669  void initDataArray();
670 
671  void calcHeatMax();
672 
673  // return the attr value for a specific label and measure
674  double getValue(QString measure, int label);
675 
676 
677  double getClusterValue(QString measure, int clusterIdx);
678 
679  };
680  */
681 
682 
683 }
684 #endif
mgx::rootDataStructure::rootType
int rootType
Definition: RootCellProcessing.hpp:287
mgx::CellAtlasData::coordLongMaxUM
double coordLongMaxUM
Definition: RootCellProcessing.hpp:108
mgx::CellAtlasData::correctedLengths
double correctedLengths
Definition: RootCellProcessing.hpp:115
mgx::RootCellProcessing
Definition: RootCellProcessing.hpp:408
mgx::primDataStructure::diffBez
std::map< int, Point3d > diffBez
Definition: RootCellProcessing.hpp:29
mgx::uint
unsigned int uint
Definition: Geometry.hpp:41
mgx::CellAtlasData::isPart1
bool isPart1
Definition: RootCellProcessing.hpp:100
mgx::CellAtlasConfig::labelFirstCell
int labelFirstCell
Definition: RootCellProcessing.hpp:54
mgx::CellAtlasData::parentLabel
int parentLabel
Definition: RootCellProcessing.hpp:98
mgx::heatMapDataStructure::maximaHeatMapSelectedLabel
IntIntMap maximaHeatMapSelectedLabel
Definition: RootCellProcessing.hpp:391
mgx::heatMapDataStructure::numberOfClusters
int numberOfClusters
Definition: RootCellProcessing.hpp:398
mgx::rootDataStructure
Definition: RootCellProcessing.hpp:281
mgx::CellAtlasConfig::labelLastRootCapCell
int labelLastRootCapCell
Definition: RootCellProcessing.hpp:54
mgx::RootCellProcessing::radicle
heatMapDataStructure radicle
Definition: RootCellProcessing.hpp:527
mgx::CellAtlasData::nearestSurfacePoint
Point3d nearestSurfacePoint
Definition: RootCellProcessing.hpp:104
mgx::heatMapDataStructure::y
std::map< int, double > y
Definition: RootCellProcessing.hpp:366
mgx::CellAtlasConfig::twoParts
bool twoParts
Definition: RootCellProcessing.hpp:50
mgx::IntInt
std::pair< int, int > IntInt
Definition: GraphAlgorithms.hpp:27
mgx::RootCellProcessing::prim2
primDataStructure prim2
Definition: RootCellProcessing.hpp:531
mgx::heatMapDataStructure::chosenY
int chosenY
Definition: RootCellProcessing.hpp:367
mgx::CellAtlasData::CellAtlasData
CellAtlasData()
Definition: RootCellProcessing.hpp:120
mgx::CellAtlasConfig::wallArea
std::map< IntInt, double > wallArea
Definition: RootCellProcessing.hpp:69
mgx::AttrMap::size
size_t size() const
Definition: Attributes.hpp:802
mgx::CellAtlasData::sizeCirc
double sizeCirc
Definition: RootCellProcessing.hpp:110
mgx::CellAtlasConfig::part1ChosenY
int part1ChosenY
Definition: RootCellProcessing.hpp:59
mgx::primDataStructure::operator==
bool operator==(const primDataStructure &other) const
Definition: RootCellProcessing.hpp:34
mgx::CellAtlasData::coordLong
double coordLong
Definition: RootCellProcessing.hpp:108
mgx::CellAtlasData::isPart2
bool isPart2
Definition: RootCellProcessing.hpp:100
mgx::CellAtlasData::volume
double volume
Definition: RootCellProcessing.hpp:109
mgx::rootDataStructure::associatedCorticalCell
IntIntMap associatedCorticalCell
Definition: RootCellProcessing.hpp:312
mgx::CellAtlasData::dirRad
Point3d dirRad
Definition: RootCellProcessing.hpp:106
mgx::heatMapDataStructure::heatMap
cellMorphLandscape heatMap
Definition: RootCellProcessing.hpp:381
mgx::rootDataStructure::diffBez
std::map< int, Point3d > diffBez
Definition: RootCellProcessing.hpp:309
mgx::rootDataStructure::arclengthsMinUM
std::map< int, double > arclengthsMinUM
Definition: RootCellProcessing.hpp:351
mgx::CellAtlasConfig::sigma2
double sigma2
Definition: RootCellProcessing.hpp:60
mgx::CellAtlasData::badCell
bool badCell
Definition: RootCellProcessing.hpp:118
mgx::heatMapDataStructure::chosenX
int chosenX
Definition: RootCellProcessing.hpp:368
mgx::CellAtlasData::dirLong
Point3d dirLong
Definition: RootCellProcessing.hpp:106
mgx::CellAtlasConfig::prim1
primDataStructure prim1
Definition: RootCellProcessing.hpp:78
mgx::heatMapDataStructure::heatMapMinMax
Point4d heatMapMinMax
Definition: RootCellProcessing.hpp:372
mgx::heatMapDataStructure::cells
std::set< int > cells
Definition: RootCellProcessing.hpp:377
mgx::CellAtlasData::coordRad
double coordRad
Definition: RootCellProcessing.hpp:108
mgx::CellAtlasConfig::operator==
bool operator==(const CellAtlasConfig &other) const
Definition: RootCellProcessing.hpp:80
mgx::heatMapDataStructure::points
cellMorphLandscape points
Definition: RootCellProcessing.hpp:385
mgx::heatMapDataStructure::preselect
std::map< int, bool > preselect
Definition: RootCellProcessing.hpp:401
Mesh.hpp
Geometry.hpp
mgx::heatMapDataStructure::gridSize
int gridSize
Definition: RootCellProcessing.hpp:370
mgx::RootCellProcessing::outlierDetection
bool outlierDetection
Definition: RootCellProcessing.hpp:420
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::heatMapDataStructure::heatMapStatistics
Point4d heatMapStatistics
Definition: RootCellProcessing.hpp:373
mgx::CellAtlasData::wallArea
double wallArea
Definition: RootCellProcessing.hpp:109
mgx::primDataStructure
Definition: RootCellProcessing.hpp:27
mgx::CellAtlasConfig::part2ChosenX
int part2ChosenX
Definition: RootCellProcessing.hpp:59
mgx::RootCellProcessing::rootData
rootDataStructure rootData
Definition: RootCellProcessing.hpp:524
mgx::rootDataStructure::arclengthsMaxUM
std::map< int, double > arclengthsMaxUM
Definition: RootCellProcessing.hpp:352
mgx::rootDataStructure::numCells
int numCells
Definition: RootCellProcessing.hpp:297
mgx::CellAtlasData::signalCentroid
Point3d signalCentroid
Definition: RootCellProcessing.hpp:102
mgx::heatMapDataStructure::cellLabel
std::map< int, double > cellLabel
Definition: RootCellProcessing.hpp:403
mgx::CellAtlasData::dirCirc
Point3d dirCirc
Definition: RootCellProcessing.hpp:106
mgx::CellAtlasConfig::primCounter
int primCounter
Definition: RootCellProcessing.hpp:56
mgx::rootDataStructure::scaledRadialDis
std::map< int, double > scaledRadialDis
Definition: RootCellProcessing.hpp:339
mgx::heatMapDataStructure::activatedMaximum
int activatedMaximum
Definition: RootCellProcessing.hpp:399
mgx::CellAtlasData::coordRadAbs
double coordRadAbs
Definition: RootCellProcessing.hpp:108
mgx::rootDataStructure::cellVolumes
std::map< int, double > cellVolumes
Definition: RootCellProcessing.hpp:333
mgx::rootDataStructure::dirRad
std::map< int, Point3d > dirRad
Definition: RootCellProcessing.hpp:355
mgx::heatMapDataStructure::pointsLabel
std::map< Point2d, int > pointsLabel
Definition: RootCellProcessing.hpp:386
mgx::CellAtlasConfig
Definition: RootCellProcessing.hpp:44
mgx::rootDataStructure::nearestSurfacePoint
std::map< int, Point3d > nearestSurfacePoint
Definition: RootCellProcessing.hpp:346
mgx::primDataStructure::bMapRadRef
std::map< int, Point3d > bMapRadRef
Definition: RootCellProcessing.hpp:29
mgx::triVector
std::vector< Triangle > triVector
Definition: GraphUtils.hpp:23
mgx::CellAtlasConfig::clusters2
std::vector< std::pair< int, Point2i > > clusters2
Definition: RootCellProcessing.hpp:61
mgx::CellAtlasData::coordLongUM
double coordLongUM
Definition: RootCellProcessing.hpp:108
mgx::rootDataStructure::azimuthal
std::map< int, double > azimuthal
Definition: RootCellProcessing.hpp:340
mgx::primDataStructure::bez
std::map< int, Point3d > bez
Definition: RootCellProcessing.hpp:29
mgx::CellAtlasData::coordLongMinUM
double coordLongMinUM
Definition: RootCellProcessing.hpp:108
mgx::rootDataStructure::radialDis
std::map< int, double > radialDis
Definition: RootCellProcessing.hpp:338
mgx::CellAtlasConfig::diffBezInterp
std::map< int, Point3d > diffBezInterp
Definition: RootCellProcessing.hpp:71
mgx::rootDataStructure::wallArea
std::map< IntInt, double > wallArea
Definition: RootCellProcessing.hpp:302
mgx::heatMapDataStructure::nearestMaximumOfCell
std::map< int, double > nearestMaximumOfCell
Definition: RootCellProcessing.hpp:394
mgx::heatMapDataStructure::maximaHeatMapSelected
std::map< int, Point2d > maximaHeatMapSelected
Definition: RootCellProcessing.hpp:390
mgx::heatMapDataStructure::high
double high
Definition: RootCellProcessing.hpp:382
mgx::CellAtlasConfig::sigma1
double sigma1
Definition: RootCellProcessing.hpp:60
mgx::rootDataStructure::cellBad
std::map< int, bool > cellBad
Definition: RootCellProcessing.hpp:336
mgx::CellAtlasConfig::part1ChosenX
int part1ChosenX
Definition: RootCellProcessing.hpp:59
mgx::CellAtlasConfig::part2ChosenY
int part2ChosenY
Definition: RootCellProcessing.hpp:59
mgx::CellAtlasConfigAttr
AttrMap< int, CellAtlasConfig > CellAtlasConfigAttr
Definition: RootCellProcessing.hpp:276
mgx::rootDataStructure::arclengths
std::map< int, double > arclengths
Definition: RootCellProcessing.hpp:349
mgx::RootCellProcessing::config
CellAtlasConfigAttr * config
Definition: RootCellProcessing.hpp:414
mgx::heatMapDataStructure::maximaHeatMapSelectedCounter
int maximaHeatMapSelectedCounter
Definition: RootCellProcessing.hpp:396
mgx::CellAtlasData::associatedCorticalCell
int associatedCorticalCell
Definition: RootCellProcessing.hpp:111
mgx::RootCellProcessing::setDataPointers
void setDataPointers(CellAtlasAttr *cellAtlasAttr, CellAtlasConfigAttr *cellAtlasConfigAttr)
Definition: RootCellProcessing.hpp:428
mgx::CellAtlasConfig::labelIdxMap
std::map< int, int > labelIdxMap
Definition: RootCellProcessing.hpp:66
mgx::writeAttrMaps
void writeAttrMaps(RootCellProcessing rcp, CellAtlasAttr *cellAtlasAttr, CellAtlasConfigAttr *cellAtlasConfigAttr)
mgx::CellAtlasConfig::bez
std::map< int, Point3d > bez
Definition: RootCellProcessing.hpp:71
mgx::CellAtlasData::cellLabel
int cellLabel
Definition: RootCellProcessing.hpp:98
mgx::CellAtlasData::sizeRad
double sizeRad
Definition: RootCellProcessing.hpp:110
mgx::rootDataStructure::uniqueLabels
std::vector< int > uniqueLabels
Definition: RootCellProcessing.hpp:295
mgx::rootDataStructure::correctedLengths
std::map< int, double > correctedLengths
Definition: RootCellProcessing.hpp:307
mgx::rootDataStructure::hasRadicle
bool hasRadicle
Definition: RootCellProcessing.hpp:285
mgx::readAttr
bool readAttr(CellAtlasConfig &data, const QByteArray &ba, size_t &pos)
Definition: RootCellProcessing.hpp:155
mgx::rootDataStructure::diffBezInterp
std::map< int, Point3d > diffBezInterp
Definition: RootCellProcessing.hpp:310
mgx::heatMapDataStructure::cellCounter
int cellCounter
Definition: RootCellProcessing.hpp:378
mgx::CellAtlasAttr
AttrMap< int, CellAtlasData > CellAtlasAttr
Definition: RootCellProcessing.hpp:275
mgx::rootDataStructure::bezLength
double bezLength
Definition: RootCellProcessing.hpp:316
mgx::CellAtlasConfig::prim2
primDataStructure prim2
Definition: RootCellProcessing.hpp:78
mgx::RootCellProcessing::RootCellProcessing
RootCellProcessing()
Definition: RootCellProcessing.hpp:426
mgx::CellAtlasConfig::cellTypesAssigned
bool cellTypesAssigned
Definition: RootCellProcessing.hpp:52
mgx::rootDataStructure::labelLastRootCapCell
int labelLastRootCapCell
Definition: RootCellProcessing.hpp:290
mgx::heatMapDataStructure
Definition: RootCellProcessing.hpp:363
mgx::RootCellProcessing::parentsMap
std::map< int, int > parentsMap
Definition: RootCellProcessing.hpp:418
mgx::CellAtlasData
Definition: RootCellProcessing.hpp:96
mgx::Vector< 3, double >
mgx::RootCellProcessing::numCells
int numCells
Definition: RootCellProcessing.hpp:417
mgx::rootDataStructure::signalCentroids
std::map< int, Point3d > signalCentroids
Definition: RootCellProcessing.hpp:344
mgx::heatMapDataStructure::heatMapDataStructure
heatMapDataStructure()
Definition: RootCellProcessing.hpp:405
mgx::rootDataStructure::outsideWallArea
std::map< int, double > outsideWallArea
Definition: RootCellProcessing.hpp:304
mgx::CellAtlasConfig::cellAtlasType
int cellAtlasType
Definition: RootCellProcessing.hpp:48
mgx::rootDataStructure::mislabelled
std::map< int, bool > mislabelled
Definition: RootCellProcessing.hpp:314
CellAtlasUtils.hpp
mgx::CellAtlasConfig::analyzed
bool analyzed
Definition: RootCellProcessing.hpp:52
mgx::heatMapDataStructure::pointsPos
std::map< int, Point2d > pointsPos
Definition: RootCellProcessing.hpp:387
mgx::CellAtlasConfig::clusters1
std::vector< std::pair< int, Point2i > > clusters1
Definition: RootCellProcessing.hpp:61
mgx::rootDataStructure::primCounter
int primCounter
Definition: RootCellProcessing.hpp:292
mgx::CellAtlasData::mislabelled
bool mislabelled
Definition: RootCellProcessing.hpp:117
mgx::primDataStructure::meshTris
triVector meshTris
Definition: RootCellProcessing.hpp:30
mgx::RootCellProcessing::columella
heatMapDataStructure columella
Definition: RootCellProcessing.hpp:528
mgx::CellAtlasData::operator==
bool operator==(const CellAtlasData &other) const
Definition: RootCellProcessing.hpp:122
mgx::rootDataStructure::lengthRad
std::map< int, double > lengthRad
Definition: RootCellProcessing.hpp:358
mgx::CellAtlasData::nrNeighbors
double nrNeighbors
Definition: RootCellProcessing.hpp:109
mgx::RootCellProcessing::mainBody
heatMapDataStructure mainBody
Definition: RootCellProcessing.hpp:526
mgx::CellAtlasData::centroid
Point3d centroid
Definition: RootCellProcessing.hpp:102
mgx::heatMapDataStructure::maximaHeatMapAll
std::map< int, Point2d > maximaHeatMapAll
Definition: RootCellProcessing.hpp:389
mgx::primDataStructure::primDataStructure
primDataStructure()
Definition: RootCellProcessing.hpp:32
mgx::RootCellProcessing::pointersSet
bool pointersSet
Definition: RootCellProcessing.hpp:415
mgx::heatMapDataStructure::sigma
double sigma
Definition: RootCellProcessing.hpp:371
mgx::CellAtlasData::coordCirc
double coordCirc
Definition: RootCellProcessing.hpp:108
mgx::rootDataStructure::cellCentroids
std::map< int, Point3d > cellCentroids
Definition: RootCellProcessing.hpp:342
mgx::cellMorphLandscape
std::map< int, std::map< int, double > > cellMorphLandscape
Definition: CellAtlasUtils.hpp:30
mgx::CellAtlasData::sizeLong
double sizeLong
Definition: RootCellProcessing.hpp:110
mgx::CellAtlasData::outsideWallArea
double outsideWallArea
Definition: RootCellProcessing.hpp:113
mgx::CellAtlasData::isColumella
bool isColumella
Definition: RootCellProcessing.hpp:100
mgx::rootDataStructure::arclengthsUM
std::map< int, double > arclengthsUM
Definition: RootCellProcessing.hpp:350
mgx::AttrMap
Attribute map wraps std::map.
Definition: Attributes.hpp:686
mgx::rootDataStructure::cellWallArea
std::map< int, double > cellWallArea
Definition: RootCellProcessing.hpp:303
mgx::CellAtlasData::outsideWallAreaPercent
double outsideWallAreaPercent
Definition: RootCellProcessing.hpp:113
mgx::IntIntMap
std::unordered_map< int, int > IntIntMap
Map of an integer to another one.
Definition: Types.hpp:64
mgx::writeAttr
bool writeAttr(const CellAtlasConfig &data, QByteArray &ba)
Definition: RootCellProcessing.hpp:215
mgx::RootCellProcessing::data
CellAtlasAttr * data
Definition: RootCellProcessing.hpp:413