VMTK
Loading...
Searching...
No Matches
vtkvmtkMedialCurveFilter Class Reference

Performs flux-driven automatic centerline extraction from a surface. More...

#include <vtkvmtkMedialCurveFilter.h>

Inheritance diagram for vtkvmtkMedialCurveFilter:
[legend]
Collaboration diagram for vtkvmtkMedialCurveFilter:
[legend]

Public Types

typedef vtkSimpleImageToImageFilter Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkMedialCurveFilter * NewInstance () const
virtual double GetSigma ()
virtual void SetSigma (double)
virtual double GetThreshold ()
virtual void SetThreshold (double)

Static Public Member Functions

static vtkvmtkMedialCurveFilter * New ()
static int IsTypeOf (const char *type)
static vtkvmtkMedialCurveFilter * SafeDownCast (vtkObjectBase *o)

Protected Member Functions

virtual vtkObjectBase * NewInstanceInternal () const
 vtkvmtkMedialCurveFilter ()
 ~vtkvmtkMedialCurveFilter ()
virtual void SimpleExecute (vtkImageData *input, vtkImageData *output) override

Protected Attributes

double Sigma
double Threshold

Detailed Description

Performs flux-driven automatic centerline extraction from a surface.

Please see http://www.insight-journal.org/browse/publication/165 for source implementation.

Implementation of the flux driven automatic centerline extraction algorithm proposed by Bouix et al. in 2004. This is based on a skeletonisation algorithm initially proposed by Siddiqi et al. in 2002, using properties of an average outward flux measure to distinguish skeletal points from non-skeletal ones. This information is combined with a topology preserving thinning procedure to obtain the final result. This implementation combines this skeletonisation algorithm with other techniques as described in the paper of Bouix et al. to produce an ITK filter that generates as output the skeleton, as a binary object represented in an image, of the input surface, represented as a distance transform image. In this work is described this medial curve extraction procedure following the ITK philosophy.

Definition at line 44 of file vtkvmtkMedialCurveFilter.h.

Member Typedef Documentation

◆ Superclass

typedef vtkSimpleImageToImageFilter vtkvmtkMedialCurveFilter::Superclass

Definition at line 49 of file vtkvmtkMedialCurveFilter.h.

Constructor & Destructor Documentation

◆ vtkvmtkMedialCurveFilter()

vtkvmtkMedialCurveFilter::vtkvmtkMedialCurveFilter ( )
protected

Definition at line 46 of file vtkvmtkMedialCurveFilter.cxx.

47{
48 this->Sigma = 0.5;
49 this->Threshold = 0.0;
50}

◆ ~vtkvmtkMedialCurveFilter()

vtkvmtkMedialCurveFilter::~vtkvmtkMedialCurveFilter ( )
protected

Definition at line 52 of file vtkvmtkMedialCurveFilter.cxx.

52{}

Member Function Documentation

◆ New()

vtkvmtkMedialCurveFilter * vtkvmtkMedialCurveFilter::New ( )
static

◆ IsTypeOf()

int vtkvmtkMedialCurveFilter::IsTypeOf ( const char * type)
static

◆ IsA()

virtual int vtkvmtkMedialCurveFilter::IsA ( const char * type)
virtual

◆ SafeDownCast()

vtkvmtkMedialCurveFilter * vtkvmtkMedialCurveFilter::SafeDownCast ( vtkObjectBase * o)
static

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkMedialCurveFilter::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkMedialCurveFilter * vtkvmtkMedialCurveFilter::NewInstance ( ) const

◆ GetSigma()

virtual double vtkvmtkMedialCurveFilter::GetSigma ( )
virtual

Set/get the standard deviation (in physical units) of the Gaussian kernel used to smooth the input distance map before computing its gradient and average outward flux. A light amount of smoothing improves the quality of the flux estimate driving the skeletonization. Default: 0.5.

◆ SetSigma()

virtual void vtkvmtkMedialCurveFilter::SetSigma ( double )
virtual

Set/get the standard deviation (in physical units) of the Gaussian kernel used to smooth the input distance map before computing its gradient and average outward flux. A light amount of smoothing improves the quality of the flux estimate driving the skeletonization. Default: 0.5.

◆ GetThreshold()

virtual double vtkvmtkMedialCurveFilter::GetThreshold ( )
virtual

Set/get the average outward flux threshold below which a point is classified as a skeletal (medial curve) point during the topology-preserving thinning procedure. Default: 0.0.

◆ SetThreshold()

virtual void vtkvmtkMedialCurveFilter::SetThreshold ( double )
virtual

Set/get the average outward flux threshold below which a point is classified as a skeletal (medial curve) point during the topology-preserving thinning procedure. Default: 0.0.

◆ SimpleExecute()

void vtkvmtkMedialCurveFilter::SimpleExecute ( vtkImageData * input,
vtkImageData * output )
overrideprotectedvirtual

Definition at line 55 of file vtkvmtkMedialCurveFilter.cxx.

