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

Wraps itk::GeodesicActiveContourLevelSetImageFilter. More...

#include <vtkvmtkGeodesicActiveContourLevelSetImageFilter.h>

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

Public Types

typedef vtkSimpleImageToImageFilter Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkGeodesicActiveContourLevelSetImageFilter * NewInstance () const
virtual double GetRMSChange ()
virtual int GetElapsedIterations ()
virtual double GetIsoSurfaceValue ()
virtual void SetIsoSurfaceValue (double)
virtual int GetNumberOfIterations ()
virtual void SetNumberOfIterations (int)
virtual double GetPropagationScaling ()
virtual void SetPropagationScaling (double)
virtual double GetCurvatureScaling ()
virtual void SetCurvatureScaling (double)
virtual double GetAdvectionScaling ()
virtual void SetAdvectionScaling (double)
virtual double GetMaximumRMSError ()
virtual void SetMaximumRMSError (double)
virtual int GetUseNegativeFeatures ()
virtual void SetUseNegativeFeatures (int)
virtual void UseNegativeFeaturesOn ()
virtual void UseNegativeFeaturesOff ()
virtual int GetAutoGenerateSpeedAdvection ()
virtual void SetAutoGenerateSpeedAdvection (int)
virtual void AutoGenerateSpeedAdvectionOn ()
virtual void AutoGenerateSpeedAdvectionOff ()
virtual int GetInterpolateSurfaceLocation ()
virtual void SetInterpolateSurfaceLocation (int)
virtual void InterpolateSurfaceLocationOn ()
virtual void InterpolateSurfaceLocationOff ()
virtual int GetUseImageSpacing ()
virtual void SetUseImageSpacing (int)
virtual void UseImageSpacingOn ()
virtual void UseImageSpacingOff ()
virtual double GetDerivativeSigma ()
virtual void SetDerivativeSigma (double)
virtual vtkImageData * GetFeatureImage ()
virtual void SetFeatureImage (vtkImageData *)
virtual vtkImageData * GetSpeedImage ()
virtual void SetSpeedImage (vtkImageData *)

Static Public Member Functions

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

Protected Member Functions

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

Detailed Description

Wraps itk::GeodesicActiveContourLevelSetImageFilter.

vtkvmtkGeodesicActiveContourLevelSetImageFilter wraps ITK's geodesic active contour level set filter, operating on a (internally float-cast, assumed 3D) input level set image. Given an initial level set image (the filter's input, whose IsoSurfaceValue isocontour defines the starting front) and either a FeatureImage – from which speed and advection images are generated internally when AutoGenerateSpeedAdvection is on – or explicit SpeedImage/advection images, it evolves the level set for up to NumberOfIterations iterations, or until the RMS change of the level set values drops below MaximumRMSError, combining propagation, curvature, and advection force terms weighted by PropagationScaling, CurvatureScaling, and AdvectionScaling respectively. This is one of the segmentation methods (the "geodesic" LevelSetsType) offered by the vmtklevelsetsegmentation pype script.

See also
vtkvmtkGeodesicActiveContourLevelSet2DImageFilter, vtkvmtkCurvesLevelSetImageFilter

Definition at line 49 of file vtkvmtkGeodesicActiveContourLevelSetImageFilter.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkvmtkGeodesicActiveContourLevelSetImageFilter()

vtkvmtkGeodesicActiveContourLevelSetImageFilter::vtkvmtkGeodesicActiveContourLevelSetImageFilter ( )
protected

Definition at line 35 of file vtkvmtkGeodesicActiveContourLevelSetImageFilter.cxx.

36{
37 this->IsoSurfaceValue = 0.0;
38 this->NumberOfIterations = 0;
39 this->PropagationScaling = 0.0;
40 this->CurvatureScaling = 0.0;
41 this->AdvectionScaling = 0.0;
42 this->MaximumRMSError = 1E-6;
43 this->UseNegativeFeatures = 0;
44 this->AutoGenerateSpeedAdvection = 1;
45 this->InterpolateSurfaceLocation = 1;
46 this->UseImageSpacing = 1;
47 this->DerivativeSigma = 0.0;
48 this->RMSChange = 0.0;
49 this->ElapsedIterations = 0;
50 this->FeatureImage = NULL;
51 this->SpeedImage = NULL;
52}

