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

Wraps itk::LaplacianSegmentationLevelSetImageFilter. More...

#include <vtkvmtkLaplacianSegmentationLevelSetImageFilter.h>

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

Public Types

typedef vtkSimpleImageToImageFilter Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkLaplacianSegmentationLevelSetImageFilter * 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 vtkImageData * GetFeatureImage ()
virtual void SetFeatureImage (vtkImageData *)
virtual vtkImageData * GetSpeedImage ()
virtual void SetSpeedImage (vtkImageData *)

Static Public Member Functions

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

Protected Member Functions

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

Detailed Description

Wraps itk::LaplacianSegmentationLevelSetImageFilter.

vtkvmtkLaplacianSegmentationLevelSetImageFilter evolves an initial level set (the input image, interpreted as a signed distance-like function) driven by the second derivative (Laplacian) of a feature image, so that the zero level set is attracted to zero crossings of the Laplacian, i.e. to intensity inflection points/edges of FeatureImage. It is one of the segmentation methods selectable (as "laplacian") by the vmtklevelsetsegmentation pype script, where FeatureImage is set directly from the (float-cast) input image rather than from a gradient-derived feature image. Like the other vtkvmtk level set wrappers in this module (vtkvmtkGeodesicActiveContourLevelSetImageFilter, vtkvmtkCurvesLevelSetImageFilter, vtkvmtkThresholdSegmentationLevelSetImageFilter), it is a thin vtkSimpleImageToImageFilter wrapper: SimpleExecute() converts the VTK input/FeatureImage/SpeedImage to ITK images, configures and runs the underlying itk::LaplacianSegmentationLevelSetImageFilter, and converts the result back to a vtkImageData output.

See also
vtkvmtkGeodesicActiveContourLevelSetImageFilter, vtkvmtkCurvesLevelSetImageFilter, vtkvmtkThresholdSegmentationLevelSetImageFilter

Definition at line 51 of file vtkvmtkLaplacianSegmentationLevelSetImageFilter.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkvmtkLaplacianSegmentationLevelSetImageFilter()

vtkvmtkLaplacianSegmentationLevelSetImageFilter::vtkvmtkLaplacianSegmentationLevelSetImageFilter ( )
protected

Definition at line 35 of file vtkvmtkLaplacianSegmentationLevelSetImageFilter.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->RMSChange = 0.0;
48 this->ElapsedIterations = 0;
49 this->FeatureImage = NULL;
50 this->SpeedImage = NULL;
51}

◆ ~vtkvmtkLaplacianSegmentationLevelSetImageFilter()

vtkvmtkLaplacianSegmentationLevelSetImageFilter::~vtkvmtkLaplacianSegmentationLevelSetImageFilter ( )
protected

Definition at line 53 of file vtkvmtkLaplacianSegmentationLevelSetImageFilter.cxx.

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

Member Function Documentation

◆ New()

vtkvmtkLaplacianSegmentationLevelSetImageFilter * vtkvmtkLaplacianSegmentationLevelSetImageFilter::New ( )
static

◆ IsTypeOf()

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

◆ IsA()

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

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkLaplacianSegmentationLevelSetImageFilter::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkLaplacianSegmentationLevelSetImageFilter * vtkvmtkLaplacianSegmentationLevelSetImageFilter::NewInstance ( ) const

◆ GetIsoSurfaceValue()

virtual double vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetIsoSurfaceValue ( )
virtual

Set/get the intensity value of the input level set image that is taken to represent the zero level set (i.e. the current surface) at the start of evolution. Default: 0.0.

◆ SetIsoSurfaceValue()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::SetIsoSurfaceValue ( double )
virtual

Set/get the intensity value of the input level set image that is taken to represent the zero level set (i.e. the current surface) at the start of evolution. Default: 0.0.

◆ GetNumberOfIterations()

virtual int vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetNumberOfIterations ( )
virtual

Set/get the maximum number of level set evolution iterations to run. Evolution stops earlier if MaximumRMSError is reached. Default: 0 (no evolution).

◆ SetNumberOfIterations()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::SetNumberOfIterations ( int )
virtual

Set/get the maximum number of level set evolution iterations to run. Evolution stops earlier if MaximumRMSError is reached. Default: 0 (no evolution).

◆ GetPropagationScaling()

virtual double vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetPropagationScaling ( )
virtual

Set/get the scaling factor applied to the propagation (inflation/expansion) term of the level set speed function. Larger magnitudes make the front advance faster along its normal. Default: 0.0.

◆ SetPropagationScaling()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::SetPropagationScaling ( double )
virtual

Set/get the scaling factor applied to the propagation (inflation/expansion) term of the level set speed function. Larger magnitudes make the front advance faster along its normal. Default: 0.0.

◆ GetCurvatureScaling()

virtual double vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetCurvatureScaling ( )
virtual

Set/get the scaling factor applied to the curvature (smoothing) term of the level set speed function. Larger values yield a smoother, more regularized evolving surface. Default: 0.0.

◆ SetCurvatureScaling()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::SetCurvatureScaling ( double )
virtual

Set/get the scaling factor applied to the curvature (smoothing) term of the level set speed function. Larger values yield a smoother, more regularized evolving surface. Default: 0.0.

◆ GetAdvectionScaling()

virtual double vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetAdvectionScaling ( )
virtual

Set/get the scaling factor applied to the advection term of the level set speed function, which attracts the front towards the Laplacian zero-crossings of FeatureImage. Default: 0.0.

◆ SetAdvectionScaling()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::SetAdvectionScaling ( double )
virtual

Set/get the scaling factor applied to the advection term of the level set speed function, which attracts the front towards the Laplacian zero-crossings of FeatureImage. Default: 0.0.

◆ GetMaximumRMSError()

