ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkSphereSignedDistanceFunction.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 itkSphereSignedDistanceFunction_h
19 #define itkSphereSignedDistanceFunction_h
20 
22 #include "itkVector.h"
23 
24 namespace itk
25 {
43 template< typename TCoordRep, unsigned int VSpaceDimension >
44 class ITK_TEMPLATE_EXPORT SphereSignedDistanceFunction:
45  public ShapeSignedDistanceFunction< TCoordRep, VSpaceDimension >
46 {
47 public:
48  ITK_DISALLOW_COPY_AND_ASSIGN(SphereSignedDistanceFunction);
49 
55 
57  itkTypeMacro(SphereSignedDistanceFunction, ShapeSignedDistancFunction);
58 
60  itkNewMacro(Self);
61 
63  using OutputType = typename Superclass::OutputType;
64 
66  using InputType = typename Superclass::InputType;
67 
69  static constexpr unsigned int SpaceDimension = Superclass::SpaceDimension;
70 
72  using CoordRepType = typename Superclass::CoordRepType;
73 
75  using PointType = typename Superclass::PointType;
76 
78  using ParametersType = typename Superclass::ParametersType;
79 
82  void SetParameters(const ParametersType &) override;
83 
84  unsigned int GetNumberOfShapeParameters() const override
85  { return 1; }
86  unsigned int GetNumberOfPoseParameters() const override
87  { return SpaceDimension; }
88 
90  OutputType Evaluate(const PointType & point) const override;
91 
92 protected:
94  ~SphereSignedDistanceFunction() override = default;
95 
96  void PrintSelf(std::ostream & os, Indent indent) const override;
97 
98 private:
100 
102  double m_Radius;
103 };
104 } // end namespace itk
105 
106 #ifndef ITK_MANUAL_INSTANTIATION
107 #include "itkSphereSignedDistanceFunction.hxx"
108 #endif
109 
110 #endif
Light weight base class for most itk classes.
unsigned int GetNumberOfShapeParameters() const override
typename Superclass::InputType InputType
Compute the signed distance from a N-dimensional sphere.
unsigned int GetNumberOfPoseParameters() const override
Base class for functions which evaluates the signed distance from a shape.
typename Superclass::OutputType OutputType
Control indentation during Print() invocation.
Definition: itkIndent.h:49