Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
itk::ShortestPathCostFunctionLiveWire< TInputImageType > Class Template Reference

Cost function for LiveWire purposes. Specific features are considered to calculate cummulative costs of a link between two pixels. These are: More...

#include <itkShortestPathCostFunctionLiveWire.h>

Inheritance diagram for itk::ShortestPathCostFunctionLiveWire< TInputImageType >:
Collaboration diagram for itk::ShortestPathCostFunctionLiveWire< TInputImageType >:

Public Types

enum  Constants { MAPSCALEFACTOR }
 
typedef ShortestPathCostFunctionLiveWire Self
 
typedef ShortestPathCostFunction< TInputImageType > Superclass
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
typedef itk::ImageRegionConstIterator< TInputImageType > ConstIteratorType
 
typedef itk::Image< unsigned char, 2 > UnsignedCharImageType
 
typedef itk::Image< float, 2 > FloatImageType
 
typedef float ComponentType
 
typedef itk::CovariantVector< ComponentType, 2 > OutputPixelType
 
typedef itk::Image< OutputPixelType, 2 > VectorOutputImageType
 
typedef TInputImageType::IndexType IndexType
 
typedef TInputImageType ImageType
 
typedef itk::ImageRegion< 2 > RegionType
 
- Public Types inherited from itk::ShortestPathCostFunction< TInputImageType >
typedef ShortestPathCostFunction Self
 
typedef Object Superclass
 
typedef SmartPointer< SelfPointer
 
typedef SmartPointer< const SelfConstPointer
 
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

Pointer Clone () const
 
virtual const char * GetClassName () const
 
double GetCost (IndexType p1, IndexType p2) override
 calculates the costs for going from p1 to p2 More...
 
double GetMinCost () override
 returns the minimal costs possible (needed for A*) More...
 
void Initialize () override
 Initialize the metric. More...
 
virtual void AddRepulsivePoint (const IndexType &index)
 Add void pixel in cost map. More...
 
virtual void RemoveRepulsivePoint (const IndexType &index)
 Remove void pixel in cost map. More...
 
virtual void ClearRepulsivePoints ()
 Clear repulsive points in cost function. More...
 
virtual void SetRequestedRegion (RegionType _arg)
 
virtual RegionType GetRequestedRegion ()
 
void SetImage (const TInputImageType *_arg) override
 
void SetDynamicCostMap (std::map< int, int > &costMap)
 
void SetUseCostMap (bool useCostMap)
 
void SetCostMapMaximum (double max)
 Set the maximum of the dynamic cost map to save computation time. More...
 
const UnsignedCharImageTypeGetMaskImage ()
 
const FloatImageTypeGetGradientMagnitudeImage ()
 
const FloatImageTypeGetEdgeImage ()
 
const VectorOutputImageTypeGetGradientImage ()
 
- Public Member Functions inherited from itk::ShortestPathCostFunction< TInputImageType >
void SetStartIndex (const IndexType &index)
 
void SetEndIndex (const IndexType &index)
 

Static Public Member Functions

static Pointer New ()
 
static double Gaussian (double x, double xOfGaussian, double yOfGaussian)
 Returns the y value of gaussian with given offset and amplitude. More...
 

Protected Member Functions

 ShortestPathCostFunctionLiveWire ()
 
 ~ShortestPathCostFunctionLiveWire () override
 
- Protected Member Functions inherited from itk::ShortestPathCostFunction< TInputImageType >
 ShortestPathCostFunction ()
 
 ~ShortestPathCostFunction () override
 
void PrintSelf (std::ostream &os, Indent indent) const override
 

Protected Attributes

FloatImageType::Pointer m_GradientMagnitudeImage
 
FloatImageType::Pointer m_EdgeImage
 
UnsignedCharImageType::Pointer m_MaskImage
 
VectorOutputImageType::Pointer m_GradientImage
 
double m_MinCosts
 
bool m_UseRepulsivePoints
 
Superclass::PixelType val
 
Superclass::PixelType startValue
 
Superclass::PixelType endValue
 
double m_GradientMax
 
RegionType m_RequestedRegion
 
bool m_Initialized
 
std::map< int, int > m_CostMap
 
bool m_UseCostMap
 
double m_MaxMapCosts
 
- Protected Attributes inherited from itk::ShortestPathCostFunction< TInputImageType >
ImageConstPointer m_Image
 
IndexType m_StartIndex
 
IndexType m_EndIndex
 

Detailed Description

template<class TInputImageType>
class itk::ShortestPathCostFunctionLiveWire< TInputImageType >