virtual double vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetMaximumRMSError ( )
virtual

Set/get the RMS change convergence threshold: evolution stops once the RMS change of the level set function between iterations drops below this value. Default: 1E-6.

◆ SetMaximumRMSError()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::SetMaximumRMSError ( double )
virtual

Set/get the RMS change convergence threshold: evolution stops once the RMS change of the level set function between iterations drops below this value. Default: 1E-6.

◆ GetUseNegativeFeatures()

virtual int vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetUseNegativeFeatures ( )
virtual

Toggle reversal of the expansion direction of the propagation term (equivalent to negating the sign convention of FeatureImage), used when the surface must contract rather than expand. Default: off.

◆ SetUseNegativeFeatures()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::SetUseNegativeFeatures ( int )
virtual

Toggle reversal of the expansion direction of the propagation term (equivalent to negating the sign convention of FeatureImage), used when the surface must contract rather than expand. Default: off.

◆ UseNegativeFeaturesOn()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::UseNegativeFeaturesOn ( )
virtual

Toggle reversal of the expansion direction of the propagation term (equivalent to negating the sign convention of FeatureImage), used when the surface must contract rather than expand. Default: off.

◆ UseNegativeFeaturesOff()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::UseNegativeFeaturesOff ( )
virtual

Toggle reversal of the expansion direction of the propagation term (equivalent to negating the sign convention of FeatureImage), used when the surface must contract rather than expand. Default: off.

◆ GetAutoGenerateSpeedAdvection()

virtual int vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetAutoGenerateSpeedAdvection ( )
virtual

Toggle automatic generation of the propagation/advection speed and advection field from FeatureImage by the underlying ITK filter. When off, SpeedImage (and the advection field) must be supplied explicitly. Default: on.

◆ SetAutoGenerateSpeedAdvection()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::SetAutoGenerateSpeedAdvection ( int )
virtual

Toggle automatic generation of the propagation/advection speed and advection field from FeatureImage by the underlying ITK filter. When off, SpeedImage (and the advection field) must be supplied explicitly. Default: on.

◆ AutoGenerateSpeedAdvectionOn()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::AutoGenerateSpeedAdvectionOn ( )
virtual

Toggle automatic generation of the propagation/advection speed and advection field from FeatureImage by the underlying ITK filter. When off, SpeedImage (and the advection field) must be supplied explicitly. Default: on.

◆ AutoGenerateSpeedAdvectionOff()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::AutoGenerateSpeedAdvectionOff ( )
virtual

Toggle automatic generation of the propagation/advection speed and advection field from FeatureImage by the underlying ITK filter. When off, SpeedImage (and the advection field) must be supplied explicitly. Default: on.

◆ GetInterpolateSurfaceLocation()

virtual int vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetInterpolateSurfaceLocation ( )
virtual

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

◆ SetInterpolateSurfaceLocation()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::SetInterpolateSurfaceLocation ( int )
virtual

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

◆ InterpolateSurfaceLocationOn()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::InterpolateSurfaceLocationOn ( )
virtual

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

◆ InterpolateSurfaceLocationOff()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::InterpolateSurfaceLocationOff ( )
virtual

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

◆ GetUseImageSpacing()

virtual int vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetUseImageSpacing ( )
virtual

Toggle whether the level set evolution accounts for the input image's voxel spacing (i.e. operates in physical units) rather than treating voxels as unit spacing. Default: on.

◆ SetUseImageSpacing()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::SetUseImageSpacing ( int )
virtual

Toggle whether the level set evolution accounts for the input image's voxel spacing (i.e. operates in physical units) rather than treating voxels as unit spacing. Default: on.

◆ UseImageSpacingOn()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::UseImageSpacingOn ( )
virtual

Toggle whether the level set evolution accounts for the input image's voxel spacing (i.e. operates in physical units) rather than treating voxels as unit spacing. Default: on.

◆ UseImageSpacingOff()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::UseImageSpacingOff ( )
virtual

Toggle whether the level set evolution accounts for the input image's voxel spacing (i.e. operates in physical units) rather than treating voxels as unit spacing. Default: on.

◆ GetFeatureImage()

virtual vtkImageData * vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetFeatureImage ( )
virtual

Set/get the feature image used to derive the Laplacian-based advection term (and, when AutoGenerateSpeedAdvection is on, the propagation speed as well). Required for evolution.

◆ SetFeatureImage()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::SetFeatureImage ( vtkImageData * )
virtual

Set/get the feature image used to derive the Laplacian-based advection term (and, when AutoGenerateSpeedAdvection is on, the propagation speed as well). Required for evolution.

◆ GetSpeedImage()

virtual vtkImageData * vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetSpeedImage ( )
virtual

Set/get an explicit propagation speed image, used instead of one auto-generated from FeatureImage when AutoGenerateSpeedAdvection is off.

◆ SetSpeedImage()

virtual void vtkvmtkLaplacianSegmentationLevelSetImageFilter::SetSpeedImage ( vtkImageData * )
virtual

Set/get an explicit propagation speed image, used instead of one auto-generated from FeatureImage when AutoGenerateSpeedAdvection is off.

◆ GetRMSChange()

virtual double vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetRMSChange ( )
virtual

Get the RMS change of the level set function computed at the last iteration of the most recent evolution. Valid only after Update() has been called.

◆ GetElapsedIterations()

virtual int vtkvmtkLaplacianSegmentationLevelSetImageFilter::GetElapsedIterations ( )
virtual

Get the number of iterations actually performed during the most recent evolution (may be less than NumberOfIterations if MaximumRMSError was reached first). Valid only after Update() has been called.

◆ SimpleExecute()

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

Definition at line 67 of file vtkvmtkLaplacianSegmentationLevelSetImageFilter.cxx.

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