cortical_surface 6.0.0
conformalMapping.h
Go to the documentation of this file.
1/*
2 * This software and supporting documentation were developed by
3 * CNRS, labo LSIS, UMR6168, Marseille, France
4 * olivier.coulon@univmed.fr
5 */
6
7
8
9#ifndef AIMS_CONFORMALMAPPING_H
10#define AIMS_CONFORMALMAPPING_H
11
12#include <aims/mesh/texture.h>
13#include <aims/mesh/curv.h>
14#include <aims/mesh/surfaceOperation.h>
15#include <aims/io/reader.h>
16#include <aims/io/writer.h>
17
18
19// This class implement the conformal mapping of a mesh to
20// the unit sphere as defined in Gu et al., IEEE Tr on Med Im.
21//, vol23, no8, pp 949-958, 2004
22//
23// the idea is to minimize the harmonic energy and add constraints
24// such as zero-mass center and maybe landmarks
25
26
27namespace aims
28{
30 {
31 public:
32 ConformalMapping(std::string adr_mesh, float dt, float dE) :
33 _dt(dt), _dE(dE)
34 {
35 Reader < AimsSurfaceTriangle > r(adr_mesh);
36 r.read( _mesh );
37 _nv=_mesh.vertex().size();
38 _tuetteMap=std::vector<Point3df>(_nv);
39 _conformalMap=std::vector<Point3df>(_nv);
43 }
44 ConformalMapping(AimsSurfaceTriangle mesh, float dt, float dE) :
45 _mesh(mesh), _dt(dt), _dE(dE)
46 {
47 _nv=_mesh.vertex().size();
48 _tuetteMap=std::vector<Point3df>(_nv);
49 _conformalMap=std::vector<Point3df>(_nv);
53 }
54
57 void TuetteMap();
58 void ConformalMap(std::string adr_tuette);
59
62 float TuetteEnergy();
64 void WriteConformalCoordinates(std::string latpath, std::string lonpath);
65
66 private:
68 float _dt;
69 float _dE;
70
71 uint _nv;
72 std::vector<std::set<uint> > _neigh;
73 std::vector<AimsVector<uint,2> > _edges;
74 std::vector<std::set<std::pair<uint, uint> > > _edgeMap;
75
76 std::vector<float> _harmonicCoef;
77 std::vector<Point3df> _tuetteMap;
78 std::vector<Point3df> _conformalMap;
79 std::vector<float> _conformalLon;
80 std::vector<float> _conformalLat;
81
82 void buildEdgeMap();
83 uint whichEdge(uint v1, uint v2);
84 Point3df getCenterOfMass(std::vector<Point3df> tmpMap);
85 void ComputeConformalCoordinates();
86 };
87}
88
89#endif
void WriteConformalCoordinates(std::string latpath, std::string lonpath)
ConformalMapping(AimsSurfaceTriangle mesh, float dt, float dE)
void ConformalMap(std::string adr_tuette)
void ComputeHarmonicCoefficients()
AimsSurfaceTriangle GetTuetteMapping()
AimsSurfaceTriangle GetConformalMapping(std::string adr_tuette)
ConformalMapping(std::string adr_mesh, float dt, float dE)
virtual bool read(T &obj, int border=0, const std::string *format=0, int frame=-1)
static std::vector< std::set< uint > > surfaceNeighbours(const AimsSurface< D, T > &surf)
AIMSDATA_API AimsTimeSurface< 3, Void > AimsSurfaceTriangle
unsigned int uint