A.I.M.S algorithms


meshBlob.h
Go to the documentation of this file.
1 
2 /* This software and supporting documentation are distributed by
3  * Institut Federatif de Recherche 49
4  * CEA/NeuroSpin, Batiment 145,
5  * 91191 Gif-sur-Yvette cedex
6  * France
7  *
8  * This software is governed by the CeCILL-B license under
9  * French law and abiding by the rules of distribution of free software.
10  * You can use, modify and/or redistribute the software under the
11  * terms of the CeCILL-B license as circulated by CEA, CNRS
12  * and INRIA at the following URL "http://www.cecill.info".
13  *
14  * As a counterpart to the access to the source code and rights to copy,
15  * modify and redistribute granted by the license, users are provided only
16  * with a limited warranty and the software's author, the holder of the
17  * economic rights, and the successive licensors have only limited
18  * liability.
19  *
20  * In this respect, the user's attention is drawn to the risks associated
21  * with loading, using, modifying and/or developing or reproducing the
22  * software by the user in light of its specific status of free software,
23  * that may mean that it is complicated to manipulate, and that also
24  * therefore means that it is reserved for developers and experienced
25  * professionals having in-depth computer knowledge. Users are therefore
26  * encouraged to load and test the software's suitability as regards their
27  * requirements in conditions enabling the security of their systems and/or
28  * data to be ensured and, more generally, to use and operate it in the
29  * same conditions as regards security.
30  *
31  * The fact that you are presently reading this means that you have had
32  * knowledge of the CeCILL-B license and that you accept its terms.
33  */
34 
35 
36 #ifndef AIMS_SCALESPACE_MESHBLOB_H
37 #define AIMS_SCALESPACE_MESHBLOB_H
38 
40 #include <aims/mesh/texture.h>
41 #include <aims/mesh/surface.h>
42 #include <list>
43 #include <vector>
44 #include <aims/mesh/curv.h>
46 #include <graph/graph/graph.h>
47 #include <graph/graph/graph.h>
48 #include <cartobase/smart/rcptr.h>
49 
50 
51 class Graph;
52 
53 
54 namespace aims
55 {
56 
57  class AIMSALGO_API ScaleSpace
58  {
59  public:
60  enum MeshShape
61  {
63  Tore
64  };
65 
67  {
68  Junction, // blob to blob
69  Bottom
70  };
71 
73  {
76  PushNormal
77  };
78 
80  {
81  unsigned minimum;
82  unsigned maximum;
84  unsigned neighbour;
85  };
86 
87  enum MergeCode
88  {
89  OK = 0,
90  PbUp = 1,
91  PbDown = 2,
92  PbBoth = 3
93  };
94 
95  Texture<int> meshBlobExtract( const AimsSurface<3,Void> & mesh,
96  const Texture<float> & inittex,
97  std::map<int, BlobDescriptor> & limits );
98 
99  int blobToGraph( Graph & g, const Texture<int> & blobs ,
100  const AimsSurfaceTriangle & mesh, const AimsSurfaceTriangle & infl_mesh,
101  const Texture<float> & values, float scale,
102  std::map<int, BlobDescriptor> & limits, int startindex );
103 
104  void cleanGraphScale( Graph & g, float scale);
105 
106  MergeCode mergeGraphs( Graph & g, Graph & h );
107 
108  void createSubMeshes( Graph & g, const AimsSurface<3,Void> & mesh,
109  float depl = 0, float depl0 = 0,
110  MeshShape ms = Surface, MeshGrowingMode gm = Scale,
111  bool compressedMeshes = true);
112 
113  void grayLevel2PrimalSketch( Graph & glevel, Graph & psketch );
114 
115 
116  std::multimap<float, unsigned> sortGLB(std::string key,
117  const std::map<unsigned, Vertex *> & nodes,
118  const std::map<unsigned, std::set<Vertex *> > & scblobs);
119 
120 
121  void GLBVertexToSSBVertex(Graph & psketch,
122  const std::multimap<float, unsigned> & ordering,
123  const std::map<unsigned, Vertex *> & nodes,
124  const std::map<unsigned, std::set<Vertex *> > & scblobs);
125 
126  void GLBEdgeToSSBEdge(Graph & glevel, Graph & psketch,
127  const std::map<Vertex *, unsigned> & labels,
128  const std::map<unsigned, Vertex *> & nodes);
129 
130  void setGraphLabelAndName( const std::multimap<float, unsigned> & ordering,
131  const std::map<unsigned, Vertex *> & nodes,
132  const std::map<unsigned, std::set<Vertex *> > & scblobs);
133 
134  float getRepresentativeScale(const std::set<Vertex *> & SSB);
135 
136 
137  carto::rc_ptr<AimsSurfaceTriangle> getRepresentativeBlobMesh(float scale0, const std::set<Vertex *> & SSB);
138 
139  int adaptiveScaleSpace( Graph & psketch,
140  const AimsSurfaceTriangle & mesh,
141  const AimsSurfaceTriangle & infl_mesh,
142  const Texture1d & inittex,
143  std::map<float,Texture<int> > & tex_blobs,
144  std::map<float,Texture<float> > & tex_curv,
145  int index, float tbegin, float tend,
146  float dt,float dts, float dtmin,
147  const float HMAX,bool logFlag,
148  const std::map<unsigned,
149  std::set< std::pair<unsigned,float> > >
150  & weightLapl);
151 
152  AimsSurfaceTriangle surface2Tore( const AimsSurfaceTriangle & );
153  };
154 
155 }
156 
157 #endif
158 
159 
AIMSDATA_API AimsTimeSurface< 3, Void > AimsSurfaceTriangle
AIMSDATA_API TimeTexture< float > Texture1d
#define AIMSALGO_API