18 #ifndef itkFastMarchingUpwindGradientImageFilter_h
19 #define itkFastMarchingUpwindGradientImageFilter_h
60 template <
typename TLevelSet,
typename TSpeedImage = Image<
float, TLevelSet::ImageDimension>>
79 using typename Superclass::LevelSetType;
80 using typename Superclass::SpeedImageType;
81 using typename Superclass::LevelSetImageType;
82 using typename Superclass::LevelSetPointer;
83 using typename Superclass::SpeedImageConstPointer;
84 using typename Superclass::LabelImageType;
85 using typename Superclass::PixelType;
86 using typename Superclass::AxisNodeType;
87 using typename Superclass::NodeType;
88 using typename Superclass::NodeContainer;
89 using typename Superclass::NodeContainerPointer;
92 using typename Superclass::OutputSpacingType;
93 using typename Superclass::LevelSetIndexType;
95 using PointType =
typename Superclass::OutputPointType;
98 static constexpr
unsigned int SetDimension = Superclass::SetDimension;
106 m_TargetPoints = points;
115 return m_TargetPoints;
122 return m_ReachedTargetPoints;
138 return m_GradientImage;
143 itkSetMacro(GenerateGradientImage,
bool);
146 itkGetConstReferenceMacro(GenerateGradientImage,
bool);
147 itkBooleanMacro(GenerateGradientImage);
153 itkSetMacro(TargetOffset,
double);
156 itkGetConstReferenceMacro(TargetOffset,
double);
161 itkSetMacro(TargetReachedMode,
int);
162 itkGetConstReferenceMacro(TargetReachedMode,
int);
166 this->SetTargetReachedMode(NoTargets);
167 m_NumberOfTargets = 0;
172 this->VerifyTargetReachedModeConditions();
175 this->SetTargetReachedMode(OneTarget);
176 m_NumberOfTargets = 1;
181 this->VerifyTargetReachedModeConditions(numberOfTargets);
183 this->SetTargetReachedMode(SomeTargets);
184 m_NumberOfTargets = numberOfTargets;
190 this->VerifyTargetReachedModeConditions();
192 this->SetTargetReachedMode(AllTargets);
193 m_NumberOfTargets = m_TargetPoints->Size();
203 itkGetConstReferenceMacro(TargetValue,
double);
213 #ifdef ITK_USE_CONCEPT_CHECKING
226 PrintSelf(std::ostream & os,
Indent indent)
const override;
229 Initialize(LevelSetImageType *)
override;
232 GenerateData()
override;
235 UpdateNeighbors(
const IndexType & index,
const SpeedImageType *, LevelSetImageType *)
override;
239 const LevelSetImageType * output,
240 const LabelImageType * labelImage,
241 GradientImageType * gradientImage);
249 if (!m_TargetPoints || m_TargetPoints->Size() == 0)
268 bool targetPointsExist = this->IsTargetPointsExistenceConditionSatisfied();
271 if (!targetPointsExist)
273 itkExceptionMacro(<<
"No target point set. Cannot set the target reached mode.");
277 SizeValueType availableNumberOfTargets = m_TargetPoints->Size();
278 if (targetModeMinPoints > availableNumberOfTargets)
280 itkExceptionMacro(<<
"Not enough target points: Available: " << availableNumberOfTargets
281 <<
"; Requested: " << targetModeMinPoints);
305 #ifndef ITK_MANUAL_INSTANTIATION
306 # include "itkFastMarchingUpwindGradientImageFilter.hxx"