aimsalgo 6.0.0
Neuroimaging image processing
curv.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
36#ifndef AIMS_MESH_MESHCURVATURE_H
37#define AIMS_MESH_MESHCURVATURE_H
38
39#include <aims/mesh/texture.h>
40#include <aims/mesh/surface.h>
41#include <list>
42
43inline float fsign(float x);
45
47
49
51//Estimation of the time step dt for the diffusion equation.
53 const Texture<float> &lapl,
54 float tmax);
55
57//Estimation of the curvature. Boix method
59 const std::vector<float> & ALPHA,
60 const std::vector<float> & BETA,
61 const std::vector<std::list<float> > & SURFACE);
62
64//Regularization of a texture map.
65//Definition of the Outliers from the histogram
67 const AimsSurface<3,Void> & mesh,
68 float alpha );
69
72 float ratio );
74//Estimation of the curvature (finite element method)
76 const std::vector< std::list<unsigned> > & neighbourso,
77 const std::vector< std::list<float> > & PHI,
78 const std::vector< std::list<float> > & THETA,
79 const std::vector< std::list<float> > & SURFACE,
80 const std::vector< std::list<float> > & DOT);
81
83//Eequired for the curvature and the laplacian estimation (finite element method).
84std::vector< std::list<float> > AimsMeshFiniteElementPhi( const AimsSurface<3,Void> & mesh,
85 const std::vector< std::list<unsigned> > & neighbourso,
86 const std::vector< std::list<float> > & surf);
87
89//Eequired for the curvature and the laplacian estimation (finite element method).
90std::vector< std::list<float> > AimsMeshFiniteElementTheta( const AimsSurface<3,Void> & mesh,
91 const std::vector< std::list<unsigned> > & neighbourso,
92 const std::vector< std::list<float> > & surf);
94//Eequired for the curvature and the laplacian estimation (finite element method).
95std::vector<float> AimsMeshFiniteElementAlpha( const AimsSurface<3,Void> & mesh,
96 const std::vector< std::list<unsigned> > & neighbourso);
97
99//Eequired for the curvature estimation (boix method).
100std::vector<float> AimsMeshFiniteElementBeta( const AimsSurface<3,Void> & mesh,
101 const std::vector< std::list<unsigned> > & neighbourso);
102
104//Required for the curvature and the laplacian estimation (finite element and boix method).
105//The first list element for each coordinate i of the vector
106//Correspond to the total surface of the patch surrounding the node i.
107std::vector< std::list<float> > AimsMeshFiniteElementSurface( const AimsSurface<3,Void> & mesh,
108 const std::vector< std::list<unsigned> > & neighbourso);
109
111//Eequired for the curvature and the laplacian estimation (finite element method).
112std::vector< std::list<float> > AimsMeshFiniteElementDot( const AimsSurface<3,Void> & mesh,
113 const std::vector< std::list<unsigned> > & neighbourso);
114
115
116//Give for each node the clockwise ordered list of neighbours nodes
117std::vector< std::list<unsigned> > AimsMeshOrderNode(const AimsSurface<3,Void> & mesh);
118
119//Give for each node the clockwise ordered list of neighbours triangles.
120std::vector< std::list<unsigned> > AimsMeshOrderTriangle(const AimsSurface<3,Void> & mesh);
121
122//Estimation of the laplacian of a texture map; (finite element method).
123
125 const std::map<unsigned,
126 std::set< std::pair<unsigned,
127 float> > > &lapl);
128
129template <typename T>
130void AimsMeshLaplacian( const std::vector<T> &inittex,
131 std::vector<T> & outtex,
132 const std::map<unsigned,
133 std::set< std::pair<unsigned,float> > > &lapl);
134
135
136std::map<unsigned, std::set< std::pair<unsigned,float> > > AimsMeshWeightFiniteElementLaplacian( const AimsSurface<3,Void> & mesh,
137 const float Wmax);
138
139namespace aims
140{
141 typedef std::map<unsigned, std::set< std::pair<unsigned,float> > >
143
145 LaplacianWeights & lmat, float dt );
146
148 const LaplacianWeights & in2,
149 float sparseThresh=0 );
150
151 template <typename T>
152 void applyLaplacianMatrix( const std::vector<T> &inittex,
153 std::vector<T> & outtex,
154 const LaplacianWeights &lapl );
155
156 void laplacianMatrixThreshold( LaplacianWeights & lmat, float threshold );
157
166 const LaplacianWeights & weights, unsigned niter, float dt,
167 float sparseThresh=0 );
168
169}
170
171#endif
std::vector< float > AimsMeshFiniteElementBeta(const AimsSurface< 3, Void > &mesh, const std::vector< std::list< unsigned > > &neighbourso)
obsolete, see Curvature clases in <aims/mesh/geometric.h>
TimeTexture< float > AimsMeshCurvature(const AimsSurface< 3, Void > &mesh)
obsolete, see Curvature clases in <aims/mesh/geometric.h>
float fsign(float x)
std::vector< std::list< float > > AimsMeshFiniteElementDot(const AimsSurface< 3, Void > &mesh, const std::vector< std::list< unsigned > > &neighbourso)
obsolete, see Curvature clases in <aims/mesh/geometric.h>
std::vector< float > AimsMeshFiniteElementAlpha(const AimsSurface< 3, Void > &mesh, const std::vector< std::list< unsigned > > &neighbourso)
obsolete, see Curvature clases in <aims/mesh/geometric.h>
Texture< float > AimsMeshBoixCurvature(const AimsSurface< 3, Void > &mesh, const std::vector< float > &ALPHA, const std::vector< float > &BETA, const std::vector< std::list< float > > &SURFACE)
obsolete, see Curvature clases in <aims/mesh/geometric.h>
Texture< float > AimsRegularizeTexture(const Texture< float > &tex, const AimsSurface< 3, Void > &mesh, float alpha)
obsolete, see Curvature clases in <aims/mesh/geometric.h>
std::vector< std::list< float > > AimsMeshFiniteElementPhi(const AimsSurface< 3, Void > &mesh, const std::vector< std::list< unsigned > > &neighbourso, const std::vector< std::list< float > > &surf)
obsolete, see Curvature clases in <aims/mesh/geometric.h>
std::vector< std::list< float > > AimsMeshFiniteElementSurface(const AimsSurface< 3, Void > &mesh, const std::vector< std::list< unsigned > > &neighbourso)
obsolete, see Curvature clases in <aims/mesh/geometric.h>
float AimsMeshFiniteElementDt(const Texture< float > &tex, const Texture< float > &lapl, float tmax)
obsolete, see Curvature clases in <aims/mesh/geometric.h>
std::vector< std::list< float > > AimsMeshFiniteElementTheta(const AimsSurface< 3, Void > &mesh, const std::vector< std::list< unsigned > > &neighbourso, const std::vector< std::list< float > > &surf)
obsolete, see Curvature clases in <aims/mesh/geometric.h>
std::map< unsigned, std::set< std::pair< unsigned, float > > > AimsMeshWeightFiniteElementLaplacian(const AimsSurface< 3, Void > &mesh, const float Wmax)
std::vector< std::list< unsigned > > AimsMeshOrderNode(const AimsSurface< 3, Void > &mesh)
std::vector< std::list< unsigned > > AimsMeshOrderTriangle(const AimsSurface< 3, Void > &mesh)
Texture< float > AimsMeshLaplacian(const Texture< float > &inittex, const std::map< unsigned, std::set< std::pair< unsigned, float > > > &lapl)
Point3df cross(Point3df a, Point3df b)
Texture< float > AimsMeshFiniteElementCurvature(const AimsSurface< 3, Void > &mesh, const std::vector< std::list< unsigned > > &neighbourso, const std::vector< std::list< float > > &PHI, const std::vector< std::list< float > > &THETA, const std::vector< std::list< float > > &SURFACE, const std::vector< std::list< float > > &DOT)
obsolete, see Curvature clases in <aims/mesh/geometric.h>
LaplacianWeights * sparseMult(const LaplacianWeights &in1, const LaplacianWeights &in2, float sparseThresh=0)
void applyLaplacianMatrix(const std::vector< T > &inittex, std::vector< T > &outtex, const LaplacianWeights &lapl)
void laplacianMatrixThreshold(LaplacianWeights &lmat, float threshold)
std::map< unsigned, std::set< std::pair< unsigned, float > > > LaplacianWeights
Definition curv.h:142
void makeLaplacianMatrix(const LaplacianWeights &weights, LaplacianWeights &lmat, float dt)
LaplacianWeights * makeLaplacianSmoothingCoefficients(const LaplacianWeights &weights, unsigned niter, float dt, float sparseThresh=0)
Compute Laplacian smoothing coefficients matrix for niter smoothing iterations.
AimsVector< float, 3 > Point3df