18#ifndef itkFastMarchingUpwindGradientImageFilter_h
19#define itkFastMarchingUpwindGradientImageFilter_h
49extern ITKFastMarching_EXPORT std::ostream &
87template <
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);
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
276 if (!m_TargetPoints || m_TargetPoints->Size() == 0)
295 const bool targetPointsExist = this->IsTargetPointsExistenceConditionSatisfied();
298 if (!targetPointsExist)
300 itkExceptionMacro(
"No target point set. Cannot set the target reached mode.");
304 const SizeValueType availableNumberOfTargets = m_TargetPoints->Size();
305 if (targetModeMinPoints > availableNumberOfTargets)
307 itkExceptionMacro(
"Not enough target points: Available: " << availableNumberOfTargets
308 <<
"; Requested: " << targetModeMinPoints);
320 bool m_GenerateGradientImage{};
322 double m_TargetOffset{};
326 double m_TargetValue{};
332#ifndef ITK_MANUAL_INSTANTIATION
333# include "itkFastMarchingUpwindGradientImageFilter.hxx"
A templated class holding a n-Dimensional covariant vector.
Solve an Eikonal equation using Fast Marching.
typename LevelSetType::NodeContainer NodeContainer
typename LevelSetType::NodeContainerPointer NodeContainerPointer
typename LevelSetType::LevelSetImageType LevelSetImageType
enums for itk::FastMarchingUpwindGradientImageFilter
Generates the upwind gradient field of fast marching arrival times.
bool IsTargetPointsExistenceConditionSatisfied() const
NodeContainerPointer GetReachedTargetPoints()
void PrintSelf(std::ostream &os, Indent indent) const override
void VerifyPreconditions() const override
Verifies that the process object has been configured correctly, that all required inputs are set,...
typename GradientImageType::Pointer GradientImagePointer
void SetTargetReachedModeToSomeTargets(SizeValueType numberOfTargets)
GradientImagePointer GetGradientImage() const
void SetTargetReachedModeToOneTarget()
void SetTargetReachedModeToNoTargets()
virtual void ComputeGradient(const IndexType &index, const LevelSetImageType *output, const LabelImageType *labelImage, GradientImageType *gradientImage)
NodeContainerPointer GetTargetPoints()
~FastMarchingUpwindGradientImageFilter() override=default
FastMarchingUpwindGradientImageFilter()
void SetTargetReachedModeToAllTargets()
void GenerateData() override
void Initialize(LevelSetImageType *) override
typename Superclass::OutputPointType PointType
void VerifyTargetReachedModeConditions(unsigned int targetModeMinPoints=1) const
void UpdateNeighbors(const IndexType &index, const SpeedImageType *, LevelSetImageType *) override
void SetTargetPoints(NodeContainer *points)
Templated n-dimensional image class.
Control indentation during Print() invocation.
Light weight base class for most itk classes.
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
ImageBaseType::IndexType IndexType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
unsigned long SizeValueType
Represent a n-dimensional index in a n-dimensional image.