aimsalgo 6.0.0
Neuroimaging image processing
Mesher Class Reference

#include <aims/mesh/mesher.h>

Public Types

enum  SmoothingType { LAPLACIAN , SIMPLESPRING , POLYGONSPRING , LOWPASS }
 

Public Member Functions

 Mesher ()
 
virtual ~Mesher ()
 
void getInterface (std::map< size_t, std::list< MapOfFacet > > &interface, const carto::rc_ptr< carto::Volume< short > > &thing)
 
void doit (const carto::rc_ptr< carto::Volume< short > > &thing, const std::string &name, const std::string &mode="binar")
 
void doit (const aims::BucketMap< Void > &thing, const std::string &name, const std::string &mode="binar")
 
void doit (const carto::rc_ptr< carto::Volume< short > > &thing, std::map< size_t, std::list< AimsSurfaceTriangle > > &surface)
 
void doit (const aims::BucketMap< Void > &thing, std::map< size_t, std::list< AimsSurfaceTriangle > > &surface)
 
void getBrain (const carto::rc_ptr< carto::Volume< short > > &thing, AimsSurfaceTriangle &surface, bool insideinterface=false)
 
void getBrain (const aims::BucketMap< Void > &thing, AimsSurfaceTriangle &surface, bool insideinterface=false)
 
void getWhite (const carto::rc_ptr< carto::Volume< short > > &thing, AimsSurfaceTriangle &surface)
 
void getWhite (const aims::BucketMap< Void > &thing, AimsSurfaceTriangle &surface)
 
void getSingleLabel (const carto::rc_ptr< carto::Volume< short > > &thing, AimsSurfaceTriangle &surface)
 
void getMeshFromMapOfFacet (const carto::rc_ptr< carto::Volume< short > > &thing, AimsSurfaceTriangle &surface, MapOfFacet &mof)
 
void setSmoothing (SmoothingType smoothType, int smoothIt, float smoothRate)
 Smoothing.
 
void setSmoothingLaplacian (float smoothFeatureAngle)
 
void setSmoothingSpring (float smoothForce)
 
void unsetSmoothing ()
 
void smooth (AimsSurfaceTriangle &surface)
 
void setDecimation (float deciReductionRate, float deciMaxClearance, float deciMaxError, float deciFeatureAngle)
 Decimation.
 
void unsetDecimation ()
 
float decimate (AimsSurfaceTriangle &surface)
 
float decimate (AimsSurfaceTriangle &surface, const std::vector< float > &precthresholds, const TimeTexture< float > &precisionmap)
 Decimation using a precision texture map.
 
void doit (const carto::rc_ptr< carto::Volume< short > > &thing, std::map< size_t, std::list< std::map< short, std::list< AimsSurfaceTriangle > > > > &surface)
 
void doit (const aims::BucketMap< Void > &thing, std::map< size_t, std::list< std::map< short, std::list< AimsSurfaceTriangle > > > > &surface)
 
void setSplitting ()
 
void unsetSplitting ()
 
void setLabelInf (int labelInf)
 
void setLabelSup (int labelSup)
 
void setMinSurface (float minSurface)
 
float surfaceOfInterface (const AimsSurfaceTriangle &surface)
 
void setTriOutputFile () __attribute__((__deprecated__("specify extension in the output filename " "of setMeshOutputFile() or doit()")))
 OBSOLETE - specify extension in the output filename of setMeshOutputFile() or doit()
 
void setMeshOutputFile ()
 
void setMinFacetNumber (uint m)
 
bool verbose () const
 
void setVerbose (bool x)
 

Protected Member Functions

void getReducedNeighOutwardCycles (MapOfFacet &thing)
 
void getExtendedNeighOfFacet (MapOfFacet &thing)
 
void getVertices (const std::vector< Facet * > &vfac, std::vector< Point3df > &vertex, float sizeX, float sizeY, float sizeZ)
 
