18#ifndef itkFastMarchingImageFilter_h
19#define itkFastMarchingImageFilter_h
25#include "ITKFastMarchingExport.h"
56extern ITKFastMarching_EXPORT std::ostream &
134template <
typename TLevelSet,
typename TSpeedImage = Image<
float, TLevelSet::ImageDimension>>
184 this->NodeType::operator=(node);
200 static constexpr unsigned int SetDimension = LevelSetType::SetDimension;
201 static constexpr unsigned int SpeedImageDimension = SpeedImageType::ImageDimension;
207#if !defined(ITK_LEGACY_REMOVE)
209 static constexpr LabelEnum FarPoint = LabelEnum::FarPoint;
210 static constexpr LabelEnum AlivePoint = LabelEnum::AlivePoint;
211 static constexpr LabelEnum TrialPoint = LabelEnum::TrialPoint;
212 static constexpr LabelEnum InitialTrialPoint = LabelEnum::InitialTrialPoint;
213 static constexpr LabelEnum OutsidePoint = LabelEnum::OutsidePoint;
222 template <
typename TPixel>
232 typename NodeContainer::ElementIdentifier NumberOfPoints = 0;
237 while (!b_it.IsAtEnd())
241 if (NumberOfPoints == 0)
245 node.SetIndex(b_it.GetIndex());
246 m_OutsidePoints->InsertElement(NumberOfPoints++, node);
257 m_OutsidePoints = points;
267 m_AlivePoints = points;
276 return m_AlivePoints;
284 m_TrialPoints = points;
293 return m_TrialPoints;
309 m_SpeedConstant = value;
310 m_InverseSpeed = -1.0 * itk::Math::sqr(1.0 / m_SpeedConstant);
316 itkGetConstReferenceMacro(SpeedConstant,
double);
322 itkSetMacro(NormalizationFactor,
double);
323 itkGetConstMacro(NormalizationFactor,
double);
329 itkSetMacro(StoppingValue,
double);
332 itkGetConstReferenceMacro(StoppingValue,
double);
338 itkSetMacro(CollectPoints,
bool);
341 itkGetConstReferenceMacro(CollectPoints,
bool);
342 itkBooleanMacro(CollectPoints);
352 return m_ProcessedPoints;
364 m_OutputRegion = size;
366 virtual OutputSizeType
369 return m_OutputRegion.GetSize();
379 itkSetMacro(OverrideOutputInformation,
bool);
380 itkGetConstReferenceMacro(OverrideOutputInformation,
bool);
381 itkBooleanMacro(OverrideOutputInformation);
384#ifdef ITK_USE_CONCEPT_CHECKING
411 return m_NodesUsed[idx];
445 double m_SpeedConstant{};
446 double m_InverseSpeed{};
447 double m_StoppingValue{};
449 bool m_CollectPoints{};
456 bool m_OverrideOutputInformation{};
458 typename LevelSetImageType::PixelType m_LargeValue{};
466 using HeapType = std::priority_queue<AxisNodeType, HeapContainer, NodeComparer>;
470 double m_NormalizationFactor{};
474#ifndef ITK_MANUAL_INSTANTIATION
475# include "itkFastMarchingImageFilter.hxx"
Base class for all data objects in ITK.
Contains all enum classes used by the FastMarchingImageFilter class.
AxisNodeType & operator=(const NodeType &node)
Solve an Eikonal equation using Fast Marching.
typename LevelSetType::NodeContainer NodeContainer
void GenerateOutputInformation() override
typename SpeedImageType::ConstPointer SpeedImageConstPointer
typename LevelSetImageType::SpacingType OutputSpacingType
const AxisNodeType & GetNodeUsedInCalculation(unsigned int idx) const
typename LevelSetType::NodeType NodeType
virtual OutputSizeType GetOutputSize() const
typename LevelSetImageType::SizeType OutputSizeType
virtual void Initialize(LevelSetImageType *)
typename LevelSetType::LevelSetPointer LevelSetPointer
NodeContainerPointer GetAlivePoints()
std::vector< AxisNodeType > HeapContainer
FastMarchingImageFilter()
typename LevelSetType::NodeContainerPointer NodeContainerPointer
void SetSpeedConstant(double value)
void PrintSelf(std::ostream &os, Indent indent) const override
~FastMarchingImageFilter() override=default
void SetBinaryMask(Image< TPixel, SetDimension > *iImage)
void GenerateData() override
LabelImagePointer GetLabelImage() const
typename LevelSetImageType::RegionType OutputRegionType
typename LevelSetImageType::PointType OutputPointType
typename LevelSetImageType::IndexType LevelSetIndexType
std::priority_queue< AxisNodeType, HeapContainer, NodeComparer > HeapType
TSpeedImage SpeedImageType
typename SpeedImageType::Pointer SpeedImagePointer
void SetAlivePoints(NodeContainer *points)
void SetOutsidePoints(NodeContainer *points)
typename LevelSetImageType::DirectionType OutputDirectionType
typename LevelSetType::LevelSetImageType LevelSetImageType
typename LevelSetType::PixelType PixelType
NodeContainerPointer GetProcessedPoints() const
NodeContainerPointer GetTrialPoints()
void EnlargeOutputRequestedRegion(DataObject *output) override
typename LabelImageType::Pointer LabelImagePointer
void SetTrialPoints(NodeContainer *points)
virtual void UpdateNeighbors(const IndexType &index, const SpeedImageType *, LevelSetImageType *)
typename NodeType::IndexType NodeIndexType
virtual double UpdateValue(const IndexType &index, const SpeedImageType *, LevelSetImageType *)
virtual void SetOutputSize(const OutputSizeType &size)
std::greater< AxisNodeType > NodeComparer
virtual const RegionType & GetLargestPossibleRegion() const
A multi-dimensional iterator templated over image type that walks an image region and is specialized ...
Base class for filters that take an image as input and produce an image as output.
Templated n-dimensional image class.
Control indentation during Print() invocation.
Represent a node in a level set.
Level set type information.
typename TLevelSet::PixelType PixelType
typename NodeContainer::Pointer NodeContainerPointer
TLevelSet LevelSetImageType
typename TLevelSet::Pointer LevelSetPointer
Light weight base class for most itk classes.
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
SmartPointer< const Self > ConstPointer
SmartPointer< Self > Pointer
#define itkConceptMacro(name, concept)
ImageBaseType::DirectionType DirectionType
ImageBaseType::RegionType RegionType
ImageBaseType::IndexType IndexType
ImageBaseType::PointType PointType
ImageBaseType::SizeType SizeType
bool ExactlyEquals(const TInput1 &x1, const TInput2 &x2)
Return the result of an exact comparison between two scalar values of potentially different types.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
Represent a n-dimensional index in a n-dimensional image.