ITK  5.2.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 ShapeSignedDistanceFunction : public SpatialFunction<double, VSpaceDimension, Point<TCoordRep, VSpaceDimension>>
54 {
55 public:
56  ITK_DISALLOW_COPY_AND_MOVE(ShapeSignedDistanceFunction);
57 
61 
64 
67 
70 
72  using InputType = typename Superclass::InputType;
73 
75  static constexpr unsigned int SpaceDimension = VSpaceDimension;
76 
78  using CoordRepType = TCoordRep;
79 
82 
85 
87  virtual void
88  SetParameters(const ParametersType &) = 0;
89 
90  virtual ParametersType &
92  {
93  return m_Parameters;
94  }
95  virtual unsigned int
96  GetNumberOfShapeParameters() const = 0;
97 
98  virtual unsigned int
99  GetNumberOfPoseParameters() const = 0;
100 
101  virtual unsigned int
103  {
104  return this->GetNumberOfShapeParameters() + this->GetNumberOfPoseParameters();
105  }
106 
108  OutputType
109  Evaluate(const PointType & point) const override = 0;
110 
113  virtual void
115  {}
116 
117 protected:
118  ShapeSignedDistanceFunction() = default;
119 
120  ~ShapeSignedDistanceFunction() override = default;
121 
122  void
123  PrintSelf(std::ostream & os, Indent indent) const override
124  {
125  Superclass::PrintSelf(os, indent);
126  // FIX os << indent << "Parameters: " << m_Parameters << std::endl;
127  }
128 
130 };
131 } // end namespace itk
132 
133 #endif
itk::ShapeSignedDistanceFunction::~ShapeSignedDistanceFunction
~ShapeSignedDistanceFunction() override=default
itk::ShapeSignedDistanceFunction::PointType
InputType PointType
Definition: itkShapeSignedDistanceFunction.h:81
itk::ShapeSignedDistanceFunction::GetNumberOfPoseParameters
virtual unsigned int GetNumberOfPoseParameters() const =0
itk::OptimizerParameters< double >
itk::SpatialFunction< double, VSpaceDimension, Point< TCoordRep, VSpaceDimension > >::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
itk::ShapeSignedDistanceFunction::GetParameters
virtual ParametersType & GetParameters()
Definition: itkShapeSignedDistanceFunction.h:91
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::ShapeSignedDistanceFunction::ShapeSignedDistanceFunction
ShapeSignedDistanceFunction()=default
itk::ShapeSignedDistanceFunction::GetNumberOfShapeParameters
virtual unsigned int GetNumberOfShapeParameters() const =0
itk::SpatialFunction< double, VSpaceDimension, Point< TCoordRep, VSpaceDimension > >::OutputType
typename Superclass::OutputType OutputType
Definition: itkSpatialFunction.h:63
itk::ShapeSignedDistanceFunction::CoordRepType
TCoordRep CoordRepType
Definition: itkShapeSignedDistanceFunction.h:78
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itkOptimizerParameters.h
itk::ShapeSignedDistanceFunction::SpaceDimension
static constexpr unsigned int SpaceDimension
Definition: itkShapeSignedDistanceFunction.h:75
itk::ShapeSignedDistanceFunction::m_Parameters
ParametersType m_Parameters
Definition: itkShapeSignedDistanceFunction.h:129
itk::ShapeSignedDistanceFunction
Base class for functions which evaluates the signed distance from a shape.
Definition: itkShapeSignedDistanceFunction.h:53
itkSpatialFunction.h
itk::ShapeSignedDistanceFunction::SetParameters
virtual void SetParameters(const ParametersType &)=0
itk::ShapeSignedDistanceFunction::PrintSelf
void PrintSelf(std::ostream &os, Indent indent) const override
Definition: itkShapeSignedDistanceFunction.h:123
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::ShapeSignedDistanceFunction::Evaluate
OutputType Evaluate(const PointType &point) const override=0
itk::ShapeSignedDistanceFunction::OutputType
typename Superclass::OutputType OutputType
Definition: itkShapeSignedDistanceFunction.h:69
itk::ShapeSignedDistanceFunction::InputType
typename Superclass::InputType InputType
Definition: itkShapeSignedDistanceFunction.h:72
itk::SpatialFunction< double, VSpaceDimension, Point< TCoordRep, VSpaceDimension > >::InputType
typename Superclass::InputType InputType
Definition: itkSpatialFunction.h:60
itk::ShapeSignedDistanceFunction::GetNumberOfParameters
virtual unsigned int GetNumberOfParameters() const
Definition: itkShapeSignedDistanceFunction.h:102
itk::ShapeSignedDistanceFunction::Initialize
virtual void Initialize()
Definition: itkShapeSignedDistanceFunction.h:114