|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Abstract base class for cost functions used by ShortestPathImageFilter. More...
#include <itkShortestPathCostFunction.h>


Public Types | |
| typedef ShortestPathCostFunction | Self |
| typedef Object | Superclass |
| typedef SmartPointer< Self > | Pointer |
| typedef SmartPointer< const Self > | ConstPointer |
| typedef ShapedNeighborhoodIterator< TInputImageType > | ShapedNeighborhoodIteratorType |
| typedef TInputImageType | ImageType |
| typedef TInputImageType::Pointer | ImagePointer |
| typedef TInputImageType::ConstPointer | ImageConstPointer |
| typedef TInputImageType::PixelType | PixelType |
| typedef TInputImageType::IndexType | IndexType |
Public Member Functions | |
| virtual const char * | GetClassName () const |
| virtual void | SetImage (const TInputImageType *_arg) |
| Set the input image on which costs are computed. More... | |
| virtual double | GetCost (IndexType p1, IndexType p2)=0 |
| Calculate the cost of transitioning from pixel p1 to pixel p2. More... | |
| virtual double | GetMinCost ()=0 |
| Return the minimal possible cost for any transition. More... | |
| virtual void | Initialize ()=0 |
| Initialize the cost function. More... | |
| void | SetStartIndex (const IndexType &index) |
| Set the starting index of the path. More... | |
| void | SetEndIndex (const IndexType &index) |
| Set the ending index of the path. More... | |
Protected Member Functions | |
| ShortestPathCostFunction () | |
| ~ShortestPathCostFunction () override | |
| void | PrintSelf (std::ostream &os, Indent indent) const override |
Protected Attributes | |
| ImageConstPointer | m_Image |
| The input image used for cost computation. More... | |
| IndexType | m_StartIndex |
| IndexType | m_EndIndex |
| Start and end indices defining the path endpoints. More... | |
Abstract base class for cost functions used by ShortestPathImageFilter.
This pure virtual class defines the interface for cost functions that compute the transition cost between two neighboring pixels in an image. Subclasses must implement GetCost(), GetMinCost(), and Initialize() to provide application-specific cost metrics (e.g., gradient-based costs for LiveWire segmentation, or TBSS-based costs for tract definition).
The cost function operates on images of type TInputImageType and is used by ShortestPathImageFilter to find the cheapest path between a start and end index.
| TInputImageType | The ITK image type used as input. Must provide PixelType and IndexType typedefs. |
Definition at line 42 of file itkShortestPathCostFunction.h.
| typedef SmartPointer<const Self> itk::ShortestPathCostFunction< TInputImageType >::ConstPointer |
Definition at line 49 of file itkShortestPathCostFunction.h.
| typedef TInputImageType::ConstPointer itk::ShortestPathCostFunction< TInputImageType >::ImageConstPointer |
Definition at line 60 of file itkShortestPathCostFunction.h.
| typedef TInputImageType::Pointer itk::ShortestPathCostFunction< TInputImageType >::ImagePointer |
Definition at line 59 of file itkShortestPathCostFunction.h.
| typedef TInputImageType itk::ShortestPathCostFunction< TInputImageType >::ImageType |
Type definition for the input image.
Definition at line 56 of file itkShortestPathCostFunction.h.
| typedef TInputImageType::IndexType itk::ShortestPathCostFunction< TInputImageType >::IndexType |
Definition at line 62 of file itkShortestPathCostFunction.h.
| typedef TInputImageType::PixelType itk::ShortestPathCostFunction< TInputImageType >::PixelType |
Definition at line 61 of file itkShortestPathCostFunction.h.
| typedef SmartPointer<Self> itk::ShortestPathCostFunction< TInputImageType >::Pointer |
Definition at line 48 of file itkShortestPathCostFunction.h.
| typedef ShortestPathCostFunction itk::ShortestPathCostFunction< TInputImageType >::Self |
Standard class typedefs.
Definition at line 46 of file itkShortestPathCostFunction.h.
| typedef ShapedNeighborhoodIterator<TInputImageType> itk::ShortestPathCostFunction< TInputImageType >::ShapedNeighborhoodIteratorType |
Definition at line 50 of file itkShortestPathCostFunction.h.
| typedef Object itk::ShortestPathCostFunction< TInputImageType >::Superclass |
Definition at line 47 of file itkShortestPathCostFunction.h.
|
inlineprotected |
Definition at line 111 of file itkShortestPathCostFunction.h.
|
inlineoverrideprotected |
Definition at line 112 of file itkShortestPathCostFunction.h.
|
virtual |
Run-time type information (and related methods).
Reimplemented in itk::ShortestPathCostFunctionTbss< TInputImageType >, and itk::ShortestPathCostFunctionLiveWire< TInputImageType >.
|
pure virtual |
Calculate the cost of transitioning from pixel p1 to pixel p2.
| [in] | p1 | The index of the source pixel. |
| [in] | p2 | The index of the destination pixel (a neighbor of p1). |
Implemented in itk::ShortestPathCostFunctionTbss< TInputImageType >, and itk::ShortestPathCostFunctionLiveWire< TInputImageType >.
|
pure virtual |
Return the minimal possible cost for any transition.
This lower bound is required by the A* search heuristic. If the return value is 0, the algorithm degrades to Dijkstra's algorithm.
Implemented in itk::ShortestPathCostFunctionTbss< TInputImageType >, and itk::ShortestPathCostFunctionLiveWire< TInputImageType >.
|
pure virtual |
Initialize the cost function.
Called before the shortest path search begins. Subclasses should perform any required precomputation (e.g., computing gradient images).
Implemented in itk::ShortestPathCostFunctionTbss< TInputImageType >, and itk::ShortestPathCostFunctionLiveWire< TInputImageType >.
|
overrideprotected |
| void itk::ShortestPathCostFunction< TInputImageType >::SetEndIndex | ( | const IndexType & | index | ) |
Set the ending index of the path.
| [in] | index | The image index where the path ends. |
|
virtual |
Set the input image on which costs are computed.
Reimplemented in itk::ShortestPathCostFunctionLiveWire< TInputImageType >.
| void itk::ShortestPathCostFunction< TInputImageType >::SetStartIndex | ( | const IndexType & | index | ) |
Set the starting index of the path.
| [in] | index | The image index where the path begins. |
|
protected |
Start and end indices defining the path endpoints.
Definition at line 115 of file itkShortestPathCostFunction.h.
|
protected |
The input image used for cost computation.
Definition at line 114 of file itkShortestPathCostFunction.h.
|
protected |
Definition at line 115 of file itkShortestPathCostFunction.h.