ITK  4.4.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< class TScalarType = double, unsigned int NDimensions = 3 >
33 class ITK_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  TScalarType 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;
100 
101 protected:
102 
104  virtual ~AffineGeometryFrame();
105  void PrintSelf(std::ostream & os, Indent indent) const;
106 
108  virtual void InitializeGeometry(Self *newGeometry) const;
109 
110  void SetBoundsArray(const BoundsArrayType & bounds,
111  BoundingBoxPointer & boundingBox);
112 
114 
120 
121 private:
122  AffineGeometryFrame(const Self &); //purposely not implemented
123  void operator=(const Self &); //purposely not implemented
124 };
125 } // namespace itk
126 
127 #ifndef ITK_MANUAL_INSTANTIATION
128 #include "itkAffineGeometryFrame.hxx"
129 #endif
130 
131 #endif /* __itkAffineGeometryFrame_h */
132