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
25namespace itk
26{
36template <unsigned int TDimension = 3>
37class ITK_TEMPLATE_EXPORT BoxSpatialObject : public SpatialObject<TDimension>
38{
39public:
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
81protected:
85 void
87
89 ~BoxSpatialObject() override = default;
90
91 void
92 PrintSelf(std::ostream & os, Indent indent) const override;
93
95 InternalClone() const override;
96
97private:
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
TPointsContainer PointsContainer
The class may be used to represent N-dimensional boxes. In two dimensions it is a rectangle,...
bool IsInsideInObjectSpace(const PointType &point) const override
typename BoundingBoxType::PointsContainer PointsContainerType
~BoxSpatialObject() override=default
void PrintSelf(std::ostream &os, Indent indent) const override
LightObject::Pointer InternalClone() const override
void ComputeMyBoundingBox() override
void Clear() override
Base class for all data objects in ITK.
Simulate a standard C array with copy semantics.
Definition: itkFixedArray.h:54
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Base class for most ITK classes.
Definition: itkObject.h:62
A templated class holding a geometric point in n-Dimensional space.
Definition: itkPoint.h:54
Implementation of the composite pattern.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
*par Constraints *The filter 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