aimsalgo  5.0.5
Neuroimaging image processing
aims::GradientAdvection Class Reference

Propagate labels along a vector field. More...

#include <aims/distancemap/advection.h>

Public Member Functions

 GradientAdvection ()
 
virtual ~GradientAdvection ()
 
void setVerbose (bool=true)
 
void setPropagationThreshold (float)
 
carto::VolumeRef< int16_t > doit (const carto::VolumeRef< int16_t > &label_vol, const carto::VolumeRef< float > &gradX, const carto::VolumeRef< float > &gradY, const carto::VolumeRef< float > &gradZ, int16_t seedlabel)
 Propagate a region using an overlap criterion. More...
 
carto::VolumeRef< int16_t > propagate_all_labels (const carto::VolumeRef< int16_t > &seeds, const carto::VolumeRef< float > &fieldx, const carto::VolumeRef< float > &fieldy, const carto::VolumeRef< float > &fieldz)
 Propagate labels using the local direcion of a vector field. More...
 
carto::VolumeRef< int16_t > descend_scalar_field (const carto::VolumeRef< int16_t > &seeds, const carto::VolumeRef< float > &field)
 Propagate labels along the gradient of a scalar field. More...
 

Static Public Attributes

static const float default_propagation_threshold
 

Detailed Description

Propagate labels along a vector field.

Labels are propagated in a front that grows from the seeds. Only the immediate neighbours of a voxel are considered when deciding whether to include it in a region. This makes the algorithm fast, but the direction of propagation is approximate.

Interpretation of labels in the seed volume
  • zero: propagation zone;
  • positive: seed, should be propagated;
  • negative: forbidden region, will not be propagated, and nothing will be propagated here.

Definition at line 57 of file advection.h.

Constructor & Destructor Documentation

◆ GradientAdvection()

aims::GradientAdvection::GradientAdvection ( )

◆ ~GradientAdvection()

virtual aims::GradientAdvection::~GradientAdvection ( )
virtual

Member Function Documentation

◆ descend_scalar_field()

carto::VolumeRef<int16_t> aims::GradientAdvection::descend_scalar_field ( const carto::VolumeRef< int16_t > &  seeds,
const carto::VolumeRef< float > &  field 
)

Propagate labels along the gradient of a scalar field.

Each voxel is assigned the seed label of its maximum 26-neighbour.

Warning
This probably makes little sense for non-isotropic voxels.

◆ doit()

carto::VolumeRef<int16_t> aims::GradientAdvection::doit ( const carto::VolumeRef< int16_t > &  label_vol,
const carto::VolumeRef< float > &  gradX,
const carto::VolumeRef< float > &  gradY,
const carto::VolumeRef< float > &  gradZ,
int16_t  seedlabel 
)

Propagate a region using an overlap criterion.

Warning
This experimental method currently works in 2D only. Read the code!
Returns
The returned volume contains 1 where the region has propagated, -1 in forbidden regions and 0 elsewhere.

◆ propagate_all_labels()

carto::VolumeRef<int16_t> aims::GradientAdvection::propagate_all_labels ( const carto::VolumeRef< int16_t > &  seeds,
const carto::VolumeRef< float > &  fieldx,
const carto::VolumeRef< float > &  fieldy,
const carto::VolumeRef< float > &  fieldz 
)

Propagate labels using the local direcion of a vector field.

Each voxel is assigned the seed label of the 26-neighbour that the local field points to. More precisely, the field is normalized using the maximum norm, then rounded to the nearest integral voxel coordinates.

Warning
This method was only tested for isotropic voxels.

◆ setPropagationThreshold()

void aims::GradientAdvection::setPropagationThreshold ( float  )

◆ setVerbose()

void aims::GradientAdvection::setVerbose ( bool  = true)

Member Data Documentation

◆ default_propagation_threshold

const float aims::GradientAdvection::default_propagation_threshold
static

Definition at line 106 of file advection.h.


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