cortical_surface 6.0.0
sulcalLinesGeodesic.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2000-2004 CEA
3 *
4 * This software and supporting documentation were developed by
5 * CEA/DSV/SHFJ
6 * 4 place du General Leclerc
7 * 91401 Orsay cedex
8 * France
9 */
10
11
12
13#ifndef AIMS_SULCUS_CORTICAL_GEO_H
14#define AIMS_SULCUS_CORTICAL_GEO_H
15
16#include <aims/mesh/surface.h>
17#include <aims/mesh/texture.h>
18#include <aims/mesh/surfacegen.h>
19#include <aims/mesh/surfaceOperation.h>
21#include <aims/distancemap/meshvoronoi.h>
22#include <aims/scalespace/meshDiffuse.h>
23#include <aims/distancemap/meshmorphomat.h>
24#include <aims/io/reader.h>
25#include <aims/io/writer.h>
26#include <aims/geodesicpath/geodesicPath.h>
27#include <iostream>
28#include <fstream>
29#include <queue>
30#include <map>
31
32using namespace aims;
33using namespace aims::meshdistance;
34using namespace std;
35
36typedef std::vector<double> double_vec_t;
37
38class Comp
39{
40
41 double_vec_t& _v;
42 public:
43 Comp(double_vec_t& v) : _v(v) {}
44 bool operator()(double i, double j){
45 return _v[i] < _v[j];
46 }
47};
48
50{
51 public:
52
53 //Parametres pour l'execution
54 string _adrMesh;
57 string _adrCurv;
64 string _side;
65
69 vector<float> _proba;
70 bool _save;
75
77 std::vector<std::set<uint> > _neigh;
78
85
86 //Constructor
87 SulcalLinesGeodesic(string & adrMesh, string & adrCurv,
88 string & adrGeodesicDepth, string & adrRootsLon, string & adrRootsLat,string & adrRootsBottom, string & adrLabelBasins, string & adrLabelSulcalines, string & adrSulcalines,
89 int extremeties_method, int constraint_type, int strain,
90 vector<float> proba, string saveFolder, float curv_thresh, string side, float clean_size, int constraintValue,int max_extremities);
91
93
94 //public methods
95 void run();
96 void probaMap();
97
98 void writeShortTexture (string name,TimeTexture<short> &out);
99 void writeFloatTexture (string name,TimeTexture<float> &out);
100 void floodFillIter(int indexVertex, float newTextureValue,float oldTextureValue,TimeTexture<short> &texBasinsTemp, map<int,set<int> > &mapBasins);
101 TimeTexture<short> texConnectedComponent(TimeTexture<short> &texBasins, map<int,set<int> > &mapBasins, int offset);
102
103 void texBinarizeF2S(TimeTexture<float> &texIn, TimeTexture<short> &texOut, float threshold,int inf,int sup);
104 void texBinarizeS2S(TimeTexture<short> &texIn, TimeTexture<short> &texOut, int threshold,int inf,int sup);
105 void computeListLabelProjectionsBasins (TimeTexture<short> &roots, map<int,set<int> > &mapBasins,set<int> &listIndex, map<int,set<int> > &mapConstraint);
106
107 private :
108 void segmentationSulcalBasins (TimeTexture<float> &texIn,TimeTexture<short> &texBasins,map<int,set<int> > &mapBasins,float threshold, int close, int open);
109
110 void computeRootsBottomMap(TimeTexture<short> &texBasins,TimeTexture<short> &texRootsBottom, float dist_max);
111
112 void computeConstraintList(map<int,int> & listValues);
113
114 void listRootsProjections(TimeTexture<short> &texBasins,set<int> &listIndexLat,set<int> &listIndexLon);
115 void computeLongestPathBasins (TimeTexture<short> &roots, TimeTexture<short> &out, map<int,set<int> > &mapConstraint);
116
117 void normalizeDepthMap (TimeTexture<float> &depth, TimeTexture<float> &depthNorm, map<int,set<int> > &mapBasins);
118
119 void sulcalLinesExtract_projection(map<int,set<int> > &mapBasins, TimeTexture<short> &texBasins);
120
121 void dilationRoots(TimeTexture<short> &texLatDil,TimeTexture<short> &texLonDil,int size);
122 void interRootsDilBasins(TimeTexture<short> &texBasins,TimeTexture<short> &texDil,TimeTexture<short> &texInter);
123 void cleanBasins(map<int,set<int> > &mapBasins,TimeTexture<short> &texBasins,map<int, vector<int> > &mapPolygonSetBasins,float min_area_size);
124 void contourBasins(map<int,set<int> > &mapBasins,TimeTexture<short> &texBasins,map<int,set<int> > &mapContourBasins,TimeTexture<short> &texContourBasins);
125 void computeProbabiltyMap(map<int,set<int> > &mapContourBasins,TimeTexture<short> &texContourBasins,TimeTexture<short> &texBasins, TimeTexture<float> &texProba);
126 void computeMaximalProbabiltyMap(map<int, set<int> > &mapContourBasins, TimeTexture<short> &texContourBasins, TimeTexture<short> &texBasins, TimeTexture<float> &texProba);
127 void normalizeProbabiltyMap(map<int,set<int> > &mapBasins, map<int,set<int> > &mapContourBasins,TimeTexture<short> &texContourBasins,TimeTexture<float> &texProba,TimeTexture<float> &texProbaNorm);
128 void normalizeMaximalProbabiltyMap(map<int,set<int> > &mapBasins, map<int,set<int> > &mapContourBasins,TimeTexture<short> &texContourBasins,TimeTexture<float> &texProba,TimeTexture<float> &texProbaNorm);
129 void textureBin2Label(TimeTexture<short> &texLabel, TimeTexture<short> &texIn, TimeTexture<short> &texOut);
130
131 //embc11
132 void sulcalLinesExtract_probability(map<int,set<int> > &mapBasins, TimeTexture<short> &texBasins);
133 //neuroimage11
134 void sulcalLinesExtract_density(map<int, set<int> > &mapBasins, TimeTexture<short> &texBasins);
135 //miccai12
136 void sulcalLinesExtract_maximal_density(map<int, set<int> > &mapBasins, TimeTexture<short> &texBasins);
137
138 void automaticThresholdDensityMap(map<int, set<int> > &mapBasins, TimeTexture<short> &texBasins, TimeTexture<float> &texProbaNorm,TimeTexture<short> &texAutoThreshold,int nb_bin);
139 void automaticThresholdMaximalDensityMap(map<int, set<int> > &mapBasins, TimeTexture<short> &texBasins, TimeTexture<float> &texProbaNorm,TimeTexture<short> &texAutoThreshold_begin,TimeTexture<short> &texAutoThreshold_middle,TimeTexture<short> &texAutoThreshold_end,int nb_bin);
140
141 void vertexmap2polygonMap(map<int, set<int> > &mapVertexSetBasins, map<int, vector<int> > &mapPolygonSetBasins);
142
143};
144
145
146#endif
Comp(double_vec_t &v)
bool operator()(double i, double j)
void texBinarizeS2S(TimeTexture< short > &texIn, TimeTexture< short > &texOut, int threshold, int inf, int sup)
TimeTexture< short > _rootsLat
TimeTexture< short > texConnectedComponent(TimeTexture< short > &texBasins, map< int, set< int > > &mapBasins, int offset)
void writeShortTexture(string name, TimeTexture< short > &out)
TimeTexture< float > _geoCurvDepthNorm
void writeFloatTexture(string name, TimeTexture< float > &out)
TimeTexture< float > _geoDepthNorm
std::vector< std::set< uint > > _neigh
AimsSurfaceTriangle _mesh
TimeTexture< float > _geoDepth
SulcalLinesGeodesic(string &adrMesh, string &adrCurv, string &adrGeodesicDepth, string &adrRootsLon, string &adrRootsLat, string &adrRootsBottom, string &adrLabelBasins, string &adrLabelSulcalines, string &adrSulcalines, int extremeties_method, int constraint_type, int strain, vector< float > proba, string saveFolder, float curv_thresh, string side, float clean_size, int constraintValue, int max_extremities)
void floodFillIter(int indexVertex, float newTextureValue, float oldTextureValue, TimeTexture< short > &texBasinsTemp, map< int, set< int > > &mapBasins)
void texBinarizeF2S(TimeTexture< float > &texIn, TimeTexture< short > &texOut, float threshold, int inf, int sup)
TimeTexture< float > _texCurv
void computeListLabelProjectionsBasins(TimeTexture< short > &roots, map< int, set< int > > &mapBasins, set< int > &listIndex, map< int, set< int > > &mapConstraint)
TimeTexture< short > _rootsLon
STL namespace.
std::vector< double > double_vec_t
AIMSDATA_API AimsTimeSurface< 3, Void > AimsSurfaceTriangle