ITK  6.0.0
Insight Toolkit
itkBoxSpatialObject.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 itkBoxSpatialObject_h
19 #define itkBoxSpatialObject_h
20 
21 #include "itkSpatialObject.h"
22 #include "itkAffineTransform.h"
23 #include "itkFixedArray.h"
24 
25 namespace itk
26 {
36 template <unsigned int TDimension = 3>
37 class ITK_TEMPLATE_EXPORT BoxSpatialObject : public SpatialObject<TDimension>
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_MOVE(BoxSpatialObject);
41 
43  using ScalarType = double;
48  using typename Superclass::PointType;
49  using typename Superclass::TransformType;
50  using typename Superclass::BoundingBoxType;
53 
54  itkNewMacro(Self);
55  itkOverrideGetNameOfClassMacro(BoxSpatialObject);
56 
59  void
60  Clear() override;
61 
63  itkSetMacro(SizeInObjectSpace, SizeType);
64 
66  itkGetConstReferenceMacro(SizeInObjectSpace, SizeType);
67 
69  itkSetMacro(PositionInObjectSpace, PointType);
70 
72  itkGetConstReferenceMacro(PositionInObjectSpace, PointType);
73 
75  bool
76  IsInsideInObjectSpace(const PointType & point) const override;
77 
78  /* Avoid hiding the overload that supports depth and name arguments */
79  using Superclass::IsInsideInObjectSpace;
80 
81 protected:
85  void
86  ComputeMyBoundingBox() override;
87 
89  ~BoxSpatialObject() override = default;
90 
91  void
92  PrintSelf(std::ostream & os, Indent indent) const override;
93 
94  typename LightObject::Pointer
95  InternalClone() const override;
96 
97 private:
98  SizeType m_SizeInObjectSpace{};
99  PointType m_PositionInObjectSpace{};
100 };
101 } // end namespace itk
102 
103 #ifndef ITK_MANUAL_INSTANTIATION
104 # include "itkBoxSpatialObject.hxx"
105 #endif
106 
107 #endif // itkBoxSpatialObject_h
itkSpatialObject.h
itk::GTest::TypedefsAndConstructors::Dimension2::PointType
ImageBaseType::PointType PointType
Definition: itkGTestTypedefsAndConstructors.h:51
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itkAffineTransform.h
itk::BoxSpatialObject::ScalarType
double ScalarType
Definition: itkBoxSpatialObject.h:43
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::BoundingBox::PointsContainer
TPointsContainer PointsContainer
Definition: itkBoundingBox.h:93
itk::SpatialObject
Implementation of the composite pattern.
Definition: itkSpatialObject.h:58
itk::BoxSpatialObject
The class may be used to represent N-dimensional boxes. In two dimensions it is a rectangle,...
Definition: itkBoxSpatialObject.h:37
itk::FixedArray< double, TDimension >
itk::BoxSpatialObject::PointsContainerType
typename BoundingBoxType::PointsContainer PointsContainerType
Definition: itkBoxSpatialObject.h:52
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