56{
57 typedef itk::Image<unsigned char, 3> UnsignedCharImageType;
58 typedef itk::Image<float, 3> FloatImageType;
59 typedef float PixelType;
60 typedef itk::Image<PixelType, 3> ImageType;
61
62 UnsignedCharImageType::Pointer inImage = UnsignedCharImageType::New();
63
65
66 typedef itk::ApproximateSignedDistanceMapImageFilter<UnsignedCharImageType, FloatImageType> ApproximateSignedDistanceMapImageFilterType;
67 ApproximateSignedDistanceMapImageFilterType::Pointer approximateSignedDistanceMapImageFilter = ApproximateSignedDistanceMapImageFilterType::New();
68 approximateSignedDistanceMapImageFilter->SetInput(inImage);
69 approximateSignedDistanceMapImageFilter->SetInsideValue(255);
70 approximateSignedDistanceMapImageFilter->SetOutsideValue(0);
71
73 // 1. Compute the associated average outward flux
75 // To have a good quality gradient of the distance map, perform a light smooth over it. Define
76 // convolution kernels in each direction and use them recursively.
78 typedef itk::RecursiveGaussianImageFilter<ImageType, ImageType> RecursiveGaussianFilterType;
79 RecursiveGaussianFilterType::Pointer gaussianFilterX = RecursiveGaussianFilterType::New();
80 RecursiveGaussianFilterType::Pointer gaussianFilterY = RecursiveGaussianFilterType::New();
81 RecursiveGaussianFilterType::Pointer gaussianFilterZ = RecursiveGaussianFilterType::New();
82
83 gaussianFilterX->SetDirection(0);
84 gaussianFilterY->SetDirection(1);
85 gaussianFilterZ->SetDirection(2);
86
87#if (ITK_VERSION_MAJOR >= 5)
88 gaussianFilterX->SetOrder(itk::RecursiveGaussianImageFilterEnums::GaussianOrder::ZeroOrder);
89 gaussianFilterY->SetOrder(itk::RecursiveGaussianImageFilterEnums::GaussianOrder::ZeroOrder);
90 gaussianFilterZ->SetOrder(itk::RecursiveGaussianImageFilterEnums::GaussianOrder::ZeroOrder);
91#else
92 gaussianFilterX->SetOrder(RecursiveGaussianFilterType::ZeroOrder);
93 gaussianFilterY->SetOrder(RecursiveGaussianFilterType::ZeroOrder);
94 gaussianFilterZ->SetOrder(RecursiveGaussianFilterType::ZeroOrder);
95#endif
96 gaussianFilterX->SetNormalizeAcrossScale(false);
97 gaussianFilterY->SetNormalizeAcrossScale(false);
98 gaussianFilterZ->SetNormalizeAcrossScale(false);
99
100 gaussianFilterX->SetInput(approximateSignedDistanceMapImageFilter->GetOutput());
101 gaussianFilterY->SetInput(gaussianFilterX->GetOutput());
102 gaussianFilterZ->SetInput(gaussianFilterY->GetOutput());
103
104 gaussianFilterX->SetSigma(this->Sigma);
105 gaussianFilterY->SetSigma(this->Sigma);
106 gaussianFilterZ->SetSigma(this->Sigma);
107
108 // Compute the gradient.
109 typedef itk::GradientImageFilter<ImageType, PixelType, PixelType> GradientFilterType;
110 GradientFilterType::Pointer gradientFilter = GradientFilterType::New();
111 gradientFilter->SetInput(gaussianFilterZ->GetOutput());
112 gradientFilter->SetInput(gaussianFilterY->GetOutput());
113
114 // Compute the average outward flux.
115 typedef itk::AverageOutwardFluxImageFilter<ImageType, PixelType, GradientFilterType::OutputImageType::PixelType> AOFFilterType;
116 AOFFilterType::Pointer aofFilter = AOFFilterType::New();
117 aofFilter->SetInput(approximateSignedDistanceMapImageFilter->GetOutput());
118 aofFilter->SetGradientImage(gradientFilter->GetOutput());
119
121 // 2. Compute the skeleton
123 typedef itk::MedialCurveImageFilter<ImageType> MedialCurveFilter;
124 MedialCurveFilter::Pointer medialFilter = MedialCurveFilter::New();
125 medialFilter->SetInput(approximateSignedDistanceMapImageFilter->GetOutput());
126 medialFilter->SetAverageOutwardFluxImage(aofFilter->GetOutput());
127 medialFilter->SetThreshold(this->Threshold);
128 medialFilter->Update();
129
131}
static void ITKToVTKImage(typename TImage::Pointer input, vtkImageData *output)
static void VTKToITKImage(vtkImageData *input, typename TImage::Pointer output)

Member Data Documentation

◆ Sigma

double vtkvmtkMedialCurveFilter::Sigma
protected

Definition at line 77 of file vtkvmtkMedialCurveFilter.h.

◆ Threshold

double vtkvmtkMedialCurveFilter::Threshold
protected

Definition at line 78 of file vtkvmtkMedialCurveFilter.h.


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