ITK  5.2.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  * 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 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 PointType = typename Superclass::PointType;
49  using TransformType = typename Superclass::TransformType;
50  using BoundingBoxType = typename Superclass::BoundingBoxType;
52  using PointsContainerType = typename BoundingBoxType::PointsContainer;
53 
54  itkNewMacro(Self);
55  itkTypeMacro(BoxSpatialObject, SpatialObject);
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 
92  void
93  PrintSelf(std::ostream & os, Indent indent) const override;
94 
95  typename LightObject::Pointer
96  InternalClone() const override;
97 
98 private:
102 };
103 } // end namespace itk
104 
105 #ifndef ITK_MANUAL_INSTANTIATION
106 # include "itkBoxSpatialObject.hxx"
107 #endif
108 
109 #endif // itkBoxSpatialObject_h
itk::BoxSpatialObject::m_SizeInObjectSpace
SizeType m_SizeInObjectSpace
Definition: itkBoxSpatialObject.h:100
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::BoxSpatialObject::m_PositionInObjectSpace
PointType m_PositionInObjectSpace
Definition: itkBoxSpatialObject.h:101
itk::BoxSpatialObject::PointType
typename Superclass::PointType PointType
Definition: itkBoxSpatialObject.h:48
itkFixedArray.h
itk::SpatialObject
Implementation of the composite pattern.
Definition: itkSpatialObject.h:57
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::BoxSpatialObject::TransformType
typename Superclass::TransformType TransformType
Definition: itkBoxSpatialObject.h:49
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::BoxSpatialObject::BoundingBoxType
typename Superclass::BoundingBoxType BoundingBoxType
Definition: itkBoxSpatialObject.h:50
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itk::DataObject
Base class for all data objects in ITK.
Definition: itkDataObject.h:293