18#ifndef itkSegmentationLevelSetImageFilter_h
19#define itkSegmentationLevelSetImageFilter_h
143template <
typename TInputImage,
typename TFeatureImage,
typename TOutputPixelType =
float>
164 using typename Superclass::ValueType;
166 using typename Superclass::TimeStepType;
167 using typename Superclass::InputImageType;
187 itkWarningMacro(
"SetMaximumIterations is deprecated. Please use SetNumberOfIterations instead.");
188 this->SetNumberOfIterations(i);
195 itkWarningMacro(
"GetMaximumIterations is deprecated. Please use GetNumberOfIterations instead.");
196 return this->GetNumberOfIterations();
204 itkDebugMacro(
"setting input FeatureImage to " << f);
208 m_SegmentationFunction->SetFeatureImage(f);
225 this->SetFeatureImage(input);
234 m_SegmentationFunction->SetSpeedImage(s);
243 m_SegmentationFunction->SetAdvectionImage(v);
248 virtual const SpeedImageType *
251 return m_SegmentationFunction->GetSpeedImage();
256 virtual const VectorImageType *
259 return m_SegmentationFunction->GetAdvectionImage();
269 <<
"SetUseNegativeFeaturesOn has been deprecated. Please use ReverseExpansionDirectionOn() instead");
270 this->ReverseExpansionDirectionOn();
278 <<
"SetUseNegativeFeaturesOff has been deprecated. Please use ReverseExpansionDirectionOff() instead");
279 this->ReverseExpansionDirectionOff();
287 itkWarningMacro(
"SetUseNegativeFeatures has been deprecated. Please use SetReverseExpansionDirection instead");
290 this->SetReverseExpansionDirection(
false);
294 this->SetReverseExpansionDirection(
true);
303 <<
"GetUseNegativeFeatures has been deprecated. Please use GetReverseExpansionDirection() instead");
304 if (m_ReverseExpansionDirection ==
false)
322 itkSetMacro(ReverseExpansionDirection,
bool);
323 itkGetConstMacro(ReverseExpansionDirection,
bool);
324 itkBooleanMacro(ReverseExpansionDirection);
332 itkSetMacro(AutoGenerateSpeedAdvection,
bool);
333 itkGetConstMacro(AutoGenerateSpeedAdvection,
bool);
334 itkBooleanMacro(AutoGenerateSpeedAdvection);
346 this->SetPropagationScaling(v);
350 this->SetAdvectionScaling(v);
362 m_SegmentationFunction->SetPropagationWeight(v);
371 return m_SegmentationFunction->GetPropagationWeight();
381 m_SegmentationFunction->SetAdvectionWeight(v);
390 return m_SegmentationFunction->GetAdvectionWeight();
402 m_SegmentationFunction->SetCurvatureWeight(v);
411 return m_SegmentationFunction->GetCurvatureWeight();
418 if (m_SegmentationFunction->GetUseMinimalCurvature() != b)
420 m_SegmentationFunction->SetUseMinimalCurvature(b);
429 return m_SegmentationFunction->GetUseMinimalCurvature();
435 this->SetUseMinimalCurvature(
true);
441 this->SetUseMinimalCurvature(
false);
452 m_SegmentationFunction = s;
454 auto r = MakeFilled<typename SegmentationFunctionType::RadiusType>(1);
456 m_SegmentationFunction->Initialize(r);
457 this->SetDifferenceFunction(m_SegmentationFunction);
461 virtual SegmentationFunctionType *
464 return m_SegmentationFunction;
474 if (n != m_SegmentationFunction->GetMaximumCurvatureTimeStep())
476 m_SegmentationFunction->SetMaximumCurvatureTimeStep(n);
485 return m_SegmentationFunction->GetMaximumCurvatureTimeStep();
495 if (n != m_SegmentationFunction->GetMaximumPropagationTimeStep())
497 m_SegmentationFunction->SetMaximumPropagationTimeStep(n);
506 return m_SegmentationFunction->GetMaximumPropagationTimeStep();
521#ifdef ITK_USE_CONCEPT_CHECKING
538 Superclass::InitializeIteration();
540 this->UpdateProgress(
static_cast<float>(this->GetElapsedIterations()) /
541 static_cast<float>(this->GetNumberOfIterations()));
552 bool m_ReverseExpansionDirection{};
558 bool m_AutoGenerateSpeedAdvection{};
565#ifndef ITK_MANUAL_INSTANTIATION
566# include "itkSegmentationLevelSetImageFilter.hxx"
TInputImage InputImageType
Templated n-dimensional image class.
Control indentation during Print() invocation.
Light weight base class for most itk classes.
virtual void SetInput(const DataObjectIdentifierType &key, DataObject *input)
Protected method for setting indexed and named inputs.
DataObject * GetInput(const DataObjectIdentifierType &key)
Return an input.
A base class which defines the API for implementing a special class of image segmentation filters usi...
void SetAdvectionImage(VectorImageType *v)
void GenerateData() override
typename SegmentationFunctionType::ImageType SpeedImageType
void SetUseMinimalCurvature(bool b)
void SetPropagationScaling(ValueType v)
ValueType GetPropagationScaling() const
itkGetInputMacro(InitialImage, InputImageType)
void GenerateAdvectionImage()
void SetUseNegativeFeaturesOn()
virtual const SpeedImageType * GetSpeedImage() const
void UseMinimalCurvatureOff()
void PrintSelf(std::ostream &os, Indent indent) const override
typename SegmentationFunctionType::VectorImageType VectorImageType
virtual void SetFeatureImage(const FeatureImageType *f)
void SetInput2(const FeatureImageType *input)
void SetAdvectionScaling(ValueType v)
virtual const VectorImageType * GetAdvectionImage() const
bool GetUseNegativeFeatures() const
void SetMaximumPropagationTimeStep(double n)
double GetMaximumPropagationTimeStep() const
virtual void SetSegmentationFunction(SegmentationFunctionType *s)
void InitializeIteration() override
bool GetUseMinimalCurvature() const
itkGetInputMacro(FeatureImage, FeatureImageType)
void SetCurvatureScaling(ValueType v)
virtual SegmentationFunctionType * GetSegmentationFunction()
SegmentationLevelSetImageFilter()
unsigned int GetMaximumIterations()
void SetUseNegativeFeatures(bool u)
void SetMaximumIterations(unsigned int i)
void SetMaximumCurvatureTimeStep(double n)
~SegmentationLevelSetImageFilter() override=default
void GenerateSpeedImage()
void UseMinimalCurvatureOn()
itkSetInputMacro(InitialImage, InputImageType)
double GetMaximumCurvatureTimeStep() const
ValueType GetCurvatureScaling() const
void SetSpeedImage(SpeedImageType *s)
void SetUseNegativeFeaturesOff()
ValueType GetAdvectionScaling() const
void SetFeatureScaling(ValueType v)
TFeatureImage FeatureImageType
This class implements a finite difference partial differential equation solver for evolving surfaces ...
typename OutputImageType::ValueType ValueType
#define itkConceptMacro(name, concept)
ImageBaseType::IndexType IndexType
bool NotExactlyEquals(const TInput1 &x1, const TInput2 &x2)
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....