ITK  6.0.0
Insight Toolkit
itkEllipseSpatialObject.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 itkEllipseSpatialObject_h
19 #define itkEllipseSpatialObject_h
20 
21 #include "itkSpatialObject.h"
22 #include "itkAffineTransform.h"
23 #include "itkFixedArray.h"
24 
25 namespace itk
26 {
37 template <unsigned int TDimension = 3>
38 class ITK_TEMPLATE_EXPORT EllipseSpatialObject : public SpatialObject<TDimension>
39 {
40 public:
41  ITK_DISALLOW_COPY_AND_MOVE(EllipseSpatialObject);
42 
44  using ScalarType = double;
49  using typename Superclass::PointType;
50  using typename Superclass::TransformType;
51  using typename Superclass::BoundingBoxType;
54 
56 
57  static constexpr unsigned int ObjectDimension = TDimension;
58 
60  itkNewMacro(Self);
61 
63  itkOverrideGetNameOfClassMacro(EllipseSpatialObject);
64 
67  void
68  Clear() override;
69 
76  void
77  SetRadiusInObjectSpace(double radius);
78 
80  itkSetMacro(RadiusInObjectSpace, ArrayType);
81 
83  itkGetConstReferenceMacro(RadiusInObjectSpace, ArrayType);
84 
86  itkSetMacro(CenterInObjectSpace, PointType);
87 
89  itkGetConstReferenceMacro(CenterInObjectSpace, PointType);
90 
96  bool
97  IsInsideInObjectSpace(const PointType & point) const override;
98 
99  /* Avoid hiding the overload that supports depth and name arguments */
100  using Superclass::IsInsideInObjectSpace;
101 
102 #if !defined(ITK_LEGACY_REMOVE)
103  itkLegacyMacro(void SetRadius(double radius))
104  {
105  this->SetRadiusInObjectSpace(radius);
106  }
107 
108  itkLegacyMacro(void SetRadius(ArrayType radii))
109  {
110  this->SetRadiusInObjectSpace(radii);
111  }
112 
113  itkLegacyMacro(ArrayType GetRadius() const)
114  {
115  return this->GetRadiusInObjectSpace();
116  }
117 
118  itkLegacyMacro(void SetRadiiInObjectSpace(ArrayType radii))
119  {
120  this->SetRadiusInObjectSpace(radii);
121  }
122 #endif
123 protected:
127  void
128  ComputeMyBoundingBox() override;
129 
130  EllipseSpatialObject();
131  ~EllipseSpatialObject() override = default;
132 
133  void
134  PrintSelf(std::ostream & os, Indent indent) const override;
135 
136  typename LightObject::Pointer
137  InternalClone() const override;
138 
139 private:
140  /* object space */
141  ArrayType m_RadiusInObjectSpace{};
142  PointType m_CenterInObjectSpace{};
143 };
144 
145 } // end namespace itk
146 
147 #ifndef ITK_MANUAL_INSTANTIATION
148 # include "itkEllipseSpatialObject.hxx"
149 #endif
150 
151 #endif // itkEllipseSpatialObject_h
itk::detail::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:51
itkSpatialObject.h
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::LightObject::Pointer
SmartPointer< Self > Pointer
Definition: itkLightObject.h:62
itk::SmartPointer< Self >
itkAffineTransform.h
itk::EllipseSpatialObject
Definition: itkEllipseSpatialObject.h:38
itk::EllipseSpatialObject::ScalarType
double ScalarType
Definition: itkEllipseSpatialObject.h:44
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
itkFixedArray.h
itk::SpatialObject
Implementation of the composite pattern.
Definition: itkSpatialObject.h:58
itk::FixedArray< double, TDimension >
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnatomicalOrientation.h:29
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:61
itk::Point
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:53
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293