Cost function for LiveWire purposes. Specific features are considered to calculate cummulative costs of a link between two pixels. These are:

  • Gradient Magnitude
  • Gradient Direction
  • Laplacian Zero Crossing

By default the Gradient Magnitude is mapped linearly to cost values between 0 (good) and 1 (bad). Via SetDynamicCostMap( std::map< int, int > &costMap) a cost map can be set to dynamically map Gradient Magnitude (non linear). Thus, lower values can be considered with lower costs than higher values of gradient magnitudes. To compute the costs of the gradient magnitude dynamically an iverted map of the histogram of gradient magnitude image is used.

Definition at line 40 of file itkShortestPathCostFunctionLiveWire.h.

Member Typedef Documentation

◆ ComponentType

template<class TInputImageType >
typedef float itk::ShortestPathCostFunctionLiveWire< TInputImageType >::ComponentType

Definition at line 60 of file itkShortestPathCostFunctionLiveWire.h.

◆ ConstIteratorType

template<class TInputImageType >
typedef itk::ImageRegionConstIterator<TInputImageType> itk::ShortestPathCostFunctionLiveWire< TInputImageType >::ConstIteratorType

Definition at line 48 of file itkShortestPathCostFunctionLiveWire.h.

◆ ConstPointer

template<class TInputImageType >
typedef SmartPointer<const Self> itk::ShortestPathCostFunctionLiveWire< TInputImageType >::ConstPointer

Definition at line 47 of file itkShortestPathCostFunctionLiveWire.h.

◆ FloatImageType

template<class TInputImageType >
typedef itk::Image<float, 2> itk::ShortestPathCostFunctionLiveWire< TInputImageType >::FloatImageType

Definition at line 58 of file itkShortestPathCostFunctionLiveWire.h.

◆ ImageType

template<class TInputImageType >
typedef TInputImageType itk::ShortestPathCostFunctionLiveWire< TInputImageType >::ImageType

Definition at line 65 of file itkShortestPathCostFunctionLiveWire.h.

◆ IndexType

template<class TInputImageType >
typedef TInputImageType::IndexType itk::ShortestPathCostFunctionLiveWire< TInputImageType >::IndexType

Definition at line 64 of file itkShortestPathCostFunctionLiveWire.h.

◆ OutputPixelType

template<class TInputImageType >
typedef itk::CovariantVector<ComponentType, 2> itk::ShortestPathCostFunctionLiveWire< TInputImageType >::OutputPixelType

Definition at line 61 of file itkShortestPathCostFunctionLiveWire.h.

◆ Pointer

template<class TInputImageType >
typedef SmartPointer<Self> itk::ShortestPathCostFunctionLiveWire< TInputImageType >::Pointer

Definition at line 46 of file itkShortestPathCostFunctionLiveWire.h.

◆ RegionType

template<class TInputImageType >
typedef itk::ImageRegion<2> itk::ShortestPathCostFunctionLiveWire< TInputImageType >::RegionType

Definition at line 66 of file itkShortestPathCostFunctionLiveWire.h.

◆ Self

template<class TInputImageType >
typedef ShortestPathCostFunctionLiveWire itk::ShortestPathCostFunctionLiveWire< TInputImageType >::Self

Standard class typedefs.

Definition at line 44 of file itkShortestPathCostFunctionLiveWire.h.

◆ Superclass

template<class TInputImageType >
typedef ShortestPathCostFunction<TInputImageType> itk::ShortestPathCostFunctionLiveWire< TInputImageType >::Superclass

Definition at line 45 of file itkShortestPathCostFunctionLiveWire.h.

◆ UnsignedCharImageType

template<class TInputImageType >
typedef itk::Image<unsigned char, 2> itk::ShortestPathCostFunctionLiveWire< TInputImageType >::UnsignedCharImageType

Definition at line 55 of file itkShortestPathCostFunctionLiveWire.h.

◆ VectorOutputImageType

template<class TInputImageType >
typedef itk::Image<OutputPixelType, 2> itk::ShortestPathCostFunctionLiveWire< TInputImageType >::VectorOutputImageType

Definition at line 62 of file itkShortestPathCostFunctionLiveWire.h.

Member Enumeration Documentation

◆ Constants

template<class TInputImageType >
enum itk::ShortestPathCostFunctionLiveWire::Constants
Enumerator
MAPSCALEFACTOR 

Definition at line 104 of file itkShortestPathCostFunctionLiveWire.h.

Constructor & Destructor Documentation

◆ ShortestPathCostFunctionLiveWire()

template<class TInputImageType >
itk::ShortestPathCostFunctionLiveWire< TInputImageType >::ShortestPathCostFunctionLiveWire ( )
protected

◆ ~ShortestPathCostFunctionLiveWire()

template<class TInputImageType >
itk::ShortestPathCostFunctionLiveWire< TInputImageType >::~ShortestPathCostFunctionLiveWire ( )
inlineoverrideprotected

Definition at line 127 of file itkShortestPathCostFunctionLiveWire.h.

Member Function Documentation

◆ AddRepulsivePoint()

template<class TInputImageType >
virtual void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::AddRepulsivePoint ( const IndexType index)
virtual

Add void pixel in cost map.

◆ ClearRepulsivePoints()

template<class TInputImageType >
virtual void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::ClearRepulsivePoints ( )
virtual

Clear repulsive points in cost function.

◆ Clone()

template<class TInputImageType >
Pointer itk::ShortestPathCostFunctionLiveWire< TInputImageType >::Clone ( ) const

◆ Gaussian()

template<class TInputImageType >
static double itk::ShortestPathCostFunctionLiveWire< TInputImageType >::Gaussian ( double  x,
double  xOfGaussian,
double  yOfGaussian 
)
static

Returns the y value of gaussian with given offset and amplitude.

gaussian approximation f(x) = v(bin) * e^ ( -1/2 * (|x-k(bin)| / sigma)^2 )

Parameters
x
xOfGaussian- offset
yOfGaussian- amplitude

◆ GetClassName()

template<class TInputImageType >
virtual const char* itk::ShortestPathCostFunctionLiveWire< TInputImageType >::GetClassName ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::ShortestPathCostFunction< TInputImageType >.

◆ GetCost()

template<class TInputImageType >
double itk::ShortestPathCostFunctionLiveWire< TInputImageType >::GetCost ( IndexType  p1,
IndexType  p2 
)
overridevirtual

calculates the costs for going from p1 to p2

Implements itk::ShortestPathCostFunction< TInputImageType >.

◆ GetEdgeImage()

template<class TInputImageType >
const FloatImageType* itk::ShortestPathCostFunctionLiveWire< TInputImageType >::GetEdgeImage ( )
inline

Definition at line 122 of file itkShortestPathCostFunctionLiveWire.h.

◆ GetGradientImage()

template<class TInputImageType >
const VectorOutputImageType* itk::ShortestPathCostFunctionLiveWire< TInputImageType >::GetGradientImage ( )
inline

Definition at line 123 of file itkShortestPathCostFunctionLiveWire.h.

◆ GetGradientMagnitudeImage()

template<class TInputImageType >
const FloatImageType* itk::ShortestPathCostFunctionLiveWire< TInputImageType >::GetGradientMagnitudeImage ( )
inline

Definition at line 121 of file itkShortestPathCostFunctionLiveWire.h.

◆ GetMaskImage()

template<class TInputImageType >
const UnsignedCharImageType* itk::ShortestPathCostFunctionLiveWire< TInputImageType >::GetMaskImage ( )
inline

Definition at line 120 of file itkShortestPathCostFunctionLiveWire.h.

◆ GetMinCost()

template<class TInputImageType >
double itk::ShortestPathCostFunctionLiveWire< TInputImageType >::GetMinCost ( )
overridevirtual

returns the minimal costs possible (needed for A*)

Implements itk::ShortestPathCostFunction< TInputImageType >.

◆ GetRequestedRegion()

template<class TInputImageType >
virtual RegionType itk::ShortestPathCostFunctionLiveWire< TInputImageType >::GetRequestedRegion ( )
virtual

◆ Initialize()

template<class TInputImageType >
void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::Initialize ( )
overridevirtual

Initialize the metric.

Implements itk::ShortestPathCostFunction< TInputImageType >.

◆ New()

template<class TInputImageType >
static Pointer itk::ShortestPathCostFunctionLiveWire< TInputImageType >::New ( )
static

Method for creation through the object factory.

◆ RemoveRepulsivePoint()

template<class TInputImageType >
virtual void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::RemoveRepulsivePoint ( const IndexType index)
virtual

Remove void pixel in cost map.

◆ SetCostMapMaximum()

template<class TInputImageType >
void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::SetCostMapMaximum ( double  max)
inline

Set the maximum of the dynamic cost map to save computation time.

Definition at line 103 of file itkShortestPathCostFunctionLiveWire.h.

◆ SetDynamicCostMap()

template<class TInputImageType >
void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::SetDynamicCostMap ( std::map< int, int > &  costMap)
inline

Definition at line 91 of file itkShortestPathCostFunctionLiveWire.h.

◆ SetImage()

template<class TInputImageType >
void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::SetImage ( const TInputImageType *  _arg)
overridevirtual

◆ SetRequestedRegion()

template<class TInputImageType >
virtual void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::SetRequestedRegion ( RegionType  _arg)
virtual

◆ SetUseCostMap()

template<class TInputImageType >
void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::SetUseCostMap ( bool  useCostMap)
inline

Definition at line 99 of file itkShortestPathCostFunctionLiveWire.h.

Member Data Documentation

◆ endValue

template<class TInputImageType >
Superclass::PixelType itk::ShortestPathCostFunctionLiveWire< TInputImageType >::endValue
protected

Definition at line 141 of file itkShortestPathCostFunctionLiveWire.h.

◆ m_CostMap

template<class TInputImageType >
std::map<int, int> itk::ShortestPathCostFunctionLiveWire< TInputImageType >::m_CostMap
protected

Definition at line 149 of file itkShortestPathCostFunctionLiveWire.h.

◆ m_EdgeImage

template<class TInputImageType >
FloatImageType::Pointer itk::ShortestPathCostFunctionLiveWire< TInputImageType >::m_EdgeImage
protected

Definition at line 130 of file itkShortestPathCostFunctionLiveWire.h.

◆ m_GradientImage

template<class TInputImageType >
VectorOutputImageType::Pointer itk::ShortestPathCostFunctionLiveWire< TInputImageType >::m_GradientImage
protected

Definition at line 132 of file itkShortestPathCostFunctionLiveWire.h.

◆ m_GradientMagnitudeImage

template<class TInputImageType >
FloatImageType::Pointer itk::ShortestPathCostFunctionLiveWire< TInputImageType >::m_GradientMagnitudeImage
protected

Definition at line 127 of file itkShortestPathCostFunctionLiveWire.h.

◆ m_GradientMax

template<class TInputImageType >
double itk::ShortestPathCostFunctionLiveWire< TInputImageType >::m_GradientMax
protected

Definition at line 143 of file itkShortestPathCostFunctionLiveWire.h.

◆ m_Initialized

template<class TInputImageType >
bool itk::ShortestPathCostFunctionLiveWire< TInputImageType >::m_Initialized
protected

Definition at line 147 of file itkShortestPathCostFunctionLiveWire.h.

◆ m_MaskImage

template<class TInputImageType >
UnsignedCharImageType::Pointer itk::ShortestPathCostFunctionLiveWire< TInputImageType >::m_MaskImage
protected

Definition at line 131 of file itkShortestPathCostFunctionLiveWire.h.

◆ m_MaxMapCosts

template<class TInputImageType >
double itk::ShortestPathCostFunctionLiveWire< TInputImageType >::m_MaxMapCosts
protected

Definition at line 153 of file itkShortestPathCostFunctionLiveWire.h.

◆ m_MinCosts

template<class TInputImageType >
double itk::ShortestPathCostFunctionLiveWire< TInputImageType >::m_MinCosts
protected

Definition at line 134 of file itkShortestPathCostFunctionLiveWire.h.

◆ m_RequestedRegion

template<class TInputImageType >
RegionType itk::ShortestPathCostFunctionLiveWire< TInputImageType >::m_RequestedRegion
protected

Definition at line 145 of file itkShortestPathCostFunctionLiveWire.h.

◆ m_UseCostMap

template<class TInputImageType >
bool itk::ShortestPathCostFunctionLiveWire< TInputImageType >::m_UseCostMap
protected

Definition at line 151 of file itkShortestPathCostFunctionLiveWire.h.

◆ m_UseRepulsivePoints

template<class TInputImageType >
bool itk::ShortestPathCostFunctionLiveWire< TInputImageType >::m_UseRepulsivePoints
protected

Definition at line 136 of file itkShortestPathCostFunctionLiveWire.h.

◆ startValue

template<class TInputImageType >
Superclass::PixelType itk::ShortestPathCostFunctionLiveWire< TInputImageType >::startValue
protected

Definition at line 140 of file itkShortestPathCostFunctionLiveWire.h.

◆ val

template<class TInputImageType >
Superclass::PixelType itk::ShortestPathCostFunctionLiveWire< TInputImageType >::val
protected

Definition at line 138 of file itkShortestPathCostFunctionLiveWire.h.


The documentation for this class was generated from the following file: