ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkAffineGeometryFrame.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 itkAffineGeometryFrame_h
19 #define itkAffineGeometryFrame_h
20 
21 #include "itkObject.h"
22 #include "itkMacro.h"
24 #include "itkBoundingBox.h"
25 
26 namespace itk
27 {
32 template< typename TScalar = double, unsigned int NDimensions = 3 >
33 class ITK_TEMPLATE_EXPORT AffineGeometryFrame:public Object
34 {
35 public:
37  typedef Object Superclass;
40 
45 
47  itkNewMacro(Self);
48 
50  itkTypeMacro(AffineGeometryFrame, Object);
51 
53  itkGetModifiableObjectMacro(BoundingBox, BoundingBoxType);
54 
55  const BoundsArrayType GetBounds() const
56  {
57  itkAssertInDebugAndIgnoreInReleaseMacro( m_BoundingBox.IsNotNull() );
58  return m_BoundingBox->GetBounds();
59  }
60 
64  virtual void SetBounds(const BoundsArrayType & bounds);
65 
67  TScalar GetExtent(unsigned int direction) const
68  {
69  itkAssertInDebugAndIgnoreInReleaseMacro(direction < NDimensions);
70  itkAssertInDebugAndIgnoreInReleaseMacro( m_BoundingBox.IsNotNull() );
71  BoundsArrayType bounds = m_BoundingBox->GetBounds();
72  return bounds[direction * 2 + 1] - bounds[direction * 2];
73  }
75 
77  itkSetObjectMacro(IndexToObjectTransform, TransformType);
78  itkGetModifiableObjectMacro(IndexToObjectTransform, TransformType);
80 
82  itkSetObjectMacro(ObjectToNodeTransform, TransformType);
83  itkGetModifiableObjectMacro(ObjectToNodeTransform, TransformType);
85 
87  itkSetObjectMacro(IndexToWorldTransform, TransformType);
88  itkGetModifiableObjectMacro(IndexToWorldTransform, TransformType);
90 
93  itkGetModifiableObjectMacro(IndexToNodeTransform, TransformType);
94 
96  virtual void Initialize();
97 
99  virtual LightObject::Pointer InternalClone() const ITK_OVERRIDE;
100 
101 protected:
102 
104  virtual ~AffineGeometryFrame() ITK_OVERRIDE;
105  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
106 
108  virtual void InitializeGeometry(Self *newGeometry) const;
109 
110  void SetBoundsArray(const BoundsArrayType & bounds,
111  BoundingBoxPointer & boundingBox);
112 
113  mutable BoundingBoxPointer m_BoundingBox;
114 
116  typename TransformType::Pointer m_IndexToObjectTransform;
117  typename TransformType::Pointer m_ObjectToNodeTransform;
118  typename TransformType::Pointer m_IndexToNodeTransform;
119  typename TransformType::Pointer m_IndexToWorldTransform;
120 
121 private:
122  ITK_DISALLOW_COPY_AND_ASSIGN(AffineGeometryFrame);
123 };
124 } // namespace itk
125 
126 #ifndef ITK_MANUAL_INSTANTIATION
127 #include "itkAffineGeometryFrame.hxx"
128 #endif
129 
130 #endif /* itkAffineGeometryFrame_h */
Light weight base class for most itk classes.
TScalar GetExtent(unsigned int direction) const
BoundingBoxType::Pointer BoundingBoxPointer
ScalableAffineTransform< TScalar, NDimensions > TransformType
SmartPointer< const Self > ConstPointer
BoundingBoxType::BoundsArrayType BoundsArrayType
Control indentation during Print() invocation.
Definition: itkIndent.h:49
const BoundsArrayType GetBounds() const
Describes the geometry of a data object.
Base class for most ITK classes.
Definition: itkObject.h:59
Affine transformation with a specified center of rotation.
Represent and compute information about bounding boxes.
SmartPointer< Self > Pointer
BoundingBox< IdentifierType, NDimensions, TScalar > BoundingBoxType