void getSmoothedVertices (const std::vector< Facet * > &vfac, AimsSurfaceTriangle &surface, float rate)
 
void getSmoothedLaplacian (const std::vector< Facet * > &vfac, AimsSurfaceTriangle &surface, float featureAngle, int nIteration, float rate)
 
void getSmoothedSimpleSpring (const std::vector< Facet * > &vfac, AimsSurfaceTriangle &surface, float force, int nIteration, float rate)
 
void getSmoothedPolygonSpring (const std::vector< Facet * > &vfac, AimsSurfaceTriangle &surface, float force, int nIteration, float rate)
 
void getSmoothedLowPassFilter (const std::vector< Facet * > &vfac, AimsSurfaceTriangle &surface, int nIteration, float rate)
 
void getDecimatedVertices (std::vector< Facet * > &vfac, std::vector< Point3df > &vertex, float reductionRatePercent, float maxClearanceMm, float maxErrorMm, float minFeatureEdgeAngleDegree)
 
void getDecimatedVertices (std::vector< Facet * > &vfac, std::vector< Point3df > &vertex, float reductionRatePercent, float maxClearanceMm, float maxErrorMm, float minFeatureEdgeAngleDegree, const std::vector< float > &thresholds, const TimeTexture< float > *precisionmap=0)
 
float decimate (AimsSurfaceTriangle &surface, const std::vector< float > &thresholds, const TimeTexture< float > *precisionmap)
 
void getNormals (const std::vector< Facet * > &vfac, const std::vector< Point3df > &vertex, std::vector< Point3df > &normal)
 
void getTriangles (const std::vector< Facet * > &vfac, std::vector< AimsVector< uint, 3 > > &triangle)
 
void splitting (const carto::rc_ptr< carto::Volume< short > > &thing, const std::vector< Facet * > &vfac, const AimsSurfaceTriangle &surface, std::map< short, std::list< AimsSurfaceTriangle > > &splitted)
 
void getFacet (const AimsSurfaceTriangle &surface, std::vector< Facet * > &vfac)
 
void clear (std::map< size_t, std::list< MapOfFacet > > &interface)
 

Static Protected Member Functions

static carto::VolumeRef< int16_t > reshapedVolume (const carto::VolumeRef< int16_t > in_vol)
 reshape (if needed) the input volume to add a border filled with -1
 

Protected Attributes

bool _smoothFlag
 
int _smoothIt
 
float _smoothRate
 
float _smoothFeatureAngle
 
float _smoothForce
 
SmoothingType _smoothType
 
bool _deciFlag
 
float _deciReductionRate
 
float _deciMaxClearance
 
float _deciMaxError
 
float _deciFeatureAngle
 
bool _splittingFlag
 
int _labelInf
 
int _labelSup
 
float _minSurface
 
bool _triOutputFlag
 
uint _minFacetNumber
 
bool _verbose
 

Detailed Description

Definition at line 52 of file mesher.h.

Member Enumeration Documentation

◆ SmoothingType

Enumerator
LAPLACIAN 
SIMPLESPRING 
POLYGONSPRING 
LOWPASS 

Definition at line 55 of file mesher.h.

Constructor & Destructor Documentation

◆ Mesher()

◆ ~Mesher()

virtual Mesher::~Mesher ( )
inlinevirtual

Definition at line 81 of file mesher.h.

Member Function Documentation

◆ clear()

void Mesher::clear ( std::map< size_t, std::list< MapOfFacet > > & interface)
protected

◆ decimate() [1/3]

float Mesher::decimate ( AimsSurfaceTriangle & surface)

◆ decimate() [2/3]

float Mesher::decimate ( AimsSurfaceTriangle & surface,
const std::vector< float > & precthresholds,
const TimeTexture< float > & precisionmap )

Decimation using a precision texture map.

In this mode, the texture values are checked according to the precision thresholds, and vertices above the threshold are not removed. A time texture may be provided if a step-by-step evolution is needed. Similarly, the thresholds may evolve with decimation timesteps. precisionmap and thresholds may have differing sizes (they are clamped if overrun).

◆ decimate() [3/3]

float Mesher::decimate ( AimsSurfaceTriangle & surface,
const std::vector< float > & thresholds,
const TimeTexture< float > * precisionmap )
protected

◆ doit() [1/6]

void Mesher::doit ( const aims::BucketMap< Void > & thing,
const std::string & name,
const std::string & mode = "binar" )

◆ doit() [2/6]

void Mesher::doit ( const aims::BucketMap< Void > & thing,
std::map< size_t, std::list< AimsSurfaceTriangle > > & surface )

◆ doit() [3/6]

void Mesher::doit ( const aims::BucketMap< Void > & thing,
std::map< size_t, std::list< std::map< short, std::list< AimsSurfaceTriangle > > > > & surface )

◆ doit() [4/6]

void Mesher::doit ( const carto::rc_ptr< carto::Volume< short > > & thing,
const std::string & name,
const std::string & mode = "binar" )

◆ doit() [5/6]

void Mesher::doit ( const carto::rc_ptr< carto::Volume< short > > & thing,
std::map< size_t, std::list< AimsSurfaceTriangle > > & surface )

◆ doit() [6/6]

void Mesher::doit ( const carto::rc_ptr< carto::Volume< short > > & thing,
std::map< size_t, std::list< std::map< short, std::list< AimsSurfaceTriangle > > > > & surface )

◆ getBrain() [1/2]

void Mesher::getBrain ( const aims::BucketMap< Void > & thing,
AimsSurfaceTriangle & surface,
bool insideinterface = false )

◆ getBrain() [2/2]

void Mesher::getBrain ( const carto::rc_ptr< carto::Volume< short > > & thing,
AimsSurfaceTriangle & surface,
bool insideinterface = false )

◆ getDecimatedVertices() [1/2]

void Mesher::getDecimatedVertices ( std::vector< Facet * > & vfac,
std::vector< Point3df > & vertex,
float reductionRatePercent,
float maxClearanceMm,
float maxErrorMm,
float minFeatureEdgeAngleDegree )
protected

◆ getDecimatedVertices() [2/2]

void Mesher::getDecimatedVertices ( std::vector< Facet * > & vfac,
std::vector< Point3df > & vertex,
float reductionRatePercent,
float maxClearanceMm,
float maxErrorMm,
float minFeatureEdgeAngleDegree,
const std::vector< float > & thresholds,
const TimeTexture< float > * precisionmap = 0 )
protected

◆ getExtendedNeighOfFacet()

void Mesher::getExtendedNeighOfFacet ( MapOfFacet & thing)
protected

◆ getFacet()

void Mesher::getFacet ( const AimsSurfaceTriangle & surface,
std::vector< Facet * > & vfac )
protected

◆ getInterface()

void Mesher::getInterface ( std::map< size_t, std::list< MapOfFacet > > & interface,
const carto::rc_ptr< carto::Volume< short > > & thing )

◆ getMeshFromMapOfFacet()

void Mesher::getMeshFromMapOfFacet ( const carto::rc_ptr< carto::Volume< short > > & thing,
AimsSurfaceTriangle & surface,
MapOfFacet & mof )

◆ getNormals()

void Mesher::getNormals ( const std::vector< Facet * > & vfac,
const std::vector< Point3df > & vertex,
std::vector< Point3df > & normal )
protected

◆ getReducedNeighOutwardCycles()

void Mesher::getReducedNeighOutwardCycles ( MapOfFacet & thing)
protected

◆ getSingleLabel()

void Mesher::getSingleLabel ( const carto::rc_ptr< carto::Volume< short > > & thing,
AimsSurfaceTriangle & surface )

◆ getSmoothedLaplacian()

void Mesher::getSmoothedLaplacian ( const std::vector< Facet * > & vfac,
AimsSurfaceTriangle & surface,
float featureAngle,
int nIteration,
float rate )
protected

