A.I.M.S algorithms


aims::FastMarching< T > Class Template Reference

Fast marching algorithm implementation, for images or buckets. More...

#include <aims/distancemap/fastmarching.h>

Public Types

typedef
internal::fastmarching::StorageTrait
< T >::FloatType 
FloatType
 
typedef
internal::fastmarching::StorageTrait
< T >::RCType 
RCType
 
typedef
internal::fastmarching::StorageTrait
< FloatType >::RCType 
RCFloatType
 

Public Member Functions

 FastMarching (Connectivity::Type c=Connectivity::CONNECTIVITY_26_XYZ, bool mid_interface=false)
 The connectivity type is only used to build the interfaces between the work region and the seeds: the fast marching itself only uses 6-connectivity. More...
 
 ~FastMarching ()
 
void setVerbose (bool x)
 
bool verbose () const
 
RCFloatType doit (const RCType &vol, int16_t worklabel, int16_t inlabel, int16_t outlabel)
 Perform fast marching propagation from a label image "vol". More...
 
RCFloatType doit (const RCType &vol, const std::set< int16_t > &worklabels, const std::set< int16_t > &seedlabels)
 Perform fast marching propagation from a label image "vol". More...
 
const BucketMap< float > & midInterface (int16_t label1, int16_t label2) const
 get the interface between Voronoi regions label1 and label2, as a bucket More...
 
carto::VolumeRef< float > midInterfaceVol (int16_t label1, int16_t label2) const
 get the interface between Voronoi regions label1 and label2, as a volume More...
 
std::vector< std::pair
< int16_t, int16_t > > 
midInterfaceLabels () const
 Voronoi interfaces labels. More...
 
RCType voronoiVol () const
 get the resulting Voronoi regions (after propagation) More...
 
void setSpeedMap (RCFloatType speed)
 sets an initialized speed map. More...
 
void setInvSpeedMap (RCFloatType invspeed)
 sets an initialized inverse speed map (overrides any previous speed map) More...
 
void clearSpeedMap ()
 clear (inverse) speed map More...
 

Detailed Description

template<typename T>
class aims::FastMarching< T >

Fast marching algorithm implementation, for images or buckets.

The fast marching is a propagation algorithm which is typically used to perform distance maps. It may use a speed map to locally change the propagation speed and distance. It may also be used to perform a Voronoi diagam, and to get Voronoi regions boundaries.

It is used the following way: instantiate a FastMarching object, with specified connectivity if needed, set the speed map (or inverse speed map) using setSpeedMap() or setInvSpeedMap() propagate using one of the doit() methods. It will return the distanc map. Voronoi and boundaries can then be retreived using voronoiVol(), midInterface() or midInterfaceVol()

Definition at line 80 of file fastmarching.h.

Member Typedef Documentation

Definition at line 84 of file fastmarching.h.

Definition at line 87 of file fastmarching.h.

template<typename T >
typedef internal::fastmarching::StorageTrait<T>::RCType aims::FastMarching< T >::RCType

Definition at line 85 of file fastmarching.h.

Constructor & Destructor Documentation

template<typename T >
aims::FastMarching< T >::FastMarching ( Connectivity::Type  c = Connectivity::CONNECTIVITY_26_XYZ,
bool  mid_interface = false 
)

The connectivity type is only used to build the interfaces between the work region and the seeds: the fast marching itself only uses 6-connectivity.

If mid_interface is false (the default), voronoi boundaries will not be available after propagation.

template<typename T >
aims::FastMarching< T >::~FastMarching ( )

Member Function Documentation

template<typename T >
void aims::FastMarching< T >::clearSpeedMap ( )

clear (inverse) speed map

template<typename T >
RCFloatType aims::FastMarching< T >::doit ( const RCType vol,
int16_t  worklabel,
int16_t  inlabel,
int16_t  outlabel 
)

Perform fast marching propagation from a label image "vol".

This is a simplified interface to the other, more general, doit() method.

Propagation will take place in the region "worklabel", from seeds "inlabel" and "outlabel".

template<typename T >
RCFloatType aims::FastMarching< T >::doit ( const RCType vol,
const std::set< int16_t > &  worklabels,
const std::set< int16_t > &  seedlabels 
)

Perform fast marching propagation from a label image "vol".

Propagation will take place in the regions listed in "worklabels", from all seeds in the "seedlabels" list.

template<typename T >
const BucketMap<float>& aims::FastMarching< T >::midInterface ( int16_t  label1,
int16_t  label2 
) const

get the interface between Voronoi regions label1 and label2, as a bucket

the mid_interface option must have been used when instantiating the FastMarching object, and propagation maust have taken place.

template<typename T >
std::vector<std::pair<int16_t,int16_t> > aims::FastMarching< T >::midInterfaceLabels ( ) const

Voronoi interfaces labels.

Given as a vector of pairs of labels

template<typename T >
carto::VolumeRef<float> aims::FastMarching< T >::midInterfaceVol ( int16_t  label1,
int16_t  label2 
) const

get the interface between Voronoi regions label1 and label2, as a volume

The mid_interface option must have been used when instantiating the FastMarching object, and propagation maust have taken place.

template<typename T >
void aims::FastMarching< T >::setInvSpeedMap ( RCFloatType  invspeed)

sets an initialized inverse speed map (overrides any previous speed map)

template<typename T >
void aims::FastMarching< T >::setSpeedMap ( RCFloatType  speed)

sets an initialized speed map.

The inverse speed will be deduced from it.

template<typename T >
void aims::FastMarching< T >::setVerbose ( bool  x)
template<typename T >
bool aims::FastMarching< T >::verbose ( ) const
template<typename T >
RCType aims::FastMarching< T >::voronoiVol ( ) const

get the resulting Voronoi regions (after propagation)


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