ITK  5.0.0
Insight Segmentation and Registration Toolkit
itkBoxSpatialObject.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
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 {
35 template< unsigned int TDimension = 3 >
36 class ITK_TEMPLATE_EXPORT BoxSpatialObject:
37  public SpatialObject< TDimension >
38 {
39 public:
40  ITK_DISALLOW_COPY_AND_ASSIGN(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 
58  itkSetMacro( SizeInObjectSpace, SizeType );
59 
61  itkGetConstReferenceMacro(SizeInObjectSpace, SizeType);
62 
64  itkSetMacro( PositionInObjectSpace, PointType );
65 
67  itkGetConstReferenceMacro(PositionInObjectSpace, PointType);
68 
70  bool IsInsideInObjectSpace(const PointType & point, unsigned int depth = 0,
71  const std::string & name = "" ) const override;
72 
76  bool ComputeMyBoundingBox() const override;
77 
78 protected:
80  ~BoxSpatialObject() override = default;
81 
83  void PrintSelf(std::ostream & os, Indent indent) const override;
84 
85  typename LightObject::Pointer InternalClone() const override;
86 
87 private:
91 
92 };
93 } // end namespace itk
94 
95 #ifndef ITK_MANUAL_INSTANTIATION
96 #include "itkBoxSpatialObject.hxx"
97 #endif
98 
99 #endif // itkBoxSpatialObject_h
The class may be used to represent N-dimensional boxes. In two dimensions it is a rectangle...
typename Superclass::PointType PointType
typename Superclass::BoundingBoxType BoundingBoxType
Implementation of the composite pattern.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
typename Superclass::TransformType TransformType
typename BoundingBoxType::PointsContainer PointsContainerType
Base class for most ITK classes.
Definition: itkObject.h:60
Base class for all data objects in ITK.