ITK  5.0.0
Insight Segmentation and Registration 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 >
53  public SpatialFunction< double, VSpaceDimension, Point< TCoordRep, VSpaceDimension > >
54 {
55 public:
56  ITK_DISALLOW_COPY_AND_ASSIGN(ShapeSignedDistanceFunction);
57 
60  using Superclass = SpatialFunction< double, VSpaceDimension,
62 
65 
68 
71 
73  using InputType = typename Superclass::InputType;
74 
76  static constexpr unsigned int SpaceDimension = VSpaceDimension;
77 
79  using CoordRepType = TCoordRep;
80 
83 
86 
88  virtual void SetParameters(const ParametersType &) = 0;
89 
91  { return m_Parameters; }
92  virtual unsigned int GetNumberOfShapeParameters() const = 0;
93 
94  virtual unsigned int GetNumberOfPoseParameters() const = 0;
95 
96  virtual unsigned int GetNumberOfParameters() const
97  { return this->GetNumberOfShapeParameters() + this->GetNumberOfPoseParameters(); }
98 
100  OutputType Evaluate(const PointType & point) const override = 0;
101 
104  virtual void Initialize() {}
105 
106 protected:
107 
108  ShapeSignedDistanceFunction() = default;
109 
110  ~ShapeSignedDistanceFunction() override = default;
111 
112  void PrintSelf(std::ostream & os, Indent indent) const override
113  {
114  Superclass::PrintSelf(os, indent);
115 //FIX os << indent << "Parameters: " << m_Parameters << std::endl;
116  }
117 
119 };
120 } // end namespace itk
121 
122 #endif
virtual unsigned int GetNumberOfShapeParameters() const =0
Light weight base class for most itk classes.
virtual unsigned int GetNumberOfPoseParameters() const =0
OutputType Evaluate(const PointType &point) const override=0
virtual unsigned int GetNumberOfParameters() const
typename Superclass::InputType InputType
void PrintSelf(std::ostream &os, Indent indent) const override
virtual void SetParameters(const ParametersType &)=0
Base class for functions which evaluates the signed distance from a shape.
~ShapeSignedDistanceFunction() override=default
typename Superclass::OutputType OutputType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
static constexpr unsigned int SpaceDimension
N-dimensional spatial function class.
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:52