cortical_surface  5.0.5
subjectdata.h
Go to the documentation of this file.
1 #ifndef SUBJECTDATA_H_
2 #define SUBJECTDATA_H_
3 
4 #include <aims/getopt/getopt2.h>
5 #include <aims/mesh/texture.h>
6 #include <aims/mesh/curv.h>
7 #include <aims/data/data_g.h>
9 
10 
11 
14 };
15 
17  public:
18 
19  std::string meshPath;
20  std::string texPath;
21  std::string latPath;
22  std::string lonPath;
23  std::string graphPath;
24 
25  SubjectPaths ( ) { meshPath = ""; texPath = ""; latPath = ""; lonPath = ""; }
27  meshPath = s.meshPath;
28  texPath = s.texPath;
29  latPath = s.latPath;
30  lonPath = s.lonPath;
31  }
32  SubjectPaths ( std::string _meshPath, std::string _texPath, std::string _latPath = "", std::string _lonPath = "" )
33  { meshPath = _meshPath; texPath = _texPath; latPath = _latPath; lonPath = _lonPath; }
34 
35 };
36 
37 
39  public :
40 
42  std::string subject_id;
44 
46 
50  std::map<unsigned, std::set< std::pair<unsigned,float> > > weightLapl;
51  std::vector<std::set<uint> > neighbours;
52 
54 
55  SubjectData ( std::string id = "UNKNOWN_SUBJECT_ID" ) { subject_id = id; }
56  SubjectData ( SubjectData &subject ) {
57  subject_id = subject.subject_id;
58  coordinates = subject.coordinates;
59  paths = subject.paths;
60  mesh = subject.mesh;
61  tex = subject.tex;
62  lat = subject.lat;
63  lon = subject.lon;
64  weightLapl = subject.weightLapl;
65  }
66 
67 
68 
69  SubjectData ( std::string id, std::string meshPath, std::string texPath, std::string latPath = "", std::string lonPath = "" ) {
70  subject_id = id;
71  paths.meshPath = meshPath;
72  paths.texPath = texPath;
73  paths.latPath = latPath;
74  paths.lonPath = lonPath;
75  mesh = NULL; tex = NULL; lat = NULL; lon = NULL;
76  }
77 
78 // void readData ( std::string _meshPath, std::string _texPath, AimsSurfaceTriangle) ;
79 
80 
81  void storeData ( AimsSurface<3,Void> *mesh, Texture<float> *tex, bool computeWeights = true, bool computeNeighbours = true, bool verbose = true ) {
82  this->mesh = mesh;
83  this->tex = tex;
84  if ( verbose ) {
85  std::cout << " mesh : " << this->mesh->vertex().size() << " vertices" << std::endl;
86  std::cout << " tex : " << this->tex->nItem() << " values" << std::endl;
87  }
88 
89  this->coordinates = RAW_3D;
90  if ( computeWeights ) {
91  this->weightLapl = AimsMeshWeightFiniteElementLaplacian ( *(this->mesh), 0.98 );
92  if ( verbose ) {
93  std::cout << " weights : " << this->weightLapl.size() << " weights" << std::endl;
94  }
95  }
96  if ( computeNeighbours ) {
98  mesh[0] = *(this->mesh);
99  this->neighbours = aims::SurfaceManip::surfaceNeighbours( mesh );
100  if ( verbose ) {
101  std::cout << " neighbours : " << this->neighbours.size() << " sets" << std::endl;
102  }
103 
104  }
105 
106  }
107 
108  void storeData ( AimsSurface<3,Void> *mesh, Texture<float> *tex, std::map<unsigned, std::set< std::pair<unsigned,float> > > & weights, bool verbose = true ) {
109  storeData ( mesh, tex, false, false, verbose );
110  this->weightLapl = weights;
111  }
112 
113  void storeCoordinates ( Texture<float> *lat, Texture<float> *lon = NULL, bool verbose = true ) {
114  this->lat = lat;
115  this->lon = lon;
116 
117  if ( verbose )
118  std::cout << " lat : " << this->lat->nItem() << " values" << std::endl;
119 
120 
121  if ( this->lon != NULL ) {
122  if ( verbose )
123  std::cout << " lon : " << this->lon->nItem() << " values" << std::endl;
124  this->coordinates = LATLON_2D;
125  }
126  else {
127  //bool isCoordinatesOrFilteringTexture = false;
128  //std::set<float> possibleValues;
129  //possibleValues.insert(-1.0);
130  //possibleValues.insert(-2.0);
131  //possibleValues.insert(0.0);
132  //possibleValues.insert(1.0);
133  //for ( uint i = 0 ; i < this->lat->nItem() && !isCoordinatesOrFiltering; i ++ ) {
134  // if (this->lat->item(i) != -1 && this->
135  //
136  //}
137  this->coordinates = LAT_1D;
138  }
139  }
140 
141 };
142 
143 class GroupData:
144  public std::map< std::string, SubjectData *> {
145  public:
146  void readData( bool verbose = true );
147  std::map< std::string, uint > subjects_id;
148  std::vector < AimsSurfaceTriangle > meshes;
149  std::vector < TimeTexture<float> > textures;
150  std::vector < TimeTexture<float> > latitudes;
151  std::vector < TimeTexture<float> > longitudes;
152  std::vector < Graph *> graphs;
153 
154 };
155 
156 
157 
158 
159 
160 #endif /*SUBJECTDATA_H_*/
Texture< float > * tex
Definition: subjectdata.h:47
Graph * graph
Definition: subjectdata.h:53
Texture< float > * lat
Definition: subjectdata.h:48
std::map< std::string, uint > subjects_id
Definition: subjectdata.h:147
std::vector< TimeTexture< float > > textures
Definition: subjectdata.h:149
size_t nItem() const
AIMSDATA_API AimsTimeSurface< 3, Void > AimsSurfaceTriangle
std::string meshPath
Definition: subjectdata.h:19
std::vector< TimeTexture< float > > latitudes
Definition: subjectdata.h:150
std::string graphPath
Definition: subjectdata.h:23
SubjectPaths(std::string _meshPath, std::string _texPath, std::string _latPath="", std::string _lonPath="")
Definition: subjectdata.h:32
SubjectData(std::string id="UNKNOWN_SUBJECT_ID")
Definition: subjectdata.h:55
std::map< unsigned, std::set< std::pair< unsigned, float > > > AimsMeshWeightFiniteElementLaplacian(const AimsSurface< 3, Void > &mesh, const float Wmax)
const std::vector< Point3df > & vertex() const
std::string subject_id
Definition: subjectdata.h:42
SubjectData(std::string id, std::string meshPath, std::string texPath, std::string latPath="", std::string lonPath="")
Definition: subjectdata.h:69
SubjectData(SubjectData &subject)
Definition: subjectdata.h:56
Texture< float > * lon
Definition: subjectdata.h:49
int verbose
static std::vector< std::set< uint > > surfaceNeighbours(const AimsSurface< D, T > &surf)
SubjectPaths(SubjectPaths &s)
Definition: subjectdata.h:26
AimsSurface< 3, Void > * mesh
Definition: subjectdata.h:45
std::string lonPath
Definition: subjectdata.h:22
std::vector< AimsSurfaceTriangle > meshes
Definition: subjectdata.h:148
void storeCoordinates(Texture< float > *lat, Texture< float > *lon=NULL, bool verbose=true)
Definition: subjectdata.h:113
coordinatesMode
Definition: subjectdata.h:12
void storeData(AimsSurface< 3, Void > *mesh, Texture< float > *tex, bool computeWeights=true, bool computeNeighbours=true, bool verbose=true)
Definition: subjectdata.h:81
void storeData(AimsSurface< 3, Void > *mesh, Texture< float > *tex, std::map< unsigned, std::set< std::pair< unsigned, float > > > &weights, bool verbose=true)
Definition: subjectdata.h:108
std::vector< TimeTexture< float > > longitudes
Definition: subjectdata.h:151
std::string texPath
Definition: subjectdata.h:20
std::vector< Graph * > graphs
Definition: subjectdata.h:152
std::map< unsigned, std::set< std::pair< unsigned, float > > > weightLapl
Definition: subjectdata.h:50
std::vector< std::set< uint > > neighbours
Definition: subjectdata.h:51
std::string latPath
Definition: subjectdata.h:21
int coordinates
Definition: subjectdata.h:41
SubjectPaths paths
Definition: subjectdata.h:43