13 #ifndef itkShortestPathCostFunctionLiveWire_h
14 #define itkShortestPathCostFunctionLiveWire_h
18 #include <itkImageRegionConstIterator.h>
49 template <
class TInputImageType>
61 itkFactorylessNewMacro(
Self);
74 typedef typename TInputImageType::IndexType
IndexType;
155 void SetImage(
const TInputImageType *_arg)
override;
171 this->m_CostMap = costMap;
172 this->m_UseCostMap =
true;
173 this->m_MaxMapCosts = -1;
217 static double Gaussian(
double x,
double xOfGaussian,
double yOfGaussian);
274 double SigmoidFunction(
double I,
double max,
double min,
double alpha,
double beta);
279 #ifndef ITK_MANUAL_INSTANTIATION
280 #include <itkShortestPathCostFunctionLiveWire.tpp>
Cost function for LiveWire interactive segmentation.
ShortestPathCostFunctionLiveWire Self
TInputImageType::IndexType IndexType
const UnsignedCharImageType * GetMaskImage()
Get the repulsive-point mask image.
void Initialize() override
Initialize the cost function by computing derived images.
std::map< int, int > m_CostMap
itk::ImageRegionConstIterator< TInputImageType > ConstIteratorType
itk::Image< OutputPixelType, 2 > VectorOutputImageType
TInputImageType ImageType
const FloatImageType * GetEdgeImage()
Get the computed edge image (Canny edge detection result).
Superclass::PixelType val
Superclass::PixelType endValue
virtual void ClearRepulsivePoints()
Clear all repulsive points from the cost function.
const FloatImageType * GetGradientMagnitudeImage()
Get the computed gradient magnitude image.
void SetCostMapMaximum(double max)
Set the maximum value of the dynamic cost map.
SmartPointer< const Self > ConstPointer
ShortestPathCostFunctionLiveWire()
bool m_UseRepulsivePoints
~ShortestPathCostFunctionLiveWire() override
virtual void RemoveRepulsivePoint(const IndexType &index)
Remove a repulsive point from the cost map.
itk::Image< float, 2 > FloatImageType
void SetImage(const TInputImageType *_arg) override
Set the input image and initialize the mask image.
ShortestPathCostFunction< TInputImageType > Superclass
RegionType m_RequestedRegion
static double Gaussian(double x, double xOfGaussian, double yOfGaussian)
Evaluate a Gaussian function at position x.
UnsignedCharImageType::Pointer m_MaskImage
VectorOutputImageType::Pointer m_GradientImage
void SetUseCostMap(bool useCostMap)
Enable or disable the dynamic cost map.
SmartPointer< Self > Pointer
void SetDynamicCostMap(std::map< int, int > &costMap)
Set a dynamic (non-linear) cost map for gradient magnitude mapping.
itk::CovariantVector< ComponentType, 2 > OutputPixelType
double GetCost(IndexType p1, IndexType p2) override
Calculate the weighted cost of transitioning from p1 to p2.
virtual void AddRepulsivePoint(const IndexType &index)
Mark a pixel as repulsive in the cost map.
Constants
Constants used internally for cost map scaling.
Superclass::PixelType startValue
FloatImageType::Pointer m_GradientMagnitudeImage
double GetMinCost() override
Return the minimal possible cost (needed for the A* heuristic).
FloatImageType::Pointer m_EdgeImage
itk::ImageRegion< 2 > RegionType
const VectorOutputImageType * GetGradientImage()
Get the computed gradient vector image.
itk::Image< unsigned char, 2 > UnsignedCharImageType
Abstract base class for cost functions used by ShortestPathImageFilter.
TInputImageType::IndexType IndexType
TInputImageType::PixelType PixelType