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

Wraps itk::CurvesLevelSetImageFilter. More...

#include <vtkvmtkCurvesLevelSetImageFilter.h>

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

Public Types

typedef vtkSimpleImageToImageFilter Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkCurvesLevelSetImageFilter * 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 GetUseImageSpacing ()
virtual void SetUseImageSpacing (int)
virtual void UseImageSpacingOn ()
virtual void UseImageSpacingOff ()
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 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 vtkvmtkCurvesLevelSetImageFilter * New ()
static int IsTypeOf (const char *type)
static vtkvmtkCurvesLevelSetImageFilter * SafeDownCast (vtkObjectBase *o)

Protected Member Functions

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

Detailed Description

Wraps itk::CurvesLevelSetImageFilter.

vtkvmtkCurvesLevelSetImageFilter wraps itk::CurvesLevelSetImageFilter, a level set segmentation filter tailored to thin, curve-like (tubular) structures such as vessels. 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 an explicit SpeedImage, 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 "curves" LevelSetsType) offered by the vmtklevelsetsegmentation pype script.

See also
vtkvmtkGeodesicActiveContourLevelSetImageFilter, vtkvmtkGeodesicActiveContourLevelSet2DImageFilter

Definition at line 48 of file vtkvmtkCurvesLevelSetImageFilter.h.

Member Typedef Documentation

◆ Superclass

typedef vtkSimpleImageToImageFilter vtkvmtkCurvesLevelSetImageFilter::Superclass

Definition at line 52 of file vtkvmtkCurvesLevelSetImageFilter.h.

Constructor & Destructor Documentation

◆ vtkvmtkCurvesLevelSetImageFilter()

vtkvmtkCurvesLevelSetImageFilter::vtkvmtkCurvesLevelSetImageFilter ( )
protected

Definition at line 35 of file vtkvmtkCurvesLevelSetImageFilter.cxx.

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

◆ ~vtkvmtkCurvesLevelSetImageFilter()

vtkvmtkCurvesLevelSetImageFilter::~vtkvmtkCurvesLevelSetImageFilter ( )
protected

Definition at line 55 of file vtkvmtkCurvesLevelSetImageFilter.cxx.

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

Member Function Documentation

◆ New()

vtkvmtkCurvesLevelSetImageFilter * vtkvmtkCurvesLevelSetImageFilter::New ( )
static

◆ IsTypeOf()

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

◆ IsA()

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

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkCurvesLevelSetImageFilter::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkCurvesLevelSetImageFilter * vtkvmtkCurvesLevelSetImageFilter::NewInstance ( ) const

◆ GetIsoSurfaceValue()

virtual double vtkvmtkCurvesLevelSetImageFilter::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 vtkvmtkCurvesLevelSetImageFilter::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 vtkvmtkCurvesLevelSetImageFilter::GetNumberOfIterations ( )
virtual

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

◆ SetNumberOfIterations()

virtual void vtkvmtkCurvesLevelSetImageFilter::SetNumberOfIterations ( int )
virtual

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

◆ GetPropagationScaling()

virtual double vtkvmtkCurvesLevelSetImageFilter::GetPropagationScaling ( )
virtual

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

◆ SetPropagationScaling()

virtual void vtkvmtkCurvesLevelSetImageFilter::SetPropagationScaling ( double )
virtual

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

◆ GetCurvatureScaling()

virtual double vtkvmtkCurvesLevelSetImageFilter::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 vtkvmtkCurvesLevelSetImageFilter::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 vtkvmtkCurvesLevelSetImageFilter::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 vtkvmtkCurvesLevelSetImageFilter::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 vtkvmtkCurvesLevelSetImageFilter::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-4.

◆ SetMaximumRMSError()

virtual void vtkvmtkCurvesLevelSetImageFilter::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-4.

◆ GetUseNegativeFeatures()

virtual int vtkvmtkCurvesLevelSetImageFilter::GetUseNegativeFeatures ( )
virtual

Toggle use of negative features, flipping the sign convention of the feature/speed image. Default: off.

◆ SetUseNegativeFeatures()

virtual void vtkvmtkCurvesLevelSetImageFilter::SetUseNegativeFeatures ( int )
virtual

Toggle use of negative features, flipping the sign convention of the feature/speed image. Default: off.

◆ UseNegativeFeaturesOn()

virtual void vtkvmtkCurvesLevelSetImageFilter::UseNegativeFeaturesOn ( )
virtual

Toggle use of negative features, flipping the sign convention of the feature/speed image. Default: off.

◆ UseNegativeFeaturesOff()

virtual void vtkvmtkCurvesLevelSetImageFilter::UseNegativeFeaturesOff ( )
virtual

Toggle use of negative features, flipping the sign convention of the feature/speed image. Default: off.

◆ GetUseImageSpacing()

virtual int vtkvmtkCurvesLevelSetImageFilter::GetUseImageSpacing ( )
virtual

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

◆ SetUseImageSpacing()

virtual void vtkvmtkCurvesLevelSetImageFilter::SetUseImageSpacing ( int )
virtual

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

◆ UseImageSpacingOn()

