ITK  4.2.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  itkGetConstObjectMacro(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  itkGetConstObjectMacro(IndexToObjectTransform, TransformType);
78  itkGetObjectMacro(IndexToObjectTransform, TransformType);
79  itkSetObjectMacro(IndexToObjectTransform, TransformType);
81 
83  itkGetConstObjectMacro(ObjectToNodeTransform, TransformType);
84  itkGetObjectMacro(ObjectToNodeTransform, TransformType);
85  itkSetObjectMacro(ObjectToNodeTransform, TransformType);
87 
89  itkGetConstObjectMacro(IndexToWorldTransform, TransformType);
90  itkGetObjectMacro(IndexToWorldTransform, TransformType);
91  itkSetObjectMacro(IndexToWorldTransform, TransformType);
93 
96  itkGetConstObjectMacro(IndexToNodeTransform, TransformType);
97 
99  virtual void Initialize();
100 
102  virtual LightObject::Pointer InternalClone() const;
103 
104 protected:
105 
107  virtual ~AffineGeometryFrame();
108  void PrintSelf(std::ostream & os, Indent indent) const;
109 
111  virtual void InitializeGeometry(Self *newGeometry) const;
112 
113  void SetBoundsArray(const BoundsArrayType & bounds,
114  BoundingBoxPointer & boundingBox);
115 
117 
123 private:
124  AffineGeometryFrame(const Self &); //purposely not implemented
125  void operator=(const Self &); //purposely not implemented
126 };
127 } // namespace itk
129 
130 #ifndef ITK_MANUAL_INSTANTIATION
131 #include "itkAffineGeometryFrame.hxx"
132 #endif
133 
134 #endif /* __itkAffineGeometryFrame_h */
135