18 #ifndef itkFastMarchingImageFilter_h
19 #define itkFastMarchingImageFilter_h
25 #include "ITKFastMarchingExport.h"
56 extern ITKFastMarching_EXPORT std::ostream &
134 template <
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();
371 itkSetMacro(OutputRegion, OutputRegionType);
372 itkGetConstReferenceMacro(OutputRegion, OutputRegionType);
373 itkSetMacro(OutputSpacing, OutputSpacingType);
374 itkGetConstReferenceMacro(OutputSpacing, OutputSpacingType);
375 itkSetMacro(OutputDirection, OutputDirectionType);
376 itkGetConstReferenceMacro(OutputDirection, OutputDirectionType);
377 itkSetMacro(OutputOrigin, OutputPointType);
378 itkGetConstReferenceMacro(OutputOrigin, OutputPointType);
379 itkSetMacro(OverrideOutputInformation,
bool);
380 itkGetConstReferenceMacro(OverrideOutputInformation,
bool);
381 itkBooleanMacro(OverrideOutputInformation);
384 #ifdef ITK_USE_CONCEPT_CHECKING
397 PrintSelf(std::ostream & os,
Indent indent)
const override;
400 Initialize(LevelSetImageType *);
403 UpdateNeighbors(
const IndexType & index,
const SpeedImageType *, LevelSetImageType *);
406 UpdateValue(
const IndexType & index,
const SpeedImageType *, LevelSetImageType *);
411 return m_NodesUsed[idx];
415 GenerateData()
override;
419 GenerateOutputInformation()
override;
422 EnlargeOutputRequestedRegion(
DataObject * output)
override;
428 itkGetConstReferenceMacro(LargeValue, PixelType);
435 itkGetConstReferenceMacro(StartIndex, LevelSetIndexType);
436 itkGetConstReferenceMacro(LastIndex, LevelSetIndexType);
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"