MorphoGraphX  2.0-1-227
CellAtlasUtils.hpp
Go to the documentation of this file.
1 #ifndef CellAtlasUtils_H
2 #define CellAtlasUtils_H
3 
4 #include <Process.hpp> // for vvGraph, forall, ...
5 #include <GraphUtils.hpp> // for neighborhoodGraph
6 
7 #include <ImageData.hpp>
8 #include <Triangulate.hpp> // calcNearestPointOnBezierLine
9 
10 using namespace std;
11 
12 // CellAtlasUtils contains typedefs and class-independent helper-functions for the CellAtlas AddOn
13 namespace mgx
14 {
15 
16 typedef std::map<int, std::vector<vertex> > labelVertexMap;
17 
18 typedef std::pair<int, std::vector<vertex> > labelVertexVecPair;
19 
20 //typedef std::map<int, Point3d> labelPosMap;
21 //typedef std::map<int, double> labelDataMap;
22 //typedef std::map<int, bool> labelBoolMap;
23 
24 // typedef Vector<3, vertex> tri;
25 // typedef std::vector<tri> triVector;
26 
27 typedef std::pair<int, int> IntInt;
28 //typedef std::map<int, triVector> labelTriMap;
29 
30 typedef std::map<int,std::map<int,double> > cellMorphLandscape;
31 
32 typedef std::map <int, std::vector<int> > intToVec;
33 
34 typedef std::map<Point2i, double> P2iDMap;
35 typedef std::pair<Point2i, double> P2iDPair;
36 typedef std::pair<IntInt, double> IntIntDouPair;
37 
38 
39 
49  //bool neighborhoodGraphLocal(const vvGraph& S, double tolerance, RootCellProcessing& cellAtlasData);
50  bool neighborhoodGraphLocal(const vvGraph& S, double tolerance, std::map<int, double>& cellWallArea, std::map<IntInt, double>& wallArea, std::map<int, double>& outsideWallArea);
51 
60  int findSelectedLabel(const vvGraph& S);
61 
72  bool findTwoSelectedLabels(const vvGraph& S, int& label1, int& label2);
73 
74 
86  bool pointInCone(Point3d axisVec, Point3d& coneTop, Point3d& coneBase, double coneAngle, Point3d& pointToTest);
87 
97  double gauss1D(double x, double muX, double sigmaX);
98 
99 
100 
101 
102 
103  // TODO documentation
104 
105 
106 
107  double calcCircumferential(Point3d dirRadRef, Point3d dirLongRef, Point3d cellCenter, Point3d cellOnLong);
108 
109  Point3d inPrimCoord(double radiant, Point3d dirRadRef, Point3d dirLongRef);
110 
111 
112 
113  // finds min and max value of a map
114  void findMinMax(std::map<int,double>& map, double& min, double& max);
115 
116 
117 
118 
119 void differentialOfBezierGrid(std::vector<std::vector<Point3d> >& bezierGrid, Point2i& p, Point3d& diffU, Point3d& diffV);
120 
121 
122  double cartesianToOrganCoordsLong(Point3d cartesianCoords, std::map<int, Point3d>& bMap, Point3d& closestPoint);
123 
124 
125 
126 }
127 
128 #endif
mgx::labelVertexVecPair
std::pair< int, std::vector< vertex > > labelVertexVecPair
Definition: CellAtlasUtils.hpp:18
Process.hpp
mgx::findSelectedLabel
int findSelectedLabel(const vvGraph &S)
find ONE selected vertex in a vvGraph and return its label return 0 if nothing is selected
mgx::P2iDPair
std::pair< Point2i, double > P2iDPair
Definition: CellAtlasUtils.hpp:35
ImageData.hpp
mgx::IntInt
std::pair< int, int > IntInt
Definition: GraphAlgorithms.hpp:27
mgx::differentialOfBezierGrid
void differentialOfBezierGrid(std::vector< std::vector< Point3d > > &bezierGrid, Point2i &p, Point3d &diffU, Point3d &diffV)
mgx::findMinMax
void findMinMax(std::map< int, double > &map, double &min, double &max)
GraphUtils.hpp
mgx::neighborhoodGraphLocal
bool neighborhoodGraphLocal(const vvGraph &S, double tolerance, std::map< int, double > &cellWallArea, std::map< IntInt, double > &wallArea, std::map< int, double > &outsideWallArea)
calculates the neighborhood graph, return data structure for total cell wall area and shared wall are...
mgx::P2iDMap
std::map< Point2i, double > P2iDMap
Definition: CellAtlasUtils.hpp:34
mgx::findTwoSelectedLabels
bool findTwoSelectedLabels(const vvGraph &S, int &label1, int &label2)
find selected vertices in a vvGraph and return their TWO (different) labels return false if less than...
mgx::inPrimCoord
Point3d inPrimCoord(double radiant, Point3d dirRadRef, Point3d dirLongRef)
mgx::intToVec
std::map< int, std::vector< int > > intToVec
Definition: CellAtlasUtils.hpp:32
mgx
Distributed matrix library.
Definition: Assert.hpp:26
mgx::labelVertexMap
std::map< int, std::vector< vertex > > labelVertexMap
Definition: CellAtlasUtils.hpp:16
Triangulate.hpp
mgx::calcCircumferential
double calcCircumferential(Point3d dirRadRef, Point3d dirLongRef, Point3d cellCenter, Point3d cellOnLong)
mgx::max
T CU_HOST_DEVICE max(const T a, const T b)
Definition: Util.hpp:34
mgx::gauss1D
double gauss1D(double x, double muX, double sigmaX)
returns the value of a 1D gaussian function
mgx::cartesianToOrganCoordsLong
double cartesianToOrganCoordsLong(Point3d cartesianCoords, std::map< int, Point3d > &bMap, Point3d &closestPoint)
mgx::IntIntDouPair
std::pair< IntInt, double > IntIntDouPair
Definition: GraphUtils.hpp:22
mgx::Vector
Namespace containing all the utility classes.
Definition: Vector.hpp:48
mgx::min
CU_HOST_DEVICE T min(const T a, const T b)
Definition: Util.hpp:26
mgx::VVGraph< VertexData, EdgeData >
mgx::cellMorphLandscape
std::map< int, std::map< int, double > > cellMorphLandscape
Definition: CellAtlasUtils.hpp:30
mgx::pointInCone
bool pointInCone(Point3d axisVec, Point3d &coneTop, Point3d &coneBase, double coneAngle, Point3d &pointToTest)
return true if a point is inside a cone
mgx::map
CU_HOST_DEVICE Vector< dim, T > map(const T &(*fct)(const T1 &), const Vector< dim, T1 > &v)
Definition: Vector.hpp:1380