18 #ifndef itkFastMarchingUpwindGradientImageFilter_h
19 #define itkFastMarchingUpwindGradientImageFilter_h
49 extern ITKFastMarching_EXPORT std::ostream &
87 template <
typename TLevelSet,
typename TSpeedImage = Image<
float, TLevelSet::ImageDimension>>
106 using typename Superclass::LevelSetType;
107 using typename Superclass::SpeedImageType;
108 using typename Superclass::LevelSetImageType;
109 using typename Superclass::LevelSetPointer;
110 using typename Superclass::SpeedImageConstPointer;
111 using typename Superclass::LabelImageType;
112 using typename Superclass::PixelType;
113 using typename Superclass::AxisNodeType;
114 using typename Superclass::NodeType;
115 using typename Superclass::NodeContainer;
116 using typename Superclass::NodeContainerPointer;
119 using typename Superclass::OutputSpacingType;
120 using typename Superclass::LevelSetIndexType;
125 static constexpr
unsigned int SetDimension = Superclass::SetDimension;
129 #if !defined(ITK_LEGACY_REMOVE)
144 m_TargetPoints = points;
153 return m_TargetPoints;
160 return m_ReachedTargetPoints;
176 return m_GradientImage;
181 itkSetMacro(GenerateGradientImage,
bool);
184 itkGetConstReferenceMacro(GenerateGradientImage,
bool);
185 itkBooleanMacro(GenerateGradientImage);
191 itkSetMacro(TargetOffset,
double);
194 itkGetConstReferenceMacro(TargetOffset,
double);
199 itkSetMacro(TargetReachedMode, TargetConditionEnum);
200 itkGetConstReferenceMacro(TargetReachedMode, TargetConditionEnum);
204 this->SetTargetReachedMode(TargetConditionEnum::NoTargets);
205 m_NumberOfTargets = 0;
210 this->SetTargetReachedMode(TargetConditionEnum::OneTarget);
211 m_NumberOfTargets = 1;
216 this->SetTargetReachedMode(TargetConditionEnum::SomeTargets);
217 m_NumberOfTargets = numberOfTargets;
224 this->SetTargetReachedMode(TargetConditionEnum::AllTargets);
235 itkGetConstReferenceMacro(TargetValue,
double);
237 #ifdef ITK_USE_CONCEPT_CHECKING
250 PrintSelf(std::ostream & os,
Indent indent)
const override;
253 VerifyPreconditions()
const override;
256 Initialize(LevelSetImageType *)
override;
259 GenerateData()
override;
262 UpdateNeighbors(
const IndexType & index,
const SpeedImageType *, LevelSetImageType *)
override;
266 const LevelSetImageType * output,
267 const LabelImageType * labelImage,
268 GradientImageType * gradientImage);
276 if (!m_TargetPoints || m_TargetPoints->Size() == 0)
297 const bool targetPointsExist = this->IsTargetPointsExistenceConditionSatisfied();
300 if (!targetPointsExist)
302 itkExceptionMacro(
"No target point set. Cannot set the target reached mode.");
306 const SizeValueType availableNumberOfTargets = m_TargetPoints->Size();
307 if (targetModeMinPoints > availableNumberOfTargets)
309 itkExceptionMacro(
"Not enough target points: Available: " << availableNumberOfTargets
310 <<
"; Requested: " << targetModeMinPoints);
322 bool m_GenerateGradientImage{};
324 double m_TargetOffset{};
328 double m_TargetValue{};
334 #ifndef ITK_MANUAL_INSTANTIATION
335 # include "itkFastMarchingUpwindGradientImageFilter.hxx"