virtual void vtkvmtkCurvesLevelSetImageFilter::UseImageSpacingOn ( )
virtual

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

◆ UseImageSpacingOff()

virtual void vtkvmtkCurvesLevelSetImageFilter::UseImageSpacingOff ( )
virtual

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

◆ GetAutoGenerateSpeedAdvection()

virtual int vtkvmtkCurvesLevelSetImageFilter::GetAutoGenerateSpeedAdvection ( )
virtual

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

◆ SetAutoGenerateSpeedAdvection()

virtual void vtkvmtkCurvesLevelSetImageFilter::SetAutoGenerateSpeedAdvection ( int )
virtual

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

◆ AutoGenerateSpeedAdvectionOn()

virtual void vtkvmtkCurvesLevelSetImageFilter::AutoGenerateSpeedAdvectionOn ( )
virtual

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

◆ AutoGenerateSpeedAdvectionOff()

virtual void vtkvmtkCurvesLevelSetImageFilter::AutoGenerateSpeedAdvectionOff ( )
virtual

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

◆ GetInterpolateSurfaceLocation()

virtual int vtkvmtkCurvesLevelSetImageFilter::GetInterpolateSurfaceLocation ( )
virtual

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

◆ SetInterpolateSurfaceLocation()

virtual void vtkvmtkCurvesLevelSetImageFilter::SetInterpolateSurfaceLocation ( int )
virtual

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

◆ InterpolateSurfaceLocationOn()

virtual void vtkvmtkCurvesLevelSetImageFilter::InterpolateSurfaceLocationOn ( )
virtual

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

◆ InterpolateSurfaceLocationOff()

virtual void vtkvmtkCurvesLevelSetImageFilter::InterpolateSurfaceLocationOff ( )
virtual

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

◆ GetDerivativeSigma()

virtual double vtkvmtkCurvesLevelSetImageFilter::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 vtkvmtkCurvesLevelSetImageFilter::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 * vtkvmtkCurvesLevelSetImageFilter::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 vtkvmtkCurvesLevelSetImageFilter::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 * vtkvmtkCurvesLevelSetImageFilter::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 vtkvmtkCurvesLevelSetImageFilter::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 vtkvmtkCurvesLevelSetImageFilter::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 vtkvmtkCurvesLevelSetImageFilter::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 vtkvmtkCurvesLevelSetImageFilter::SimpleExecute ( vtkImageData * input,
vtkImageData * output )
overrideprotectedvirtual

Definition at line 70 of file vtkvmtkCurvesLevelSetImageFilter.cxx.

71{
72 typedef itk::Image<float,3> ImageType;
73
74 ImageType::Pointer inImage = ImageType::New();
75
77
78 ImageType::Pointer speedImage = ImageType::New();
79 ImageType::Pointer featureImage = ImageType::New();
80
81 typedef itk::CurvesLevelSetImageFilter<ImageType,ImageType> CurvesLevelSetFilterType;
82
83 CurvesLevelSetFilterType::Pointer curvesLevelSetFilter = CurvesLevelSetFilterType::New();
84 curvesLevelSetFilter->SetInput(inImage);
85 curvesLevelSetFilter->SetIsoSurfaceValue(this->IsoSurfaceValue);
86 curvesLevelSetFilter->SetNumberOfIterations(this->NumberOfIterations);
87 curvesLevelSetFilter->SetPropagationScaling(this->PropagationScaling);
88 curvesLevelSetFilter->SetCurvatureScaling(this->CurvatureScaling);
89 curvesLevelSetFilter->SetAdvectionScaling(this->AdvectionScaling);
90 curvesLevelSetFilter->SetMaximumRMSError(this->MaximumRMSError);
91 curvesLevelSetFilter->SetUseNegativeFeatures(this->UseNegativeFeatures);
92 curvesLevelSetFilter->SetUseImageSpacing(this->UseImageSpacing);
93 curvesLevelSetFilter->SetAutoGenerateSpeedAdvection(this->AutoGenerateSpeedAdvection);
94 curvesLevelSetFilter->SetInterpolateSurfaceLocation(this->InterpolateSurfaceLocation);
95 curvesLevelSetFilter->SetDerivativeSigma(this->DerivativeSigma);
96 if (this->SpeedImage)
97 {
98 vtkvmtkITKFilterUtilities::VTKToITKImage<ImageType>(this->SpeedImage,speedImage);
99 curvesLevelSetFilter->SetSpeedImage(speedImage);
100 }
101 if (this->FeatureImage)
102 {
103 vtkvmtkITKFilterUtilities::VTKToITKImage<ImageType>(this->FeatureImage,featureImage);
104 curvesLevelSetFilter->SetFeatureImage(featureImage);
105 }
106 vtkvmtkITKFilterUtilities::ConnectProgress(curvesLevelSetFilter,this);
107 curvesLevelSetFilter->Update();
108
109 this->RMSChange = curvesLevelSetFilter->GetRMSChange();
110 this->ElapsedIterations = curvesLevelSetFilter->GetElapsedIterations();
111
112 vtkvmtkITKFilterUtilities::ITKToVTKImage<ImageType>(curvesLevelSetFilter->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: