13 #ifndef __itkShortestPathCostFunctionLiveWire_h
14 #define __itkShortestPathCostFunctionLiveWire_h
18 #include "itkImageRegionConstIterator.h"
39 template <
class TInputImageType>
51 itkFactorylessNewMacro(
Self);
64 typedef typename TInputImageType::IndexType
IndexType;
89 void SetImage(
const TInputImageType *_arg)
override;
93 this->m_CostMap = costMap;
94 this->m_UseCostMap =
true;
95 this->m_MaxMapCosts = -1;
99 void SetUseCostMap(
bool useCostMap) { this->m_UseCostMap = useCostMap; }
118 static double Gaussian(
double x,
double xOfGaussian,
double yOfGaussian);
156 double SigmoidFunction(
double I,
double max,
double min,
double alpha,
double beta);
161 #ifndef ITK_MANUAL_INSTANTIATION
162 #include "itkShortestPathCostFunctionLiveWire.txx"
Cost function for LiveWire purposes. Specific features are considered to calculate cumulative costs o...
ShortestPathCostFunctionLiveWire Self
TInputImageType::IndexType IndexType
const UnsignedCharImageType * GetMaskImage()
void Initialize() override
Initialize the metric.
std::map< int, int > m_CostMap
itk::ImageRegionConstIterator< TInputImageType > ConstIteratorType
itk::Image< OutputPixelType, 2 > VectorOutputImageType
TInputImageType ImageType
const FloatImageType * GetEdgeImage()
Superclass::PixelType val
Superclass::PixelType endValue
virtual void ClearRepulsivePoints()
Clear repulsive points in cost function.
const FloatImageType * GetGradientMagnitudeImage()
void SetCostMapMaximum(double max)
Set the maximum of the dynamic cost map to save computation time.
SmartPointer< const Self > ConstPointer
ShortestPathCostFunctionLiveWire()
bool m_UseRepulsivePoints
~ShortestPathCostFunctionLiveWire() override
virtual void RemoveRepulsivePoint(const IndexType &index)
Remove void pixel in cost map.
itk::Image< float, 2 > FloatImageType
void SetImage(const TInputImageType *_arg) override
ShortestPathCostFunction< TInputImageType > Superclass
RegionType m_RequestedRegion
static double Gaussian(double x, double xOfGaussian, double yOfGaussian)
Returns the y value of gaussian with given offset and amplitude.
UnsignedCharImageType::Pointer m_MaskImage
VectorOutputImageType::Pointer m_GradientImage
void SetUseCostMap(bool useCostMap)
SmartPointer< Self > Pointer
void SetDynamicCostMap(std::map< int, int > &costMap)
itk::CovariantVector< ComponentType, 2 > OutputPixelType
double GetCost(IndexType p1, IndexType p2) override
calculates the costs for going from p1 to p2
virtual void AddRepulsivePoint(const IndexType &index)
Add void pixel in cost map.
Superclass::PixelType startValue
FloatImageType::Pointer m_GradientMagnitudeImage
double GetMinCost() override
returns the minimal costs possible (needed for A*)
FloatImageType::Pointer m_EdgeImage
itk::ImageRegion< 2 > RegionType
const VectorOutputImageType * GetGradientImage()
itk::Image< unsigned char, 2 > UnsignedCharImageType
TInputImageType::IndexType IndexType
TInputImageType::PixelType PixelType