◆ ~vtkvmtkGeodesicActiveContourLevelSetImageFilter()

vtkvmtkGeodesicActiveContourLevelSetImageFilter::~vtkvmtkGeodesicActiveContourLevelSetImageFilter ( )
protected

Definition at line 54 of file vtkvmtkGeodesicActiveContourLevelSetImageFilter.cxx.

55{
56 if (this->FeatureImage)
57 {
58 this->FeatureImage->Delete();
59 this->FeatureImage = NULL;
60 }
61 if (this->SpeedImage)
62 {
63 this->SpeedImage->Delete();
64 this->SpeedImage = NULL;
65 }
66}

Member Function Documentation

◆ New()

vtkvmtkGeodesicActiveContourLevelSetImageFilter * vtkvmtkGeodesicActiveContourLevelSetImageFilter::New ( )
static

◆ IsTypeOf()

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

◆ IsA()

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

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkGeodesicActiveContourLevelSetImageFilter::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkGeodesicActiveContourLevelSetImageFilter * vtkvmtkGeodesicActiveContourLevelSetImageFilter::NewInstance ( ) const

◆ GetIsoSurfaceValue()

virtual double vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetIsoSurfaceValue ( )
virtual

Set/get the isovalue, in the input level set image, that defines the initial front to evolve. Default: 0.0.

◆ SetIsoSurfaceValue()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::SetIsoSurfaceValue ( double )
virtual

Set/get the isovalue, in the input level set image, that defines the initial front to evolve. Default: 0.0.

◆ GetNumberOfIterations()

virtual int vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetNumberOfIterations ( )
virtual

Set/get the maximum number of level set evolution iterations; evolution may stop earlier if MaximumRMSError is reached. Default: 0.

◆ SetNumberOfIterations()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::SetNumberOfIterations ( int )
virtual

Set/get the maximum number of level set evolution iterations; evolution may stop earlier if MaximumRMSError is reached. Default: 0.

◆ GetPropagationScaling()

virtual double vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetPropagationScaling ( )
virtual

Set/get the weight of the propagation (speed-image-driven expansion/contraction) force term. Default: 0.0.

◆ SetPropagationScaling()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::SetPropagationScaling ( double )
virtual

Set/get the weight of the propagation (speed-image-driven expansion/contraction) force term. Default: 0.0.

◆ GetCurvatureScaling()

virtual double vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetCurvatureScaling ( )
virtual

Set/get the weight of the curvature-based regularization force term; larger values produce a smoother evolving front. Default: 0.0.

◆ SetCurvatureScaling()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::SetCurvatureScaling ( double )
virtual

Set/get the weight of the curvature-based regularization force term; larger values produce a smoother evolving front. Default: 0.0.

◆ GetAdvectionScaling()

virtual double vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetAdvectionScaling ( )
virtual

Set/get the weight of the advection force term that pulls the front toward features (e.g. edges) of the speed/feature image. Default: 0.0.

◆ SetAdvectionScaling()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::SetAdvectionScaling ( double )
virtual

Set/get the weight of the advection force term that pulls the front toward features (e.g. edges) of the speed/feature image. Default: 0.0.

◆ GetMaximumRMSError()

virtual double vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetMaximumRMSError ( )
virtual

Set/get the convergence threshold on the RMS change of the level set values between iterations; evolution stops early once the RMS change falls below this value. Default: 1E-6.

◆ SetMaximumRMSError()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::SetMaximumRMSError ( double )
virtual

Set/get the convergence threshold on the RMS change of the level set values between iterations; evolution stops early once the RMS change falls below this value. Default: 1E-6.

◆ GetUseNegativeFeatures()

virtual int vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetUseNegativeFeatures ( )
virtual

Toggle reversal of the front's expansion direction (passed through to the underlying ITK filter's SetReverseExpansionDirection). Default: off.

