Medical Imaging Interaction Toolkit  2021.02.99-e55a5d2f
Medical Imaging Interaction Toolkit
itkShortestPathCostFunctionTbss.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 #ifndef __itkShortestPathCostFunctionTbss_h
13 #define __itkShortestPathCostFunctionTbss_h
14 
15 #include "itkObject.h"
16 #include "itkObjectFactory.h"
17 #include "itkShapedNeighborhoodIterator.h"
18 #include "itkShortestPathCostFunction.h" // Superclass of Metrics
19 #include <itkImageRegionConstIterator.h>
20 #include <itkMacro.h>
21 
22 namespace itk
23 {
24  template <class TInputImageType>
26  {
27  public:
33  typedef itk::ImageRegionConstIterator<TInputImageType> ConstIteratorType;
34  typedef typename TInputImageType::IndexType IndexType;
35 
36  typedef itk::Image<float, 3> FloatImageType;
37 
39  itkFactorylessNewMacro(Self);
40  itkCloneMacro(Self);
41 
43  itkTypeMacro(Self, Superclass);
44 
45  // \brief calculates the costs for going from p1 to p2
46  double GetCost(IndexType p1, IndexType p2) override;
47 
48  // \brief Initialize the metric
49  void Initialize() override;
50 
51  // \brief returns the minimal costs possible (needed for A*)
52  double GetMinCost() override;
53 
54  void SetThreshold(double t) { m_Threshold = t; }
55  protected:
57 
59 
60  double m_Threshold;
61 
62  private:
63  };
64 
65 } // end namespace itk
66 
67 #include "itkShortestPathCostFunctionTbss.txx"
68 
69 #endif /* __itkShortestPathCostFunctionTbss_h */
ShortestPathCostFunction< TInputImageType > Superclass
double GetCost(IndexType p1, IndexType p2) override
itk::ImageRegionConstIterator< TInputImageType > ConstIteratorType