Medical Imaging Interaction Toolkit  2016.11.0
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
 
virtual double GetCost (IndexType p1, IndexType p2)
 calculates the costs for going from p1 to p2 More...
 
virtual double GetMinCost ()
 returns the minimal costs possible (needed for A*) More...
 
virtual void Initialize ()
 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 ()
 
virtual void SetUseApproximateGradient (bool _arg)
 
virtual bool GetUseApproximateGradient ()
 
virtual void SetImage (const TInputImageType *_arg)
 
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 ()
 
virtual ~ShortestPathCostFunctionLiveWire ()
 
- Protected Member Functions inherited from itk::ShortestPathCostFunction< TInputImageType >
 ShortestPathCostFunction ()
 
virtual ~ShortestPathCostFunction ()
 
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 minCosts
 
bool m_UseRepulsivePoints
 
Superclass::PixelType val
 
Superclass::PixelType startValue
 
Superclass::PixelType endValue
 
double m_GradientMax
 
RegionType m_RequestedRegion
 
bool m_UseApproximateGradient
 
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 44 of file itkShortestPathCostFunctionLiveWire.h.

Member Typedef Documentation

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

Definition at line 63 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 52 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 51 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 61 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 68 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 67 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 64 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 50 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 69 of file itkShortestPathCostFunctionLiveWire.h.

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

Standard class typedefs.

Definition at line 48 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 49 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 58 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 65 of file itkShortestPathCostFunctionLiveWire.h.

Member Enumeration Documentation

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

Definition at line 111 of file itkShortestPathCostFunctionLiveWire.h.

Constructor & Destructor Documentation

template<class TInputImageType >
itk::ShortestPathCostFunctionLiveWire< TInputImageType >::ShortestPathCostFunctionLiveWire ( )
protected
template<class TInputImageType >
virtual itk::ShortestPathCostFunctionLiveWire< TInputImageType >::~ShortestPathCostFunctionLiveWire ( )
inlineprotectedvirtual

Definition at line 134 of file itkShortestPathCostFunctionLiveWire.h.

Member Function Documentation

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

Add void pixel in cost map.

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

Clear repulsive points in cost function.

template<class TInputImageType >
Pointer itk::ShortestPathCostFunctionLiveWire< TInputImageType >::Clone ( ) const
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

Referenced by mitk::ImageLiveWireContourModelFilter::CreateDynamicCostMapByITK().

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

Run-time type information (and related methods).

Reimplemented from itk::ShortestPathCostFunction< TInputImageType >.

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

calculates the costs for going from p1 to p2

Implements itk::ShortestPathCostFunction< TInputImageType >.

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

Definition at line 129 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 130 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 128 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 127 of file itkShortestPathCostFunctionLiveWire.h.

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

returns the minimal costs possible (needed for A*)

Implements itk::ShortestPathCostFunction< TInputImageType >.

template<class TInputImageType >
virtual RegionType itk::ShortestPathCostFunctionLiveWire< TInputImageType >::GetRequestedRegion ( )
virtual
template<class TInputImageType >
virtual bool itk::ShortestPathCostFunctionLiveWire< TInputImageType >::GetUseApproximateGradient ( )
virtual
template<class TInputImageType >
virtual void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::Initialize ( )
virtual

Initialize the metric.

Implements itk::ShortestPathCostFunction< TInputImageType >.

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

Method for creation through the object factory.

Referenced by mitk::ImageLiveWireContourModelFilter::ImageLiveWireContourModelFilter().

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

Remove void pixel in cost map.

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 110 of file itkShortestPathCostFunctionLiveWire.h.

References max().

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

Definition at line 98 of file itkShortestPathCostFunctionLiveWire.h.

template<class TInputImageType >
virtual void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::SetImage ( const TInputImageType *  _arg)
virtual
template<class TInputImageType >
virtual void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::SetRequestedRegion ( RegionType  _arg)
virtual
template<class TInputImageType >
virtual void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::SetUseApproximateGradient ( bool  _arg)
virtual
template<class TInputImageType >
void itk::ShortestPathCostFunctionLiveWire< TInputImageType >::SetUseCostMap ( bool  useCostMap)
inline

Definition at line 106 of file itkShortestPathCostFunctionLiveWire.h.

Member Data Documentation

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

Definition at line 148 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 158 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 137 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 139 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 134 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 150 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 156 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 138 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 162 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 152 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 154 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 160 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 143 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 141 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 147 of file itkShortestPathCostFunctionLiveWire.h.

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

Definition at line 145 of file itkShortestPathCostFunctionLiveWire.h.


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