aimsdata  5.1.2
Neuroimaging data handling
aims::SurfaceManip Class Reference

#include <aims/mesh/surfacemanip.h>

Static Public Member Functions

template<int D, class T >
static std::vector< std::set< uint > > surfaceNeighbours (const AimsSurface< D, T > &surf)
 
template<int D, class T >
static std::vector< std::set< uint > > surfaceNeighbours (const AimsTimeSurface< D, T > &surf)
 
template<int D, class T >
static std::vector< std::set< uint > > surfaceNeighbours2ndOrder (const AimsTimeSurface< D, T > &surf)
 
template<int D, class T >
static std::vector< std::map< uint, float > > surfaceNeighbourDistance (const AimsTimeSurface< D, T > &surf)
 
template<int D, class T >
static void invertSurfacePolygons (AimsTimeSurface< D, T > &surface)
 
static void cutMesh (const AimsSurfaceTriangle &insurf, const Point4df &plane, AimsSurfaceTriangle &cut, AimsTimeSurface< 2, Void > &borderline)
 
static void cutMesh (const std::vector< const AimsSurfaceTriangle * > &insurf, const Point4df &plane, std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &cut, AimsTimeSurface< 2, Void > &borderline)
 
static void cutMesh (const AimsSurfaceTriangle &insurf, const Point4df &plane, AimsSurfaceTriangle &cut, AimsSurfaceTriangle &planemesh, bool checkplane=true)
 
static void cutMesh (const std::vector< const AimsSurfaceTriangle * > &insurf, const Point4df &plane, std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &cut, AimsSurfaceTriangle &planemesh, bool checkplane=true)
 
static void cutMesh (const AimsSurfaceTriangle &insurf, const Point4df &plane, AimsSurfaceTriangle &cut, AimsSurfaceTriangle &planemesh, AimsTimeSurface< 2, Void > &borderline, bool checkplane=true)
 
static void cutMesh (const std::vector< const AimsSurfaceTriangle * > &insurf, const Point4df &plane, std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &cut, AimsSurfaceTriangle &planemesh, AimsTimeSurface< 2, Void > &borderline, bool checkplane=true)
 
static void cutMesh (const AimsSurfaceTriangle &insurf, const Point4df &plane, AimsSurfaceTriangle &cut, AimsSurfaceTriangle &planemesh, AimsTimeSurface< 2, Void > &borderline, bool meshplane, bool checkplane)
 
static void cutMesh (const std::vector< const AimsSurfaceTriangle * > &insurf, const Point4df &plane, std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &cut, AimsSurfaceTriangle &planemesh, AimsTimeSurface< 2, Void > &borderline, bool meshplane, bool checkplane)
 
static void cutMesh (const AimsSurfaceTriangle &insurf, const Point4df &plane, AimsTimeSurface< 2, Void > &borderline, int timestep=0)
 This variant only computes the border line. More...
 
static void cutMesh (const AimsSurface< 3, Void > &insurf, const Point4df &plane, AimsTimeSurface< 2, Void > &borderline)
 This variant only computes the border line. More...
 
static void meshPlanarPolygon (const Point4df &plane, const AimsTimeSurface< 2, Void > &border, AimsSurfaceTriangle &outmesh)
 
static bool checkMesh (const AimsSurfaceTriangle &insurf, AimsSurfaceTriangle *outsurf=0)
 Check mesh for intersecting triangles. More...
 
static float meshArea (const AimsSurfaceTriangle &surf)
 
static float meshArea (const AimsSurface< 3, Void > &surf)
 
static std::map< int, float > meshArea (const AimsSurfaceTriangle &surf, const TimeTexture< int16_t > &tex)
 
static std::map< int, float > meshArea (const AimsSurface< 3, Void > &surf, const Texture< int16_t > *tex)
 
static std::map< int, float > meshArea (const AimsSurfaceTriangle &surf, const Texture< int16_t > &tex)
 
static float meshVolume (const AimsSurfaceTriangle &surf)
 
static float meshVolume (const AimsSurface< 3, Void > &surf)
 
template<int D, class T >
static void meshMerge (AimsTimeSurface< D, T > &dst, const AimsTimeSurface< D, T > &add)
 concatenates 2 meshes into one (adds the second to the first one) More...
 
template<int D, class T >
static void meshMerge (AimsTimeSurface< D, T > &dst, const std::list< AimsTimeSurface< D, T > > &src)
 concatenates several meshes (src) into a single one (dst) More...
 
template<int D, typename T >
static void meshTransform (AimsTimeSurface< D, T > &mesh, const Motion &trans)
 Applies a transformation to a mesh. More...
 
template<int D, typename T >
static AimsTimeSurface< D, T > * meshExtract (const AimsTimeSurface< D, T > &mesh, const TimeTexture< int16_t > &tex, int16_t value, std::vector< size_t > **overtIndex=0)
 Extracts a sub-mesh region from a label texture. More...
 
template<typename T >
static AimsSurface< 2, Void > * meshTextureBoundary (const AimsSurface< 3, Void > &mesh, const Texture< T > &tex, T region)
 Extracts the boundary of region of value <region> of the input texture, on the mesh. More...
 
template<typename T >
static AimsTimeSurface< 2, Void > * meshTextureBoundary (const AimsSurfaceTriangle &mesh, const TimeTexture< T > &tex, T region)
 Extracts the boundary of region of value <region> of the input texture, on the mesh. More...
 
static Point3df nearestPointToMesh (const Point3df &pos, const AimsSurfaceTriangle &mesh, unsigned nneighbours=1, unsigned *index=0)
 computes the position of the point in the mesh nearest to the given position, averaging across the nneighbours nearest vertices. More...
 
static AimsSurfaceTrianglerefineMeshTri4 (const AimsSurfaceTriangle &mesh, const std::vector< uint > &selectedPolygons=std::vector< uint >())
 Refine a mesh by subdivising every triangle into 4 smaller ones. More...
 
template<int D, typename T >
static TimeTexture< float > * meshDensity (const AimsTimeSurface< D, T > &mesh, bool asDistance=false)
 Calculate a mesh density: inverse of the average edges distance If asDistance is true, then the average distance is returned instead of the density. More...
 
template<int D, typename T >
static TimeTexture< float > * meshEdgeLengthRatioTexture (const AimsTimeSurface< D, T > &nummesh, const AimsTimeSurface< D, T > &denommesh)
 Calculate an edge length ratio in edges of two meshes with the same topology. More...
 
static bool checkMeshIntersect (const AimsSurfaceTriangle &, const AimsSurfaceTriangle &)
 Checks if two meshes intersect. More...
 
static std::vector< Point3df > * lineDirections (const AimsTimeSurface< 2, Void > &)
 calculate directions of a line mesh, fora each vertex More...
 
template<int D, typename T >
static void sortPolygonsAlongDirection (AimsTimeSurface< D, T > &mesh, int timestep, const Point3df &direction)
 Sort polygons along a given direction. More...
 
template<int D, typename T >
static void rasterizeMeshWireframe (const AimsTimeSurface< D, T > &mesh, carto::rc_ptr< carto::Volume< int16_t > > &volume, int value=1)
 Rasterize polygons edges into a volume. More...
 
static void rasterizeMesh (const AimsTimeSurface< 3, Void > &mesh, carto::rc_ptr< carto::Volume< int16_t > > &volume, int value=2)
 Rasterize polygons into a volume. More...
 
template<typename T >
static void rasterizeLine (const Point3df &p0, const Point3df &direction, float lmax, T &volume, int value)
 T should be carto::Volume<int16_t> or BucketMap<Void>::Bucket. More...
 
template<int D, typename T >
static std::pair< carto::rc_ptr< AimsTimeSurface< D, Void > >, carto::rc_ptr< TimeTexture< T > > > splitTexturedMesh (const AimsTimeSurface< D, T > &texmesh)
 Split a textured mesh into a mesh and a texture. More...
 
template<int D, typename T >
static carto::rc_ptr< AimsTimeSurface< D, T > > joinTexturedMesh (const AimsTimeSurface< D, Void > &mesh, const TimeTexture< T > &texture)
 Join a mesh and a texture into a textured mesh. More...
 

Detailed Description

Definition at line 61 of file surfacemanip.h.

Member Function Documentation

◆ checkMesh()

static bool aims::SurfaceManip::checkMesh ( const AimsSurfaceTriangle insurf,
AimsSurfaceTriangle outsurf = 0 
)
static

Check mesh for intersecting triangles.

If outsurf is not null and intersecting triangles do exist, outsurf is used to store a corrected mesh

◆ checkMeshIntersect()

static bool aims::SurfaceManip::checkMeshIntersect ( const AimsSurfaceTriangle ,
const AimsSurfaceTriangle  
)
static

Checks if two meshes intersect.

◆ cutMesh() [1/10]

static void aims::SurfaceManip::cutMesh ( const AimsSurface< 3, Void > &  insurf,
const Point4df plane,
AimsTimeSurface< 2, Void > &  borderline 
)
static

This variant only computes the border line.

◆ cutMesh() [2/10]

static void aims::SurfaceManip::cutMesh ( const AimsSurfaceTriangle insurf,
const Point4df plane,
AimsSurfaceTriangle cut,
AimsSurfaceTriangle planemesh,
AimsTimeSurface< 2, Void > &  borderline,
bool  checkplane = true 
)
static

◆ cutMesh() [3/10]

static void aims::SurfaceManip::cutMesh ( const AimsSurfaceTriangle insurf,
const Point4df plane,
AimsSurfaceTriangle cut,
AimsSurfaceTriangle planemesh,
AimsTimeSurface< 2, Void > &  borderline,
bool  meshplane,
bool  checkplane 
)
static

◆ cutMesh() [4/10]

static void aims::SurfaceManip::cutMesh ( const AimsSurfaceTriangle insurf,
const Point4df plane,
AimsSurfaceTriangle cut,
AimsSurfaceTriangle planemesh,
bool  checkplane = true 
)
static

◆ cutMesh() [5/10]

static void aims::SurfaceManip::cutMesh ( const AimsSurfaceTriangle insurf,
const Point4df plane,
AimsSurfaceTriangle cut,
AimsTimeSurface< 2, Void > &  borderline 
)
static

◆ cutMesh() [6/10]

static void aims::SurfaceManip::cutMesh ( const AimsSurfaceTriangle insurf,
const Point4df plane,
AimsTimeSurface< 2, Void > &  borderline,
int  timestep = 0 
)
static

This variant only computes the border line.

◆ cutMesh() [7/10]

static void aims::SurfaceManip::cutMesh ( const std::vector< const AimsSurfaceTriangle * > &  insurf,
const Point4df plane,
std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &  cut,
AimsSurfaceTriangle planemesh,
AimsTimeSurface< 2, Void > &  borderline,
bool  checkplane = true 
)
static

◆ cutMesh() [8/10]

static void aims::SurfaceManip::cutMesh ( const std::vector< const AimsSurfaceTriangle * > &  insurf,
const Point4df plane,
std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &  cut,
AimsSurfaceTriangle planemesh,
AimsTimeSurface< 2, Void > &  borderline,
bool  meshplane,
bool  checkplane 
)
static

◆ cutMesh() [9/10]

static void aims::SurfaceManip::cutMesh ( const std::vector< const AimsSurfaceTriangle * > &  insurf,
const Point4df plane,
std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &  cut,
AimsSurfaceTriangle planemesh,
bool  checkplane = true 
)
static

◆ cutMesh() [10/10]

static void aims::SurfaceManip::cutMesh ( const std::vector< const AimsSurfaceTriangle * > &  insurf,
const Point4df plane,
std::vector< carto::rc_ptr< AimsSurfaceTriangle > > &  cut,
AimsTimeSurface< 2, Void > &  borderline 
)
static

◆ invertSurfacePolygons()

template<int D, class T >
void aims::SurfaceManip::invertSurfacePolygons ( AimsTimeSurface< D, T > &  surface)
static

Definition at line 134 of file surfacemanip_d.h.

References AimsSurface< D, T >::polygon().

Referenced by meshTransform().

◆ joinTexturedMesh()

template<int D, typename T >
carto::rc_ptr< AimsTimeSurface< D, T > > aims::SurfaceManip::joinTexturedMesh ( const AimsTimeSurface< D, Void > &  mesh,
const TimeTexture< T > &  texture 
)
static

◆ lineDirections()

static std::vector<Point3df>* aims::SurfaceManip::lineDirections ( const AimsTimeSurface< 2, Void > &  )
static

calculate directions of a line mesh, fora each vertex

◆ meshArea() [1/5]

static float aims::SurfaceManip::meshArea ( const AimsSurface< 3, Void > &  surf)
static

◆ meshArea() [2/5]

static std::map<int, float> aims::SurfaceManip::meshArea ( const AimsSurface< 3, Void > &  surf,
const Texture< int16_t > *  tex 
)
static

◆ meshArea() [3/5]

static float aims::SurfaceManip::meshArea ( const AimsSurfaceTriangle surf)
static

◆ meshArea() [4/5]

static std::map<int, float> aims::SurfaceManip::meshArea ( const AimsSurfaceTriangle surf,
const Texture< int16_t > &  tex 
)
static

◆ meshArea() [5/5]

static std::map<int, float> aims::SurfaceManip::meshArea ( const AimsSurfaceTriangle surf,
const TimeTexture< int16_t > &  tex 
)
static

◆ meshDensity()

template<int D, typename T >
TimeTexture< float > * aims::SurfaceManip::meshDensity ( const AimsTimeSurface< D, T > &  mesh,
bool  asDistance = false 
)
static

Calculate a mesh density: inverse of the average edges distance If asDistance is true, then the average distance is returned instead of the density.

Definition at line 373 of file surfacemanip_d.h.

References norm(), AimsSurface< D, T >::polygon(), and AimsSurface< D, T >::vertex().

◆ meshEdgeLengthRatioTexture()

template<int D, typename T >
TimeTexture< float > * aims::SurfaceManip::meshEdgeLengthRatioTexture ( const AimsTimeSurface< D, T > &  nummesh,
const AimsTimeSurface< D, T > &  denommesh 
)
static

Calculate an edge length ratio in edges of two meshes with the same topology.

The max length ratios of edges is kept for each vertex

Definition at line 435 of file surfacemanip_d.h.

References norm(), AimsSurface< D, T >::polygon(), and AimsSurface< D, T >::vertex().

◆ meshExtract()

template<int D, typename T >
AimsTimeSurface< D, T > * aims::SurfaceManip::meshExtract ( const AimsTimeSurface< D, T > &  mesh,
const TimeTexture< int16_t > &  tex,
int16_t  value,
std::vector< size_t > **  overtIndex = 0 
)
static

◆ meshMerge() [1/2]

template<int D, class T >
void aims::SurfaceManip::meshMerge ( AimsTimeSurface< D, T > &  dst,
const AimsTimeSurface< D, T > &  add 
)
static

◆ meshMerge() [2/2]

template<int D, class T >
void aims::SurfaceManip::meshMerge ( AimsTimeSurface< D, T > &  dst,
const std::list< AimsTimeSurface< D, T > > &  src 
)
static

concatenates several meshes (src) into a single one (dst)

Definition at line 198 of file surfacemanip_d.h.

References AimsTimeSurface< D, T >::erase(), and meshMerge().

◆ meshPlanarPolygon()

static void aims::SurfaceManip::meshPlanarPolygon ( const Point4df plane,
const AimsTimeSurface< 2, Void > &  border,
AimsSurfaceTriangle outmesh 
)
static

◆ meshTextureBoundary() [1/2]

template<typename T >
AimsSurface< 2, Void > * aims::SurfaceManip::meshTextureBoundary ( const AimsSurface< 3, Void > &  mesh,
const Texture< T > &  tex,
region 
)
static

Extracts the boundary of region of value <region> of the input texture, on the mesh.

If region is negative, take boundaries of all regions. The input texture is a label texture.

Definition at line 531 of file surfacemanip_d.h.

References AimsSurface< D, T >::polygon(), AimsVector< class, D >::size(), aims::internal::take_mid_point_and_insert(), and AimsSurface< D, T >::vertex().

Referenced by meshTextureBoundary().

◆ meshTextureBoundary() [2/2]

template<typename T >
AimsTimeSurface< 2, Void > * aims::SurfaceManip::meshTextureBoundary ( const AimsSurfaceTriangle mesh,
const TimeTexture< T > &  tex,
region 
)
static

Extracts the boundary of region of value <region> of the input texture, on the mesh.

If region is negative, take boundaries of all regions. The input texture is a label texture.

Definition at line 637 of file surfacemanip_d.h.

References meshTextureBoundary().

◆ meshTransform()

template<int D, class T >
void aims::SurfaceManip::meshTransform ( AimsTimeSurface< D, T > &  mesh,
const Motion trans 
)
static

◆ meshVolume() [1/2]

static float aims::SurfaceManip::meshVolume ( const AimsSurface< 3, Void > &  surf)
static

◆ meshVolume() [2/2]

static float aims::SurfaceManip::meshVolume ( const AimsSurfaceTriangle surf)
static

◆ nearestPointToMesh()

static Point3df aims::SurfaceManip::nearestPointToMesh ( const Point3df pos,
const AimsSurfaceTriangle mesh,
unsigned  nneighbours = 1,
unsigned *  index = 0 
)
static

computes the position of the point in the mesh nearest to the given position, averaging across the nneighbours nearest vertices.

The optional index parameter will contain, when given, the index of the nearest mesh vertex

◆ rasterizeLine()

template<typename T >
static void aims::SurfaceManip::rasterizeLine ( const Point3df p0,
const Point3df direction,
float  lmax,
T &  volume,
int  value 
)
static

T should be carto::Volume<int16_t> or BucketMap<Void>::Bucket.

Moreover, coordinates should be already be divided by the voxel size

Referenced by rasterizeMeshWireframe().

◆ rasterizeMesh()

static void aims::SurfaceManip::rasterizeMesh ( const AimsTimeSurface< 3, Void > &  mesh,
carto::rc_ptr< carto::Volume< int16_t > > &  volume,
int  value = 2 
)
static

Rasterize polygons into a volume.

◆ rasterizeMeshWireframe()

template<int D, typename T >
void aims::SurfaceManip::rasterizeMeshWireframe ( const AimsTimeSurface< D, T > &  mesh,
carto::rc_ptr< carto::Volume< int16_t > > &  volume,
int  value = 1 
)
static

◆ refineMeshTri4()

static AimsSurfaceTriangle* aims::SurfaceManip::refineMeshTri4 ( const AimsSurfaceTriangle mesh,
const std::vector< uint > &  selectedPolygons = std::vector< uint >() 
)
static

Refine a mesh by subdivising every triangle into 4 smaller ones.

If selectedPolygons is specified (non-empty), it should contain polygons indices which must specifically be refined, the remaining ones will stay unchanged.

◆ sortPolygonsAlongDirection()

template<int D, typename T >
void aims::SurfaceManip::sortPolygonsAlongDirection ( AimsTimeSurface< D, T > &  mesh,
int  timestep,
const Point3df direction 
)
static

Sort polygons along a given direction.

Polygons centers will be used for sorting. Only one timestep is performed (to be fast).

Definition at line 691 of file surfacemanip_d.h.

References AimsVector< class, D >::dot(), AimsTimeSurface< D, T >::polygon(), and AimsTimeSurface< D, T >::vertex().

◆ splitTexturedMesh()

◆ surfaceNeighbourDistance()

template<int D, class T >
std::vector< std::map< uint, float > > aims::SurfaceManip::surfaceNeighbourDistance ( const AimsTimeSurface< D, T > &  surf)
static

◆ surfaceNeighbours() [1/2]

template<int D, class T >
std::vector< std::set< uint > > aims::SurfaceManip::surfaceNeighbours ( const AimsSurface< D, T > &  surf)
static

◆ surfaceNeighbours() [2/2]

template<int D, class T >
std::vector< std::set< uint > > aims::SurfaceManip::surfaceNeighbours ( const AimsTimeSurface< D, T > &  surf)
static

◆ surfaceNeighbours2ndOrder()

template<int D, class T >
std::vector< std::set< uint > > aims::SurfaceManip::surfaceNeighbours2ndOrder ( const AimsTimeSurface< D, T > &  surf)
static

The documentation for this class was generated from the following files: