00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkAffineGeometryFrame_h
00018 #define __itkAffineGeometryFrame_h
00019
00020 #include <itkObject.h>
00021 #include <itkMacro.h>
00022 #include <itkScalableAffineTransform.h>
00023 #include <itkBoundingBox.h>
00024
00025 namespace itk
00026 {
00027
00031 template <class TScalarType = double, unsigned int NDimensions = 3>
00032 class AffineGeometryFrame : public itk::Object
00033 {
00034 public:
00035 typedef AffineGeometryFrame Self;
00036 typedef itk::Object Superclass;
00037 typedef SmartPointer<Self> Pointer;
00038 typedef SmartPointer<const Self> ConstPointer;
00039
00040 typedef ScalableAffineTransform<TScalarType, NDimensions> TransformType;
00041 typedef BoundingBox<unsigned long, NDimensions, TScalarType> BoundingBoxType;
00042 typedef typename BoundingBoxType::BoundsArrayType BoundsArrayType;
00043 typedef typename BoundingBoxType::Pointer BoundingBoxPointer;
00044
00046 itkNewMacro(Self);
00047
00049 itkTypeMacro(AffineGeometryFrame, Object);
00050
00052 itkGetConstObjectMacro(BoundingBox, BoundingBoxType);
00053
00054 const BoundsArrayType GetBounds() const
00055 {
00056 assert(m_BoundingBox.IsNotNull());
00057 return m_BoundingBox->GetBounds();
00058 }
00059
00062 virtual void SetBounds(const BoundsArrayType& bounds);
00063
00065 TScalarType GetExtent(unsigned int direction) const
00066 {
00067 assert(direction<NDimensions);
00068 assert(m_BoundingBox.IsNotNull());
00069 BoundsArrayType bounds = m_BoundingBox->GetBounds();
00070 return bounds[direction*2+1]-bounds[direction*2];
00071 }
00072
00074 itkGetConstObjectMacro(IndexToObjectTransform, TransformType);
00075 itkGetObjectMacro(IndexToObjectTransform, TransformType);
00076 itkSetObjectMacro(IndexToObjectTransform, TransformType);
00077
00079 itkGetConstObjectMacro(ObjectToNodeTransform, TransformType);
00080 itkGetObjectMacro(ObjectToNodeTransform, TransformType);
00081 itkSetObjectMacro(ObjectToNodeTransform, TransformType);
00082
00084 itkGetConstObjectMacro(IndexToWorldTransform, TransformType);
00085 itkGetObjectMacro(IndexToWorldTransform, TransformType);
00086 itkSetObjectMacro(IndexToWorldTransform, TransformType);
00087
00088
00091 itkGetConstObjectMacro(IndexToNodeTransform, TransformType);
00092
00094 virtual void Initialize();
00095
00097 virtual Pointer Clone() const;
00098
00099 protected:
00100
00101 AffineGeometryFrame();
00102 virtual ~AffineGeometryFrame();
00103
00105 virtual void InitializeGeometry(Self * newGeometry) const;
00106 void SetBoundsArray(const BoundsArrayType& bounds, BoundingBoxPointer& boundingBox);
00107 mutable BoundingBoxPointer m_BoundingBox;
00108
00110 typename TransformType::Pointer m_IndexToObjectTransform;
00111 typename TransformType::Pointer m_ObjectToNodeTransform;
00112 typename TransformType::Pointer m_IndexToNodeTransform;
00113 typename TransformType::Pointer m_IndexToWorldTransform;
00114 };
00115
00116 }
00117
00118
00119 #ifndef ITK_MANUAL_INSTANTIATION
00120 #include "itkAffineGeometryFrame.txx"
00121 #endif
00122
00123
00124 #endif