12 #ifndef itkShortestPathImageFilter_h
13 #define itkShortestPathImageFilter_h
15 #include <itkImageToImageFilter.h>
18 #include <itkImageRegionIteratorWithIndex.h>
58 template <
class TInputImageType,
class TOutputImageType>
64 typedef ImageToImageFilter<TInputImageType, TOutputImageType>
Superclass;
77 typedef typename TInputImageType::IndexType
IndexType;
88 itkFactorylessNewMacro(
Self);
99 void PrintSelf(std::ostream &os, Indent indent)
const override;
146 itkSetMacro(FullNeighborsMode,
bool);
148 itkGetMacro(FullNeighborsMode,
bool);
156 itkSetMacro(Graph_fullNeighbors,
bool);
165 itkSetMacro(MakeOutputImage,
bool);
167 itkGetMacro(MakeOutputImage,
bool);
175 itkSetMacro(StoreVectorOrder,
bool);
177 itkGetMacro(StoreVectorOrder,
bool);
188 itkSetMacro(CalcAllDistances,
bool);
190 itkGetMacro(CalcAllDistances,
bool);
199 itkSetMacro(ActivateTimeOut,
bool);
201 itkGetMacro(ActivateTimeOut,
bool);
282 std::vector<IndexType>
353 #include <itkShortestPathImageFilter.tpp>
Abstract base class for cost functions used by ShortestPathImageFilter.
ITK image filter that computes the shortest path between pixels using A*.
bool m_Graph_fullNeighbors
TInputImageType::Pointer InputImagePointer
CostFunctionType::Pointer CostFunctionTypePointer
std::vector< std::vector< IndexType > > m_MultipleVectorPaths
static const int BACKGROUND
void AddEndIndex(const IndexType &index)
Add an additional endpoint for multi-target shortest path search.
std::vector< IndexType > GetVectorPath()
Get the computed shortest path as a vector of pixel indices.
ShortestPathCostFunction< TInputImageType > CostFunctionType
static const int FOREGROUND
TInputImageType InputImageType
void SetUseCostFunction(bool doUseCostFunction)
Enable or disable the custom cost function.
TOutputImageType::IndexType OutputImageIndexType
ImageRegionIteratorWithIndex< OutputImageType > OutputImageIteratorType
TInputImageType::IndexType NodeToCoord(NodeNumType)
SmartPointer< const Self > ConstPointer
itk::ShapedNeighborhoodIterator< TInputImageType > itkShapedNeighborhoodIteratorType
void PrintSelf(std::ostream &os, Indent indent) const override
Print object information to an output stream.
bool GetUseCostFunction()
Query whether the custom cost function is enabled.
ImageToImageFilter< TInputImageType, TOutputImageType > Superclass
TInputImageType::IndexType IndexType
TInputImageType::SizeType InputImageSizeType
std::vector< IndexType > m_endPoints
void StartShortestPathSearch()
ShortestPathImageFilter()
void MakeShortestPathVector()
Trace back from end to start and fill m_VectorPath.
OutputImagePointer GetVectorOrderImage()
Get an image showing the pixel visit order.
std::vector< IndexType > m_VectorPath
bool CoordIsInBounds(IndexType)
void SetStartIndex(const IndexType &StartIndex)
Set the start pixel index for the shortest path computation.
std::vector< IndexType > m_endPointsClosed
std::vector< std::vector< IndexType > > GetMultipleVectorPaths()
Get multiple shortest paths for multi-endpoint searches.
void CleanUp()
Clean up allocated resources.
TOutputImageType OutputImageType
~ShortestPathImageFilter() override
NodeNumType m_Graph_EndNode
ShortestPathImageFilter(Self &)
OutputImagePointer GetDistanceImage()
Get the distance image showing shortest distances from the start.
TOutputImageType::PixelType OutputImagePixelType
std::vector< ShortestPathNode * > GetNeighbors(NodeNumType nodeNum, bool FullNeighbors)
InputImageType::Pointer m_magnitudeImage
NodeNumType m_Graph_StartNode
ShortestPathImageFilter Self
void operator=(const Self &)
void SetEndIndex(const IndexType &EndIndex)
Set the (single) endpoint for the shortest path computation.
itk::ImageRegionIteratorWithIndex< InputImageType > InputImageIteratorType
double getEstimatedCostsToTarget(const IndexType &a)
CostFunctionTypePointer m_CostFunction
std::vector< NodeNumType > m_VectorOrder
void GenerateData() override
SmartPointer< Self > Pointer
TInputImageType::PixelType InputImagePixelType
std::vector< ShortestPathNode * > m_Graph_DiscoveredNodeList
ShortestPathNode * m_Nodes
unsigned int CoordToNode(IndexType)
NodeNumType m_Graph_NumberOfNodes
TOutputImageType::Pointer OutputImagePointer
A node in the shortest path graph used by ShortestPathImageFilter.
DistanceType distAndEst
Sum of distance and estimated remaining cost to the target (used by A*).
unsigned int NodeNumType
Type used for node indexing.
Comparator for the A* priority queue.
bool operator()(ShortestPathNode *a, ShortestPathNode *b)