ITK  5.1.0
Insight Toolkit
itkShapeSignedDistanceFunction.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
51 template <typename TCoordRep, unsigned int VSpaceDimension>
52 class ShapeSignedDistanceFunction : public SpatialFunction<double, VSpaceDimension, Point<TCoordRep, VSpaceDimension>>
53 {
54 public:
55  ITK_DISALLOW_COPY_AND_ASSIGN(ShapeSignedDistanceFunction);
56 
60 
63 
66 
69 
71  using InputType = typename Superclass::InputType;
72 
74  static constexpr unsigned int SpaceDimension = VSpaceDimension;
75 
77  using CoordRepType = TCoordRep;
78 
81 
84 
86  virtual void
87  SetParameters(const ParametersType &) = 0;
88 
89  virtual ParametersType &
91  {
92  return m_Parameters;
93  }
94  virtual unsigned int
95  GetNumberOfShapeParameters() const = 0;
96 
97  virtual unsigned int
98  GetNumberOfPoseParameters() const = 0;
99 
100  virtual unsigned int
102  {
103  return this->GetNumberOfShapeParameters() + this->GetNumberOfPoseParameters();
104  }
105 
107  OutputType
108  Evaluate(const PointType & point) const override = 0;
109 
112  virtual void
114  {}
115 
116 protected:
117  ShapeSignedDistanceFunction() = default;
118 
119  ~ShapeSignedDistanceFunction() override = default;
120 
121  void
122  PrintSelf(std::ostream & os, Indent indent) const override
123  {
124  Superclass::PrintSelf(os, indent);
125  // FIX os << indent << "Parameters: " << m_Parameters << std::endl;
126  }
127 
129 };
130 } // end namespace itk
131 
132 #endif
itk::ShapeSignedDistanceFunction::~ShapeSignedDistanceFunction
~ShapeSignedDistanceFunction() override=default
itk::ShapeSignedDistanceFunction::PointType
InputType PointType
Definition: itkShapeSignedDistanceFunction.h:80
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:90
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:77
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:74
itk::ShapeSignedDistanceFunction::m_Parameters
ParametersType m_Parameters
Definition: itkShapeSignedDistanceFunction.h:128
itk::ShapeSignedDistanceFunction
Base class for functions which evaluates the signed distance from a shape.
Definition: itkShapeSignedDistanceFunction.h:52
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:122
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: itkArray.h:26
itk::ShapeSignedDistanceFunction::Evaluate
OutputType Evaluate(const PointType &point) const override=0
itk::ShapeSignedDistanceFunction::OutputType
typename Superclass::OutputType OutputType
Definition: itkShapeSignedDistanceFunction.h:68
itk::ShapeSignedDistanceFunction::InputType
typename Superclass::InputType InputType
Definition: itkShapeSignedDistanceFunction.h:71
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:101
itk::ShapeSignedDistanceFunction::Initialize
virtual void Initialize()
Definition: itkShapeSignedDistanceFunction.h:113