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

Wraps itk::CollidingFrontsImageFilter. More...

#include <vtkvmtkCollidingFrontsImageFilter.h>

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

Public Types

typedef vtkSimpleImageToImageFilter Superclass

Public Member Functions

virtual int IsA (const char *type)
vtkvmtkCollidingFrontsImageFilter * NewInstance () const
virtual int GetApplyConnectivity ()
virtual void SetApplyConnectivity (int)
virtual void ApplyConnectivityOn ()
virtual void ApplyConnectivityOff ()
virtual double GetNegativeEpsilon ()
virtual void SetNegativeEpsilon (double)
virtual int GetStopOnTargets ()
virtual void SetStopOnTargets (int)
virtual void StopOnTargetsOn ()
virtual void StopOnTargetsOff ()
virtual void SetSeeds1 (vtkIdList *)
virtual vtkIdList * GetSeeds1 ()
virtual void SetSeeds2 (vtkIdList *)
virtual vtkIdList * GetSeeds2 ()

Static Public Member Functions

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

Protected Member Functions

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

Detailed Description

Wraps itk::CollidingFrontsImageFilter.

vtkvmtkCollidingFrontsImageFilter propagates two fast marching fronts across a (float-cast, assumed 3D) speed image, one from each of the two seed point sets Seeds1 and Seeds2, and outputs an image encoding where the fronts collide – points close to the collision surface are near zero, with sign indicating which front arrived first/last. This is used by the vmtkimageinitialization pype script's "collidingfronts" method to seed a level set segmentation with a surface connecting two points/regions through the vessel (e.g. between an inlet and outlet), typically followed by an offset/threshold step to build an initial level set.

See also
vtkvmtkFastMarchingUpwindGradientImageFilter, vtkvmtkFastMarchingDirectionalFreezeImageFilter

Definition at line 45 of file vtkvmtkCollidingFrontsImageFilter.h.

Member Typedef Documentation

◆ Superclass

typedef vtkSimpleImageToImageFilter vtkvmtkCollidingFrontsImageFilter::Superclass

Definition at line 49 of file vtkvmtkCollidingFrontsImageFilter.h.

Constructor & Destructor Documentation

◆ vtkvmtkCollidingFrontsImageFilter()

vtkvmtkCollidingFrontsImageFilter::vtkvmtkCollidingFrontsImageFilter ( )
protected

Definition at line 38 of file vtkvmtkCollidingFrontsImageFilter.cxx.

39{
40 this->Seeds1 = NULL;
41 this->Seeds2 = NULL;
42
43 this->ApplyConnectivity = 0;
44 this->NegativeEpsilon = -1E-6;
45 this->StopOnTargets = 0;
46}

◆ ~vtkvmtkCollidingFrontsImageFilter()

vtkvmtkCollidingFrontsImageFilter::~vtkvmtkCollidingFrontsImageFilter ( )
protected

Definition at line 48 of file vtkvmtkCollidingFrontsImageFilter.cxx.

49{
50 if (this->Seeds1)
51 {
52 this->Seeds1->Delete();
53 this->Seeds1 = NULL;
54 }
55
56 if (this->Seeds2)
57 {
58 this->Seeds2->Delete();
59 this->Seeds2 = NULL;
60 }
61}

Member Function Documentation

◆ New()

vtkvmtkCollidingFrontsImageFilter * vtkvmtkCollidingFrontsImageFilter::New ( )
static

◆ IsTypeOf()

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

◆ IsA()

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

◆ SafeDownCast()

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

◆ NewInstanceInternal()

virtual vtkObjectBase * vtkvmtkCollidingFrontsImageFilter::NewInstanceInternal ( ) const
protectedvirtual

◆ NewInstance()

vtkvmtkCollidingFrontsImageFilter * vtkvmtkCollidingFrontsImageFilter::NewInstance ( ) const

◆ GetApplyConnectivity()

virtual int vtkvmtkCollidingFrontsImageFilter::GetApplyConnectivity ( )
virtual

Toggle enforcing connectivity of each front to its originating seed set while marching, passed through to itk::CollidingFrontsImageFilter::SetApplyConnectivity. Default: off.

◆ SetApplyConnectivity()

virtual void vtkvmtkCollidingFrontsImageFilter::SetApplyConnectivity ( int )
virtual

Toggle enforcing connectivity of each front to its originating seed set while marching, passed through to itk::CollidingFrontsImageFilter::SetApplyConnectivity. Default: off.

◆ ApplyConnectivityOn()

virtual void vtkvmtkCollidingFrontsImageFilter::ApplyConnectivityOn ( )
virtual

Toggle enforcing connectivity of each front to its originating seed set while marching, passed through to itk::CollidingFrontsImageFilter::SetApplyConnectivity. Default: off.

◆ ApplyConnectivityOff()

virtual void vtkvmtkCollidingFrontsImageFilter::ApplyConnectivityOff ( )
virtual

Toggle enforcing connectivity of each front to its originating seed set while marching, passed through to itk::CollidingFrontsImageFilter::SetApplyConnectivity. Default: off.

◆ GetNegativeEpsilon()

virtual double vtkvmtkCollidingFrontsImageFilter::GetNegativeEpsilon ( )
virtual

Set/get the small negative value used to mark voxels visited by the front that reaches them first (front 1) versus the other (front 2); a larger negative magnitude leaves more headroom for downstream shift/threshold operations that build an initial level set from the output. Default: -1E-6.

◆ SetNegativeEpsilon()

virtual void vtkvmtkCollidingFrontsImageFilter::SetNegativeEpsilon ( double )
virtual

Set/get the small negative value used to mark voxels visited by the front that reaches them first (front 1) versus the other (front 2); a larger negative magnitude leaves more headroom for downstream shift/threshold operations that build an initial level set from the output. Default: -1E-6.

◆ GetStopOnTargets()

virtual int vtkvmtkCollidingFrontsImageFilter::GetStopOnTargets ( )
virtual

Toggle stopping front propagation as soon as the two fronts collide at every point (rather than continuing to fill the whole image), passed through to itk::CollidingFrontsImageFilter::SetStopOnTargets. Default: off.

◆ SetStopOnTargets()

virtual void vtkvmtkCollidingFrontsImageFilter::SetStopOnTargets ( int )
virtual

Toggle stopping front propagation as soon as the two fronts collide at every point (rather than continuing to fill the whole image), passed through to itk::CollidingFrontsImageFilter::SetStopOnTargets. Default: off.

◆ StopOnTargetsOn()

virtual void vtkvmtkCollidingFrontsImageFilter::StopOnTargetsOn ( )
virtual

Toggle stopping front propagation as soon as the two fronts collide at every point (rather than continuing to fill the whole image), passed through to itk::CollidingFrontsImageFilter::SetStopOnTargets. Default: off.

◆ StopOnTargetsOff()

virtual void vtkvmtkCollidingFrontsImageFilter::StopOnTargetsOff ( )
virtual

Toggle stopping front propagation as soon as the two fronts collide at every point (rather than continuing to fill the whole image), passed through to itk::CollidingFrontsImageFilter::SetStopOnTargets. Default: off.

◆ SetSeeds1()

virtual void vtkvmtkCollidingFrontsImageFilter::SetSeeds1 ( vtkIdList * )
virtual

Set/get the point ids (into the input image's points) of the seeds from which the first front is propagated.

◆ GetSeeds1()

virtual vtkIdList * vtkvmtkCollidingFrontsImageFilter::GetSeeds1 ( )
virtual

Set/get the point ids (into the input image's points) of the seeds from which the first front is propagated.

◆ SetSeeds2()

virtual void vtkvmtkCollidingFrontsImageFilter::SetSeeds2 ( vtkIdList * )
virtual

Set/get the point ids (into the input image's points) of the seeds from which the second front is propagated.

◆ GetSeeds2()

virtual vtkIdList * vtkvmtkCollidingFrontsImageFilter::GetSeeds2 ( )
virtual

Set/get the point ids (into the input image's points) of the seeds from which the second front is propagated.

◆ SimpleExecute()

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

Definition at line 63 of file vtkvmtkCollidingFrontsImageFilter.cxx.

64{
65 std::cout<<input->GetScalarType()<<std::endl;
66 typedef itk::Image<float,3> ImageType;
67
68 ImageType::Pointer inImage = ImageType::New();
69
71
72 typedef itk::CollidingFrontsImageFilter<ImageType, ImageType> CollidingFrontsFilterType;
73 CollidingFrontsFilterType::Pointer collidingFrontsFilter = CollidingFrontsFilterType::New();
74 collidingFrontsFilter->SetInput(inImage);
75
76 CollidingFrontsFilterType::NodeContainerPointer seeds1 = CollidingFrontsFilterType::NodeContainer::New();
77 int i;
78 for (i=0; i<this->Seeds1->GetNumberOfIds(); i++)
79 {
80 // TODO: here we get the point. We should get the cell center instead.
81 ImageType::PointType seedPoint(input->GetPoint(this->Seeds1->GetId(i)));
82 CollidingFrontsFilterType::NodeType::IndexType seedIndex;
83 inImage->TransformPhysicalPointToIndex(seedPoint,seedIndex);
84 CollidingFrontsFilterType::PixelType seedValue = itk::NumericTraits<CollidingFrontsFilterType::PixelType>::Zero;
85 CollidingFrontsFilterType::NodeType seed;
86 seed.SetValue(seedValue);
87 seed.SetIndex(seedIndex);
88 seeds1->InsertElement(i,seed);
89 }
90 collidingFrontsFilter->SetSeedPoints1(seeds1);
91
92 CollidingFrontsFilterType::NodeContainerPointer seeds2 = CollidingFrontsFilterType::NodeContainer::New();
93 for (i=0; i<this->Seeds2->GetNumberOfIds(); i++)
94 {
95 // TODO: here we get the point. We should get the cell center instead.
96 ImageType::PointType seedPoint(input->GetPoint(this->Seeds2->GetId(i)));
97 CollidingFrontsFilterType::NodeType::IndexType seedIndex;
98 inImage->TransformPhysicalPointToIndex(seedPoint,seedIndex);
99 CollidingFrontsFilterType::PixelType seedValue = itk::NumericTraits<CollidingFrontsFilterType::PixelType>::Zero;
100 CollidingFrontsFilterType::NodeType seed;
101 seed.SetValue(seedValue);
102 seed.SetIndex(seedIndex);
103 seeds2->InsertElement(i,seed);
104 }
105 collidingFrontsFilter->SetSeedPoints2(seeds2);
106
107 collidingFrontsFilter->SetApplyConnectivity(this->ApplyConnectivity);
108 collidingFrontsFilter->SetNegativeEpsilon(this->NegativeEpsilon);
109 collidingFrontsFilter->SetStopOnTargets(this->StopOnTargets);
110 collidingFrontsFilter->Update();
111
112 vtkvmtkITKFilterUtilities::ITKToVTKImage<ImageType>(collidingFrontsFilter->GetOutput(),output);
113}
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: