18 #ifndef itkSegmentationLevelSetImageFilter_h
19 #define itkSegmentationLevelSetImageFilter_h
143 template <
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);
212 itkGetInputMacro(FeatureImage, FeatureImageType);
217 itkSetInputMacro(InitialImage, InputImageType);
218 itkGetInputMacro(InitialImage, InputImageType);
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)
320 itkSetMacro(ReverseExpansionDirection,
bool);
321 itkGetConstMacro(ReverseExpansionDirection,
bool);
322 itkBooleanMacro(ReverseExpansionDirection);
330 itkSetMacro(AutoGenerateSpeedAdvection,
bool);
331 itkGetConstMacro(AutoGenerateSpeedAdvection,
bool);
332 itkBooleanMacro(AutoGenerateSpeedAdvection);
344 this->SetPropagationScaling(v);
348 this->SetAdvectionScaling(v);
360 m_SegmentationFunction->SetPropagationWeight(v);
369 return m_SegmentationFunction->GetPropagationWeight();
379 m_SegmentationFunction->SetAdvectionWeight(v);
388 return m_SegmentationFunction->GetAdvectionWeight();
400 m_SegmentationFunction->SetCurvatureWeight(v);
409 return m_SegmentationFunction->GetCurvatureWeight();
416 if (m_SegmentationFunction->GetUseMinimalCurvature() != b)
418 m_SegmentationFunction->SetUseMinimalCurvature(b);
427 return m_SegmentationFunction->GetUseMinimalCurvature();
433 this->SetUseMinimalCurvature(
true);
439 this->SetUseMinimalCurvature(
false);
450 m_SegmentationFunction = s;
452 constexpr
auto r = MakeFilled<typename SegmentationFunctionType::RadiusType>(1);
454 m_SegmentationFunction->Initialize(r);
455 this->SetDifferenceFunction(m_SegmentationFunction);
459 virtual SegmentationFunctionType *
462 return m_SegmentationFunction;
472 if (n != m_SegmentationFunction->GetMaximumCurvatureTimeStep())
474 m_SegmentationFunction->SetMaximumCurvatureTimeStep(n);
483 return m_SegmentationFunction->GetMaximumCurvatureTimeStep();
493 if (n != m_SegmentationFunction->GetMaximumPropagationTimeStep())
495 m_SegmentationFunction->SetMaximumPropagationTimeStep(n);
504 return m_SegmentationFunction->GetMaximumPropagationTimeStep();
511 GenerateSpeedImage();
517 GenerateAdvectionImage();
519 #ifdef ITK_USE_CONCEPT_CHECKING
530 PrintSelf(std::ostream & os,
Indent indent)
const override;
536 Superclass::InitializeIteration();
538 this->UpdateProgress(static_cast<float>(this->GetElapsedIterations()) /
539 static_cast<float>(this->GetNumberOfIterations()));
546 GenerateData()
override;
550 bool m_ReverseExpansionDirection{};
556 bool m_AutoGenerateSpeedAdvection{};
563 #ifndef ITK_MANUAL_INSTANTIATION
564 # include "itkSegmentationLevelSetImageFilter.hxx"