◆ getSmoothedLowPassFilter()

void Mesher::getSmoothedLowPassFilter ( const std::vector< Facet * > & vfac,
AimsSurfaceTriangle & surface,
int nIteration,
float rate )
protected

◆ getSmoothedPolygonSpring()

void Mesher::getSmoothedPolygonSpring ( const std::vector< Facet * > & vfac,
AimsSurfaceTriangle & surface,
float force,
int nIteration,
float rate )
protected

◆ getSmoothedSimpleSpring()

void Mesher::getSmoothedSimpleSpring ( const std::vector< Facet * > & vfac,
AimsSurfaceTriangle & surface,
float force,
int nIteration,
float rate )
protected

◆ getSmoothedVertices()

void Mesher::getSmoothedVertices ( const std::vector< Facet * > & vfac,
AimsSurfaceTriangle & surface,
float rate )
protected

◆ getTriangles()

void Mesher::getTriangles ( const std::vector< Facet * > & vfac,
std::vector< AimsVector< uint, 3 > > & triangle )
protected

◆ getVertices()

void Mesher::getVertices ( const std::vector< Facet * > & vfac,
std::vector< Point3df > & vertex,
float sizeX,
float sizeY,
float sizeZ )
protected

◆ getWhite() [1/2]

void Mesher::getWhite ( const aims::BucketMap< Void > & thing,
AimsSurfaceTriangle & surface )

◆ getWhite() [2/2]

void Mesher::getWhite ( const carto::rc_ptr< carto::Volume< short > > & thing,
AimsSurfaceTriangle & surface )

◆ reshapedVolume()

static carto::VolumeRef< int16_t > Mesher::reshapedVolume ( const carto::VolumeRef< int16_t > in_vol)
staticprotected

reshape (if needed) the input volume to add a border filled with -1

◆ setDecimation()

void Mesher::setDecimation ( float deciReductionRate,
float deciMaxClearance,
float deciMaxError,
float deciFeatureAngle )

Decimation.

default : deciReductionRate = 99.0 % deciMaxClearance = 3.0 deciMaxError = 0.2 deciFeatureAngle = 180.0 deg

Referenced by aims::ClusterArgMaker::make().

◆ setLabelInf()

void Mesher::setLabelInf ( int labelInf)
inline

Definition at line 169 of file mesher.h.

References _labelInf.

◆ setLabelSup()

void Mesher::setLabelSup ( int labelSup)
inline

Definition at line 170 of file mesher.h.

References _labelSup.

◆ setMeshOutputFile()

void Mesher::setMeshOutputFile ( )
inline

Definition at line 185 of file mesher.h.

References _triOutputFlag.

◆ setMinFacetNumber()

void Mesher::setMinFacetNumber ( uint m)
inline

Definition at line 189 of file mesher.h.

References _minFacetNumber.

Referenced by aims::ClusterArgMaker::make().

◆ setMinSurface()

void Mesher::setMinSurface ( float minSurface)
inline

Definition at line 174 of file mesher.h.

References _minSurface.

◆ setSmoothing()

void Mesher::setSmoothing ( SmoothingType smoothType,
int smoothIt,
float smoothRate )

Smoothing.

default : smoothType = LOWPASS (other values are LAPLACIAN, SIMPLESPRING, POLYGONSPRING) smoothIt = 30 smoothRate in [0.0;1.0] (instance : 0.4) smoothForce in [0.0;1.0] (instance : 0.2)

Referenced by aims::ClusterArgMaker::make().

◆ setSmoothingLaplacian()

void Mesher::setSmoothingLaplacian ( float smoothFeatureAngle)

◆ setSmoothingSpring()

void Mesher::setSmoothingSpring ( float smoothForce)

◆ setSplitting()

void Mesher::setSplitting ( )

◆ setTriOutputFile()

void Mesher::setTriOutputFile ( )
inline

OBSOLETE - specify extension in the output filename of setMeshOutputFile() or doit()

Definition at line 181 of file mesher.h.

References _triOutputFlag.

◆ setVerbose()

void Mesher::setVerbose ( bool x)
inline

Definition at line 192 of file mesher.h.

References _verbose.

◆ smooth()

void Mesher::smooth ( AimsSurfaceTriangle & surface)

◆ splitting()

void Mesher::splitting ( const carto::rc_ptr< carto::Volume< short > > & thing,
const std::vector< Facet * > & vfac,
const AimsSurfaceTriangle & surface,
std::map< short, std::list< AimsSurfaceTriangle > > & splitted )
protected

◆ surfaceOfInterface()

float Mesher::surfaceOfInterface ( const AimsSurfaceTriangle & surface)

◆ unsetDecimation()

void Mesher::unsetDecimation ( )

◆ unsetSmoothing()

void Mesher::unsetSmoothing ( )

◆ unsetSplitting()

void Mesher::unsetSplitting ( )

◆ verbose()

bool Mesher::verbose ( ) const
inline

Definition at line 191 of file mesher.h.

References _verbose.

Member Data Documentation

◆ _deciFeatureAngle

float Mesher::_deciFeatureAngle
protected

Definition at line 207 of file mesher.h.

Referenced by Mesher().

◆ _deciFlag

bool Mesher::_deciFlag
protected

Definition at line 203 of file mesher.h.

Referenced by Mesher().

◆ _deciMaxClearance

float Mesher::_deciMaxClearance
protected

Definition at line 205 of file mesher.h.

Referenced by Mesher().

◆ _deciMaxError

float Mesher::_deciMaxError
protected

Definition at line 206 of file mesher.h.

Referenced by Mesher().

◆ _deciReductionRate

float Mesher::_deciReductionRate
protected

Definition at line 204 of file mesher.h.

Referenced by Mesher().

◆ _labelInf

int Mesher::_labelInf
protected

Definition at line 211 of file mesher.h.

Referenced by Mesher(), and setLabelInf().

◆ _labelSup

int Mesher::_labelSup
protected

Definition at line 212 of file mesher.h.

Referenced by Mesher(), and setLabelSup().

◆ _minFacetNumber

uint Mesher::_minFacetNumber
protected

Definition at line 218 of file mesher.h.

Referenced by Mesher(), and setMinFacetNumber().

◆ _minSurface

float Mesher::_minSurface
protected

Definition at line 214 of file mesher.h.

Referenced by Mesher(), and setMinSurface().

◆ _smoothFeatureAngle

float Mesher::_smoothFeatureAngle
protected

Definition at line 199 of file mesher.h.

Referenced by Mesher().

◆ _smoothFlag

bool Mesher::_smoothFlag
protected

Definition at line 196 of file mesher.h.

Referenced by Mesher().

◆ _smoothForce

float Mesher::_smoothForce
protected

Definition at line 200 of file mesher.h.

Referenced by Mesher().

◆ _smoothIt

int Mesher::_smoothIt
protected

Definition at line 197 of file mesher.h.

Referenced by Mesher().

◆ _smoothRate

float Mesher::_smoothRate
protected

Definition at line 198 of file mesher.h.

Referenced by Mesher().

◆ _smoothType

SmoothingType Mesher::_smoothType
protected

Definition at line 201 of file mesher.h.

Referenced by Mesher().

◆ _splittingFlag

bool Mesher::_splittingFlag
protected

Definition at line 209 of file mesher.h.

Referenced by Mesher().

◆ _triOutputFlag

bool Mesher::_triOutputFlag
protected

Definition at line 216 of file mesher.h.

Referenced by Mesher(), setMeshOutputFile(), and setTriOutputFile().

◆ _verbose

bool Mesher::_verbose
protected

Definition at line 220 of file mesher.h.

Referenced by Mesher(), setVerbose(), and verbose().


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