ITK  5.2.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  * 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 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 PointType = typename Superclass::PointType;
50  using TransformType = typename Superclass::TransformType;
51  using BoundingBoxType = typename Superclass::BoundingBoxType;
54 
56 
57  static constexpr unsigned int ObjectDimension = TDimension;
58 
60  itkNewMacro(Self);
61 
63  itkTypeMacro(EllipseSpatialObject, SpatialObject);
64 
67  void
68  Clear() override;
69 
72  void
73  SetRadiusInObjectSpace(double radius);
74 
76  itkSetMacro(RadiusInObjectSpace, ArrayType);
77 
79  itkGetConstReferenceMacro(RadiusInObjectSpace, ArrayType);
80 
82  itkSetMacro(CenterInObjectSpace, PointType);
83 
85  itkGetConstReferenceMacro(CenterInObjectSpace, PointType);
86 
88  bool
89  IsInsideInObjectSpace(const PointType & point) const override;
90 
91  /* Avoid hiding the overload that supports depth and name arguments */
92  using Superclass::IsInsideInObjectSpace;
93 
94 #if !defined(ITK_LEGACY_REMOVE)
95  itkLegacyMacro(void SetRadius(double radius)) { this->SetRadiusInObjectSpace(radius); }
96 
97  itkLegacyMacro(void SetRadius(ArrayType radii)) { this->SetRadiusInObjectSpace(radii); }
98 
99  itkLegacyMacro(ArrayType GetRadius() const) { return this->GetRadiusInObjectSpace(); }
100 
101  itkLegacyMacro(void SetRadiiInObjectSpace(ArrayType radii)) { this->SetRadiusInObjectSpace(radii); }
102 #endif
103 protected:
107  void
108  ComputeMyBoundingBox() override;
109 
110  EllipseSpatialObject();
111  ~EllipseSpatialObject() override = default;
112 
114  void
115  PrintSelf(std::ostream & os, Indent indent) const override;
116 
117  typename LightObject::Pointer
118  InternalClone() const override;
119 
120 private:
121  /* object space */
124 };
125 
126 } // end namespace itk
127 
128 #ifndef ITK_MANUAL_INSTANTIATION
129 # include "itkEllipseSpatialObject.hxx"
130 #endif
131 
132 #endif // itkEllipseSpatialObject_h
itk::EllipseSpatialObject::TransformType
typename Superclass::TransformType TransformType
Definition: itkEllipseSpatialObject.h:50
itk::EllipseSpatialObject::m_CenterInObjectSpace
PointType m_CenterInObjectSpace
Definition: itkEllipseSpatialObject.h:123
itk::EllipseSpatialObject::BoundingBoxType
typename Superclass::BoundingBoxType BoundingBoxType
Definition: itkEllipseSpatialObject.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:66
itk::SmartPointer< Self >
itkAffineTransform.h
itk::EllipseSpatialObject
Definition: itkEllipseSpatialObject.h:38
itk::EllipseSpatialObject::m_RadiusInObjectSpace
ArrayType m_RadiusInObjectSpace
Definition: itkEllipseSpatialObject.h:122
itk::EllipseSpatialObject::ScalarType
double ScalarType
Definition: itkEllipseSpatialObject.h:44
itkFixedArray.h
itk::SpatialObject
Implementation of the composite pattern.
Definition: itkSpatialObject.h:57
itk::FixedArray< double, TDimension >
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itk::EllipseSpatialObject::PointType
typename Superclass::PointType PointType
Definition: itkEllipseSpatialObject.h:49
itk::VectorContainer
Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.
Definition: itkVectorContainer.h:48
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293