◆ SetUseNegativeFeatures()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::SetUseNegativeFeatures ( int )
virtual

Toggle reversal of the front's expansion direction (passed through to the underlying ITK filter's SetReverseExpansionDirection). Default: off.

◆ UseNegativeFeaturesOn()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::UseNegativeFeaturesOn ( )
virtual

Toggle reversal of the front's expansion direction (passed through to the underlying ITK filter's SetReverseExpansionDirection). Default: off.

◆ UseNegativeFeaturesOff()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::UseNegativeFeaturesOff ( )
virtual

Toggle reversal of the front's expansion direction (passed through to the underlying ITK filter's SetReverseExpansionDirection). Default: off.

◆ GetAutoGenerateSpeedAdvection()

virtual int vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetAutoGenerateSpeedAdvection ( )
virtual

Toggle automatic generation of the speed and advection images from FeatureImage. When on (default), FeatureImage must be set; when off, explicit SpeedImage (and advection) images must be supplied instead.

◆ SetAutoGenerateSpeedAdvection()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::SetAutoGenerateSpeedAdvection ( int )
virtual

Toggle automatic generation of the speed and advection images from FeatureImage. When on (default), FeatureImage must be set; when off, explicit SpeedImage (and advection) images must be supplied instead.

◆ AutoGenerateSpeedAdvectionOn()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::AutoGenerateSpeedAdvectionOn ( )
virtual

Toggle automatic generation of the speed and advection images from FeatureImage. When on (default), FeatureImage must be set; when off, explicit SpeedImage (and advection) images must be supplied instead.

◆ AutoGenerateSpeedAdvectionOff()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::AutoGenerateSpeedAdvectionOff ( )
virtual

Toggle automatic generation of the speed and advection images from FeatureImage. When on (default), FeatureImage must be set; when off, explicit SpeedImage (and advection) images must be supplied instead.

◆ GetInterpolateSurfaceLocation()

virtual int vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetInterpolateSurfaceLocation ( )
virtual

Toggle sub-voxel interpolation of the zero level set surface location when computing the output. Default: on.

◆ SetInterpolateSurfaceLocation()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::SetInterpolateSurfaceLocation ( int )
virtual

Toggle sub-voxel interpolation of the zero level set surface location when computing the output. Default: on.

◆ InterpolateSurfaceLocationOn()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::InterpolateSurfaceLocationOn ( )
virtual

Toggle sub-voxel interpolation of the zero level set surface location when computing the output. Default: on.

◆ InterpolateSurfaceLocationOff()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::InterpolateSurfaceLocationOff ( )
virtual

Toggle sub-voxel interpolation of the zero level set surface location when computing the output. Default: on.

◆ GetUseImageSpacing()

virtual int vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetUseImageSpacing ( )
virtual

Toggle use of the image spacing when computing derivatives and forces during evolution. Default: on.

◆ SetUseImageSpacing()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::SetUseImageSpacing ( int )
virtual

Toggle use of the image spacing when computing derivatives and forces during evolution. Default: on.

◆ UseImageSpacingOn()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::UseImageSpacingOn ( )
virtual

Toggle use of the image spacing when computing derivatives and forces during evolution. Default: on.

◆ UseImageSpacingOff()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::UseImageSpacingOff ( )
virtual

Toggle use of the image spacing when computing derivatives and forces during evolution. Default: on.

◆ GetDerivativeSigma()

virtual double vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetDerivativeSigma ( )
virtual

Set/get the Gaussian sigma used when computing derivatives of FeatureImage for the internally generated speed and advection images (only relevant when AutoGenerateSpeedAdvection is on). Default: 0.0 (no smoothing).

◆ SetDerivativeSigma()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::SetDerivativeSigma ( double )
virtual

Set/get the Gaussian sigma used when computing derivatives of FeatureImage for the internally generated speed and advection images (only relevant when AutoGenerateSpeedAdvection is on). Default: 0.0 (no smoothing).

◆ GetFeatureImage()

virtual vtkImageData * vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetFeatureImage ( )
virtual

Set/get the feature image (e.g. a gradient-magnitude-derived image) from which speed and advection images are generated internally when AutoGenerateSpeedAdvection is on.

◆ SetFeatureImage()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::SetFeatureImage ( vtkImageData * )
virtual

Set/get the feature image (e.g. a gradient-magnitude-derived image) from which speed and advection images are generated internally when AutoGenerateSpeedAdvection is on.

◆ GetSpeedImage()

virtual vtkImageData * vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetSpeedImage ( )
virtual

Set/get an explicit speed image controlling front propagation rate, used instead of an internally generated one when AutoGenerateSpeedAdvection is off.

◆ SetSpeedImage()

virtual void vtkvmtkGeodesicActiveContourLevelSetImageFilter::SetSpeedImage ( vtkImageData * )
virtual

Set/get an explicit speed image controlling front propagation rate, used instead of an internally generated one when AutoGenerateSpeedAdvection is off.

◆ GetRMSChange()

virtual double vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetRMSChange ( )
virtual

Get the RMS change of the level set values computed over the last iteration performed. Valid only after Update() has been called.

◆ GetElapsedIterations()

virtual int vtkvmtkGeodesicActiveContourLevelSetImageFilter::GetElapsedIterations ( )
virtual

Get the actual number of iterations performed, which may be less than NumberOfIterations if the MaximumRMSError convergence criterion was reached first. Valid only after Update() has been called.

◆ SimpleExecute()

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

Definition at line 68 of file vtkvmtkGeodesicActiveContourLevelSetImageFilter.cxx.

69{
70 typedef itk::Image<float,3> ImageType;
71
72 ImageType::Pointer inImage = ImageType::New();
73
75
76 typedef itk::GeodesicActiveContourLevelSetImageFilter<ImageType,ImageType> LevelSetFilterType;
77
78 ImageType::Pointer featureImage = ImageType::New();
79 ImageType::Pointer speedImage = ImageType::New();
80
81 LevelSetFilterType::Pointer levelSetFilter = LevelSetFilterType::New();
82 levelSetFilter->SetInput(inImage);
83 if (this->FeatureImage)
84 {
85 vtkvmtkITKFilterUtilities::VTKToITKImage<ImageType>(this->FeatureImage,featureImage);
86 levelSetFilter->SetFeatureImage(featureImage);
87 }
88 if (this->SpeedImage)
89 {
90 vtkvmtkITKFilterUtilities::VTKToITKImage<ImageType>(this->SpeedImage,speedImage);
91 levelSetFilter->SetSpeedImage(speedImage);
92 }
93 levelSetFilter->SetIsoSurfaceValue(this->IsoSurfaceValue);
94 levelSetFilter->SetNumberOfIterations(this->NumberOfIterations);
95 levelSetFilter->SetPropagationScaling(this->PropagationScaling);
96 levelSetFilter->SetCurvatureScaling(this->CurvatureScaling);
97 levelSetFilter->SetAdvectionScaling(this->AdvectionScaling);
98 levelSetFilter->SetMaximumRMSError(this->MaximumRMSError);
99 levelSetFilter->SetReverseExpansionDirection(this->UseNegativeFeatures);
100 levelSetFilter->SetAutoGenerateSpeedAdvection(this->AutoGenerateSpeedAdvection);
101 levelSetFilter->SetInterpolateSurfaceLocation(this->InterpolateSurfaceLocation);
102 levelSetFilter->SetUseImageSpacing(this->UseImageSpacing);
103 levelSetFilter->SetDerivativeSigma(this->DerivativeSigma);
104
106
107 levelSetFilter->Update();
108
109 this->RMSChange = levelSetFilter->GetRMSChange();
110 this->ElapsedIterations = levelSetFilter->GetElapsedIterations();
111
112 vtkvmtkITKFilterUtilities::ITKToVTKImage<ImageType>(levelSetFilter->GetOutput(),output);
113}
static void ConnectProgress(itk::Object *obj, vtkAlgorithm *alg)
static void ITKToVTKImage(typename TImage::Pointer input, vtkImageData *output)
static void VTKToITKImage(vtkImageData *input, typename TImage::Pointer output)

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