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

Wraps itk::ThresholdSegmentationLevelSetImageFilter. More...

#include <vtkvmtkThresholdSegmentationLevelSetImageFilter.h>

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

Public Types

typedef vtkSimpleImageToImageFilter Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkThresholdSegmentationLevelSetImageFilter * NewInstance () const
virtual double GetRMSChange ()
virtual int GetElapsedIterations ()
virtual double GetUpperThreshold ()
virtual void SetUpperThreshold (double)
virtual double GetLowerThreshold ()
virtual void SetLowerThreshold (double)
virtual double GetEdgeWeight ()
virtual void SetEdgeWeight (double)
virtual int GetSmoothingIterations ()
virtual void SetSmoothingIterations (int)
virtual double GetSmoothingTimeStep ()
virtual void SetSmoothingTimeStep (double)
virtual double GetSmoothingConductance ()
virtual void SetSmoothingConductance (double)
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 vtkvmtkThresholdSegmentationLevelSetImageFilter * New ()
static int IsTypeOf (const char *type)
static vtkvmtkThresholdSegmentationLevelSetImageFilter * SafeDownCast (vtkObjectBase *o)

Protected Member Functions

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

Detailed Description

Wraps itk::ThresholdSegmentationLevelSetImageFilter.

vtkvmtkThresholdSegmentationLevelSetImageFilter evolves an initial level set (the input image) with a propagation speed that pushes the front to expand inside the intensity band [LowerThreshold, UpperThreshold] and to contract outside it, optionally smoothed by a curvature anisotropic diffusion pre-processing pass (SmoothingIterations/SmoothingTimeStep/ SmoothingConductance) applied to FeatureImage. It is one of the segmentation methods selectable (as "threshold") by the vmtklevelsetsegmentation pype script, where FeatureImage is set to the (float-cast) input intensity image itself rather than a gradient-derived feature image, and LowerThreshold/UpperThreshold are the intensity bounds of the structure to segment. Like the other vtkvmtk level set wrappers in this module (vtkvmtkGeodesicActiveContourLevelSetImageFilter, vtkvmtkCurvesLevelSetImageFilter, vtkvmtkLaplacianSegmentationLevelSetImageFilter), it is a thin vtkSimpleImageToImageFilter wrapper: SimpleExecute() converts the VTK input/FeatureImage/SpeedImage to ITK images, configures and runs the underlying itk::ThresholdSegmentationLevelSetImageFilter, and converts the result back to a vtkImageData output.

See also
vtkvmtkGeodesicActiveContourLevelSetImageFilter, vtkvmtkCurvesLevelSetImageFilter, vtkvmtkLaplacianSegmentationLevelSetImageFilter

Definition at line 53 of file vtkvmtkThresholdSegmentationLevelSetImageFilter.h.

Member Typedef Documentation

◆ Superclass

Constructor & Destructor Documentation

◆ vtkvmtkThresholdSegmentationLevelSetImageFilter()

vtkvmtkThresholdSegmentationLevelSetImageFilter::vtkvmtkThresholdSegmentationLevelSetImageFilter ( )
protected

Definition at line 35 of file vtkvmtkThresholdSegmentationLevelSetImageFilter.cxx.

36{
37 this->UpperThreshold = 0.0;
38 this->LowerThreshold = 0.0;
39 this->EdgeWeight = 1.0;
40 this->SmoothingIterations = 0;
41 this->SmoothingTimeStep = 0.01;
42 this->SmoothingConductance = 1.0;
43 this->IsoSurfaceValue = 0.0;
44 this->NumberOfIterations = 0;
45 this->PropagationScaling = 0.0;
46 this->CurvatureScaling = 0.0;
47 this->AdvectionScaling = 0.0;
48 this->MaximumRMSError = 1E-6;
49 this->UseNegativeFeatures = 0;
50 this->AutoGenerateSpeedAdvection = 1;
51 this->InterpolateSurfaceLocation = 1;
52 this->UseImageSpacing = 1;
53 this->RMSChange = 0.0;
54 this->ElapsedIterations = 0;
55 this->FeatureImage = NULL;
56 this->SpeedImage = NULL;
57}

◆ ~vtkvmtkThresholdSegmentationLevelSetImageFilter()

vtkvmtkThresholdSegmentationLevelSetImageFilter::~vtkvmtkThresholdSegmentationLevelSetImageFilter ( )
protected

Definition at line 59 of file vtkvmtkThresholdSegmentationLevelSetImageFilter.cxx.

60{
61 if (this->FeatureImage)
62 {
63 this->FeatureImage->Delete();
64 this->FeatureImage = NULL;
65 }
66 if (this->SpeedImage)
67 {
68 this->SpeedImage->Delete();
69 this->SpeedImage = NULL;
70 }
71}

Member Function Documentation

◆ New()

vtkvmtkThresholdSegmentationLevelSetImageFilter * vtkvmtkThresholdSegmentationLevelSetImageFilter::New ( )
static

◆ IsTypeOf()

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

◆ IsA()

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

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkThresholdSegmentationLevelSetImageFilter::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkThresholdSegmentationLevelSetImageFilter * vtkvmtkThresholdSegmentationLevelSetImageFilter::NewInstance ( ) const

◆ GetUpperThreshold()

virtual double vtkvmtkThresholdSegmentationLevelSetImageFilter::GetUpperThreshold ( )
virtual

Set/get the upper bound of the intensity band (evaluated on FeatureImage) inside which the propagation speed is positive (expanding). Default: 0.0.

◆ SetUpperThreshold()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::SetUpperThreshold ( double )
virtual

Set/get the upper bound of the intensity band (evaluated on FeatureImage) inside which the propagation speed is positive (expanding). Default: 0.0.

◆ GetLowerThreshold()

virtual double vtkvmtkThresholdSegmentationLevelSetImageFilter::GetLowerThreshold ( )
virtual

Set/get the lower bound of the intensity band (evaluated on FeatureImage) inside which the propagation speed is positive (expanding). Default: 0.0.

◆ SetLowerThreshold()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::SetLowerThreshold ( double )
virtual

Set/get the lower bound of the intensity band (evaluated on FeatureImage) inside which the propagation speed is positive (expanding). Default: 0.0.

◆ GetEdgeWeight()

virtual double vtkvmtkThresholdSegmentationLevelSetImageFilter::GetEdgeWeight ( )
virtual

Set/get the weight applied to the edge (gradient-magnitude) term used, together with the threshold band, to shape the propagation speed near intensity transitions. Default: 1.0.

◆ SetEdgeWeight()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::SetEdgeWeight ( double )
virtual

Set/get the weight applied to the edge (gradient-magnitude) term used, together with the threshold band, to shape the propagation speed near intensity transitions. Default: 1.0.

◆ GetSmoothingIterations()

virtual int vtkvmtkThresholdSegmentationLevelSetImageFilter::GetSmoothingIterations ( )
virtual

Set/get the number of curvature anisotropic diffusion smoothing iterations applied to FeatureImage before computing the threshold-based speed function. Default: 0 (no smoothing).

◆ SetSmoothingIterations()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::SetSmoothingIterations ( int )
virtual

Set/get the number of curvature anisotropic diffusion smoothing iterations applied to FeatureImage before computing the threshold-based speed function. Default: 0 (no smoothing).

◆ GetSmoothingTimeStep()

virtual double vtkvmtkThresholdSegmentationLevelSetImageFilter::GetSmoothingTimeStep ( )
virtual

Set/get the time step used by the curvature anisotropic diffusion smoothing pass on FeatureImage (see SmoothingIterations). Default: 0.01.

◆ SetSmoothingTimeStep()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::SetSmoothingTimeStep ( double )
virtual

Set/get the time step used by the curvature anisotropic diffusion smoothing pass on FeatureImage (see SmoothingIterations). Default: 0.01.

◆ GetSmoothingConductance()

virtual double vtkvmtkThresholdSegmentationLevelSetImageFilter::GetSmoothingConductance ( )
virtual

Set/get the conductance parameter of the curvature anisotropic diffusion smoothing pass on FeatureImage (see SmoothingIterations); lower values preserve edges more strongly. Default: 1.0.

◆ SetSmoothingConductance()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::SetSmoothingConductance ( double )
virtual

Set/get the conductance parameter of the curvature anisotropic diffusion smoothing pass on FeatureImage (see SmoothingIterations); lower values preserve edges more strongly. Default: 1.0.

◆ GetIsoSurfaceValue()

virtual double vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::GetAdvectionScaling ( )
virtual

Set/get the scaling factor applied to the advection term of the level set speed function. Default: 0.0.

◆ SetAdvectionScaling()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::SetAdvectionScaling ( double )
virtual

Set/get the scaling factor applied to the advection term of the level set speed function. Default: 0.0.

◆ GetMaximumRMSError()

virtual double vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::GetUseNegativeFeatures ( )
virtual

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

◆ SetUseNegativeFeatures()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::SetUseNegativeFeatures ( int )
virtual

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

◆ UseNegativeFeaturesOn()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::UseNegativeFeaturesOn ( )
virtual

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

◆ UseNegativeFeaturesOff()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::UseNegativeFeaturesOff ( )
virtual

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

◆ GetAutoGenerateSpeedAdvection()

virtual int vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::GetInterpolateSurfaceLocation ( )
virtual

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

◆ SetInterpolateSurfaceLocation()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::SetInterpolateSurfaceLocation ( int )
virtual

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

◆ InterpolateSurfaceLocationOn()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::InterpolateSurfaceLocationOn ( )
virtual

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

◆ InterpolateSurfaceLocationOff()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::InterpolateSurfaceLocationOff ( )
virtual

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

◆ GetUseImageSpacing()

virtual int vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 vtkvmtkThresholdSegmentationLevelSetImageFilter::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 * vtkvmtkThresholdSegmentationLevelSetImageFilter::GetFeatureImage ( )
virtual

Set/get the feature image on which the intensity threshold band and edge weighting are evaluated (and, when AutoGenerateSpeedAdvection is on, from which the propagation speed is derived). Required for evolution.

◆ SetFeatureImage()

virtual void vtkvmtkThresholdSegmentationLevelSetImageFilter::SetFeatureImage ( vtkImageData * )
virtual

Set/get the feature image on which the intensity threshold band and edge weighting are evaluated (and, when AutoGenerateSpeedAdvection is on, from which the propagation speed is derived). Required for evolution.

◆ GetSpeedImage()

virtual vtkImageData * vtkvmtkThresholdSegmentationLevelSetImageFilter::GetSpeedImage ( )
virtual

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

◆ SetSpeedImage()

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

Definition at line 73 of file vtkvmtkThresholdSegmentationLevelSetImageFilter.cxx.

74{
75 typedef itk::Image<float,3> ImageType;
76
77 ImageType::Pointer inImage = ImageType::New();
78
80
81 typedef itk::ThresholdSegmentationLevelSetImageFilter<ImageType,ImageType> LevelSetFilterType;
82
83 ImageType::Pointer featureImage = ImageType::New();
84 ImageType::Pointer speedImage = ImageType::New();
85
86 LevelSetFilterType::Pointer levelSetFilter = LevelSetFilterType::New();
87 levelSetFilter->SetInput(inImage);
88 if (this->FeatureImage)
89 {
90 vtkvmtkITKFilterUtilities::VTKToITKImage<ImageType>(this->FeatureImage,featureImage);
91 levelSetFilter->SetFeatureImage(featureImage);
92 }
93 if (this->SpeedImage)
94 {
95 vtkvmtkITKFilterUtilities::VTKToITKImage<ImageType>(this->SpeedImage,speedImage);
96 levelSetFilter->SetSpeedImage(speedImage);
97 }
98 levelSetFilter->SetUpperThreshold(this->UpperThreshold);
99 levelSetFilter->SetLowerThreshold(this->LowerThreshold);
100 levelSetFilter->SetEdgeWeight(this->EdgeWeight);
101 levelSetFilter->SetSmoothingIterations(this->SmoothingIterations);
102 levelSetFilter->SetSmoothingConductance(this->SmoothingConductance);
103 levelSetFilter->SetIsoSurfaceValue(this->IsoSurfaceValue);
104 levelSetFilter->SetNumberOfIterations(this->NumberOfIterations);
105 levelSetFilter->SetPropagationScaling(this->PropagationScaling);
106 levelSetFilter->SetCurvatureScaling(this->CurvatureScaling);
107 levelSetFilter->SetAdvectionScaling(this->AdvectionScaling);
108 levelSetFilter->SetMaximumRMSError(this->MaximumRMSError);
109 levelSetFilter->SetReverseExpansionDirection(this->UseNegativeFeatures);
110 levelSetFilter->SetAutoGenerateSpeedAdvection(this->AutoGenerateSpeedAdvection);
111 levelSetFilter->SetInterpolateSurfaceLocation(this->InterpolateSurfaceLocation);
112 levelSetFilter->SetUseImageSpacing(this->UseImageSpacing);
114 levelSetFilter->Update();
115
116 this->RMSChange = levelSetFilter->GetRMSChange();
117 this->ElapsedIterations = levelSetFilter->GetElapsedIterations();
118
119 vtkvmtkITKFilterUtilities::ITKToVTKImage<ImageType>(levelSetFilter->GetOutput(),output);
120}
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: