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)
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 constexpr
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();
513 GenerateSpeedImage();
519 GenerateAdvectionImage();
521 #ifdef ITK_USE_CONCEPT_CHECKING
532 PrintSelf(std::ostream & os,
Indent indent)
const override;
538 Superclass::InitializeIteration();
540 this->UpdateProgress(static_cast<float>(this->GetElapsedIterations()) /
541 static_cast<float>(this->GetNumberOfIterations()));
548 GenerateData()
override;
552 bool m_ReverseExpansionDirection{};
558 bool m_AutoGenerateSpeedAdvection{};
565 #ifndef ITK_MANUAL_INSTANTIATION
566 # include "itkSegmentationLevelSetImageFilter.hxx"