ITK  6.0.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  * https://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 TCoordinate, unsigned int VSpaceDimension>
53 class ITK_TEMPLATE_EXPORT ShapeSignedDistanceFunction
54  : public SpatialFunction<double, VSpaceDimension, Point<TCoordinate, VSpaceDimension>>
55 {
56 public:
57  ITK_DISALLOW_COPY_AND_MOVE(ShapeSignedDistanceFunction);
58 
62 
65 
67  itkOverrideGetNameOfClassMacro(ShapeSignedDistanceFunction);
68 
70  using typename Superclass::OutputType;
71 
73  using typename Superclass::InputType;
74 
76  static constexpr unsigned int SpaceDimension = VSpaceDimension;
77 
79  using CoordinateType = TCoordinate;
80 #ifndef ITK_FUTURE_LEGACY_REMOVE
81  using CoordRepType ITK_FUTURE_DEPRECATED(
82  "ITK 6 discourages using `CoordRepType`. Please use `CoordinateType` instead!") = CoordinateType;
83 #endif
84 
87 
90 
92  virtual void
93  SetParameters(const ParametersType &) = 0;
94 
95  virtual ParametersType &
97  {
98  return m_Parameters;
99  }
100  virtual unsigned int
101  GetNumberOfShapeParameters() const = 0;
102 
103  virtual unsigned int
104  GetNumberOfPoseParameters() const = 0;
105 
106  virtual unsigned int
108  {
109  return this->GetNumberOfShapeParameters() + this->GetNumberOfPoseParameters();
110  }
111 
113  OutputType
114  Evaluate(const PointType & point) const override = 0;
115 
118  virtual void
120  {}
121 
122 protected:
123  ShapeSignedDistanceFunction() = default;
124 
125  ~ShapeSignedDistanceFunction() override = default;
126 
127  void
128  PrintSelf(std::ostream & os, Indent indent) const override
129  {
130  Superclass::PrintSelf(os, indent);
131  // FIX os << indent << "Parameters: " << m_Parameters << std::endl;
132  }
133 
134  ParametersType m_Parameters{};
135 };
136 } // end namespace itk
137 
138 #endif
itk::OptimizerParameters< double >
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ShapeSignedDistanceFunction::GetNumberOfParameters
virtual unsigned int GetNumberOfParameters() const
Definition: itkShapeSignedDistanceFunction.h:107
itk::ShapeSignedDistanceFunction::GetParameters
virtual ParametersType & GetParameters()
Definition: itkShapeSignedDistanceFunction.h:96
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:55
itkOptimizerParameters.h
itk::ShapeSignedDistanceFunction
Base class for functions which evaluates the signed distance from a shape.
Definition: itkShapeSignedDistanceFunction.h:53
itk::point
*par Constraints *The filter requires an image with at least two dimensions and a vector *length of at least The theory supports extension to scalar but *the implementation of the itk vector classes do not **The template parameter TRealType must be floating point(float or double) or *a user-defined "real" numerical type with arithmetic operations defined *sufficient to compute derivatives. **\par Performance *This filter will automatically multithread if run with *SetUsePrincipleComponents
itkSpatialFunction.h
itk::ShapeSignedDistanceFunction::CoordinateType
TCoordinate CoordinateType
Definition: itkShapeSignedDistanceFunction.h:79
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: itkAnatomicalOrientation.h:29
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
itk::ShapeSignedDistanceFunction::Initialize
virtual void Initialize()
Definition: itkShapeSignedDistanceFunction.h:119
itk::ShapeSignedDistanceFunction::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkShapeSignedDistanceFunction.h:128