aimsalgo  5.0.5
Neuroimaging image processing
foldgraphattributes.h
Go to the documentation of this file.
1 /* This software and supporting documentation are distributed by
2  * Institut Federatif de Recherche 49
3  * CEA/NeuroSpin, Batiment 145,
4  * 91191 Gif-sur-Yvette cedex
5  * France
6  *
7  * This software is governed by the CeCILL-B license under
8  * French law and abiding by the rules of distribution of free software.
9  * You can use, modify and/or redistribute the software under the
10  * terms of the CeCILL-B license as circulated by CEA, CNRS
11  * and INRIA at the following URL "http://www.cecill.info".
12  *
13  * As a counterpart to the access to the source code and rights to copy,
14  * modify and redistribute granted by the license, users are provided only
15  * with a limited warranty and the software's author, the holder of the
16  * economic rights, and the successive licensors have only limited
17  * liability.
18  *
19  * In this respect, the user's attention is drawn to the risks associated
20  * with loading, using, modifying and/or developing or reproducing the
21  * software by the user in light of its specific status of free software,
22  * that may mean that it is complicated to manipulate, and that also
23  * therefore means that it is reserved for developers and experienced
24  * professionals having in-depth computer knowledge. Users are therefore
25  * encouraged to load and test the software's suitability as regards their
26  * requirements in conditions enabling the security of their systems and/or
27  * data to be ensured and, more generally, to use and operate it in the
28  * same conditions as regards security.
29  *
30  * The fact that you are presently reading this means that you have had
31  * knowledge of the CeCILL-B license and that you accept its terms.
32  */
33 
34 
35 #ifndef AIMS_FOLDGRAPH_FOLDGRAPHATTRIBUTES
36 #define AIMS_FOLDGRAPH_FOLDGRAPHATTRIBUTES
37 
38 #include <aims/data/data.h>
39 #include <aims/mesh/mesher.h>
40 
41 class Graph;
42 
43 namespace aims
44 {
45  class AffineTransformation3d;
46  template <typename T> class BucketMap;
47 
50  {
51  public:
54  FoldGraphAttributes( const AimsData<int16_t> & skel, Graph & graph,
55  const AffineTransformation3d *talairachAffineTransformation3d = 0,
56  int16_t inside = 0, int16_t outside = 11,
57  bool withmeshes = true,
58  const std::vector<int> & graphversion
59  = std::vector<int>() );
61  void cleanup();
63  void doAll();
64 
65  void makeMeshes();
66  void makeGlobalAttributes();
72 
74  const AimsData<int16_t> &getDepth() const;
76  const AimsData<int16_t> &getNDepth() const;
81  const AimsData<float> &getBrainDepth() const;
82  const AimsData<float> &getBrainDepthGradX() const;
83  const AimsData<float> &getBrainDepthGradY() const;
84  const AimsData<float> &getBrainDepthGradZ() const;
89  const AimsData<float> &getDilatedDepth() const;
93  float getDepthfactor() const;
94  void prepareDepthMap();
95  void prepareBrainDepthMap();
101  std::vector<int> graphVersion() const;
102  void thickness( const BucketMap<float> & midinterfaceDistances,
103  const carto::VolumeRef<int16_t> voronoi );
105  const carto::VolumeRef<int16_t> voronoi );
111  void setMaxThreads( int mt );
112  int maxThreads() const { return _maxthreads; }
113  Mesher & mesher() { return _mesher; }
114 
115  private:
117  friend class DistanceMapThreadContext;
118 
119  void prepareNativeDepthMap();
120  void prepareNormalizedDepthMap( const AimsData<int16_t> & th );
121  void prepareDilatedDepthMap( const AimsData<int16_t> & th );
122  void prepareGradientX();
123  void prepareGradientY();
124  void prepareGradientZ();
125  void prepareBrainGradientX();
126  void prepareBrainGradientY();
127  void prepareBrainGradientZ();
128 
129  AimsData<int16_t> _skel;
130  Graph & _graph;
131  int16_t _inside;
132  int16_t _outside;
133  const AffineTransformation3d *_motion;
135  AimsData<int16_t> _depth;
136  AimsData<int16_t> _ndepth;
138  AimsData<float> _braindepthmap;
140  AimsData<float> _braindepthmap_gradX;
142  AimsData<float> _braindepthmap_gradY;
144  AimsData<float> _braindepthmap_gradZ;
146  AimsData<float> _dilated_depthmap;
148  AimsData<float> _dilated_depthmap_gradX;
150  AimsData<float> _dilated_depthmap_gradY;
152  AimsData<float> _dilated_depthmap_gradZ;
153  bool _domeshes;
154  std::vector<int> _graphversion;
155  int _maxthreads;
156  Mesher _mesher;
157  };
158 
159 }
160 
161 #endif
162 
163 
std::vector< int > graphVersion() const
returns a vector value of 2 or more numbers from the target graph version, or the current cartograph ...
AimsData< float > & getBrainDepthGradY()
Creation of cortical folds graph attributes.
FoldGraphAttributes(const AimsData< int16_t > &skel, Graph &graph, const AffineTransformation3d *talairachAffineTransformation3d=0, int16_t inside=0, int16_t outside=11, bool withmeshes=true, const std::vector< int > &graphversion=std::vector< int >())
skel is the skeleton image of the hemisphere, It must be allocated with a border of at least 1 voxel ...
AimsData< int16_t > & getDepth()
AimsData< float > & getDilatedDepthGradY()
float getDepthfactor() const
void setMaxThreads(int mt)
Sets the maxumum number of threads used in multithreaded-enabled parts.
AimsData< int16_t > rebuildCorticalRelations()
outputs the voronoi in brain hull from hull junctions
AimsData< float > & getBrainDepthGradZ()
AimsData< float > & getDilatedDepth()
AimsData< float > & getDilatedDepthGradZ()
Definition: mesher.h:51
void greyAndCSFVolumes(const carto::VolumeRef< int16_t > gw, const carto::VolumeRef< int16_t > voronoi)
void thickness(const BucketMap< float > &midinterfaceDistances, const carto::VolumeRef< int16_t > voronoi)
AimsData< float > & getBrainDepth()
AimsData< float > & getBrainDepthGradX()
void doAll()
creates all attributes (global + all nodes/relations types)
void cleanup()
frees the depth map
AimsData< float > & getDilatedDepthGradX()
AimsData< int16_t > & getNDepth()