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;
69 double GetCost(IndexType p1, IndexType p2)
override;
72 double GetMinCost()
override;
75 void Initialize()
override;
78 virtual void AddRepulsivePoint(
const IndexType &index);
81 virtual void RemoveRepulsivePoint(
const IndexType &index);
84 virtual void ClearRepulsivePoints();
86 itkSetMacro(RequestedRegion, RegionType);
87 itkGetMacro(RequestedRegion, RegionType);
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);
120 const UnsignedCharImageType *
GetMaskImage() {
return this->m_MaskImage.GetPointer(); };
122 const FloatImageType *
GetEdgeImage() {
return this->m_EdgeImage.GetPointer(); };
123 const VectorOutputImageType *
GetGradientImage() {
return this->m_GradientImage.GetPointer(); };
129 FloatImageType::Pointer m_GradientMagnitudeImage;
156 double SigmoidFunction(
double I,
double max,
double min,
double alpha,
double beta);
161 #ifndef ITK_MANUAL_INSTANTIATION Superclass::PixelType endValue
const FloatImageType * GetEdgeImage()
TInputImageType::IndexType IndexType
itk::ImageRegion< 2 > RegionType
itk::Image< float, 2 > FloatImageType
~ShortestPathCostFunctionLiveWire() override
const UnsignedCharImageType * GetMaskImage()
itk::Image< unsigned char, 2 > UnsignedCharImageType
itk::Image< OutputPixelType, 2 > VectorOutputImageType
FloatImageType::Pointer m_EdgeImage
Superclass::PixelType val
SmartPointer< const Self > ConstPointer
void SetUseCostMap(bool useCostMap)
const FloatImageType * GetGradientMagnitudeImage()
Superclass::PixelType startValue
RegionType m_RequestedRegion
itk::ImageRegionConstIterator< TInputImageType > ConstIteratorType
SmartPointer< Self > Pointer
ShortestPathCostFunctionLiveWire Self
TInputImageType ImageType
const VectorOutputImageType * GetGradientImage()
bool m_UseRepulsivePoints
Cost function for LiveWire purposes. Specific features are considered to calculate cummulative costs ...
void SetDynamicCostMap(std::map< int, int > &costMap)
std::map< int, int > m_CostMap
itk::CovariantVector< ComponentType, 2 > OutputPixelType
TInputImageType::PixelType PixelType
UnsignedCharImageType::Pointer m_MaskImage
VectorOutputImageType::Pointer m_GradientImage
ShortestPathCostFunction< TInputImageType > Superclass
void SetCostMapMaximum(double max)
Set the maximum of the dynamic cost map to save computation time.