ITK  5.3.0
Insight Toolkit
itkShapeSignedDistanceFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkShapeSignedDistanceFunction_h
19 #define itkShapeSignedDistanceFunction_h
20 
21 #include "itkSpatialFunction.h"
22 #include "itkOptimizerParameters.h"
23 
24 namespace itk
25 {
52 template <typename TCoordRep, unsigned int VSpaceDimension>
53 class ITK_TEMPLATE_EXPORT ShapeSignedDistanceFunction
54  : public SpatialFunction<double, VSpaceDimension, Point<TCoordRep, VSpaceDimension>>
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_MOVE(ShapeSignedDistanceFunction);
58 
62 
65 
68 
70  using typename Superclass::OutputType;
71 
73  using typename Superclass::InputType;
74 
76  static constexpr unsigned int SpaceDimension = VSpaceDimension;
77 
79  using CoordRepType = TCoordRep;
80 
83 
86 
88  virtual void
89  SetParameters(const ParametersType &) = 0;
90 
91  virtual ParametersType &
93  {
94  return m_Parameters;
95  }
96  virtual unsigned int
97  GetNumberOfShapeParameters() const = 0;
98 
99  virtual unsigned int
100  GetNumberOfPoseParameters() const = 0;
101 
102  virtual unsigned int
104  {
105  return this->GetNumberOfShapeParameters() + this->GetNumberOfPoseParameters();
106  }
107 
109  OutputType
110  Evaluate(const PointType & point) const override = 0;
111 
114  virtual void
116  {}
117 
118 protected:
119  ShapeSignedDistanceFunction() = default;
120 
121  ~ShapeSignedDistanceFunction() override = default;
122 
123  void
124  PrintSelf(std::ostream & os, Indent indent) const override
125  {
126  Superclass::PrintSelf(os, indent);
127  // FIX os << indent << "Parameters: " << m_Parameters << std::endl;
128  }
129 
131 };
132 } // end namespace itk
133 
134 #endif
itk::OptimizerParameters< double >
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::ShapeSignedDistanceFunction::GetParameters
virtual ParametersType & GetParameters()
Definition: itkShapeSignedDistanceFunction.h:92
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ShapeSignedDistanceFunction::CoordRepType
TCoordRep CoordRepType
Definition: itkShapeSignedDistanceFunction.h:79
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkOptimizerParameters.h
itk::ShapeSignedDistanceFunction::m_Parameters
ParametersType m_Parameters
Definition: itkShapeSignedDistanceFunction.h:130
itk::ShapeSignedDistanceFunction
Base class for functions which evaluates the signed distance from a shape.
Definition: itkShapeSignedDistanceFunction.h:53
itkSpatialFunction.h
itk::ShapeSignedDistanceFunction::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkShapeSignedDistanceFunction.h:124
itk::SpatialFunction
N-dimensional spatial function class.
Definition: itkSpatialFunction.h:45
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
itk::ShapeSignedDistanceFunction::GetNumberOfParameters
virtual unsigned int GetNumberOfParameters() const
Definition: itkShapeSignedDistanceFunction.h:103
itk::ShapeSignedDistanceFunction::Initialize
virtual void Initialize()
Definition: itkShapeSignedDistanceFunction.h:115