vtkMRMLVolumeNode.h

Go to the documentation of this file.
00001 /*=auto=========================================================================
00002 
00003   Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
00004 
00005   See Doc/copyright/copyright.txt
00006   or http://www.slicer.org/copyright/copyright.txt for details.
00007 
00008   Program:   3D Slicer
00009   Module:    $RCSfile: vtkMRMLVolumeNode.h,v $
00010   Date:      $Date: 2006/03/19 17:12:29 $
00011   Version:   $Revision: 1.13 $
00012 
00013 =========================================================================auto=*/
00023 
00024 #ifndef __vtkMRMLVolumeNode_h
00025 #define __vtkMRMLVolumeNode_h
00026 
00027 #include "vtkMatrix4x4.h"
00028 #include "vtkImageData.h"
00029 
00030 #include "vtkMRML.h"
00031 #include "vtkMRMLScene.h"
00032 #include "vtkMRMLNode.h"
00033 #include "vtkMRMLVolumeDisplayNode.h"
00034 #include "vtkMRMLDisplayableNode.h"
00035 
00036 #include "itkMetaDataDictionary.h"
00037 
00038 class vtkImageData;
00039 class vtkMRMLStorageNode;
00040 
00041 class VTK_MRML_EXPORT vtkMRMLVolumeNode : public vtkMRMLDisplayableNode
00042 {
00043   public:
00044   static vtkMRMLVolumeNode *New(){return NULL;};
00045   vtkTypeMacro(vtkMRMLVolumeNode,vtkMRMLDisplayableNode);
00046   void PrintSelf(ostream& os, vtkIndent indent);
00047 
00048   virtual vtkMRMLNode* CreateNodeInstance() = 0;
00049 
00052   virtual void ReadXMLAttributes( const char** atts);
00053 
00056   virtual void WriteXML(ostream& of, int indent);
00057 
00060   virtual void Copy(vtkMRMLNode *node);
00061 
00064   void CopyOrientation(vtkMRMLVolumeNode *node);
00065 
00066 
00069   virtual const char* GetNodeTagName() = 0;
00070 
00073   virtual void UpdateScene(vtkMRMLScene *scene);
00074 
00075   //--------------------------------------------------------------------------
00077   //--------------------------------------------------------------------------
00078 
00084   static void ComputeIJKToRASFromScanOrder(char *order, 
00085                                            double* spacing, int *dims,
00086                                            bool centerImage,
00087                                            vtkMatrix4x4 *IJKToRAS);
00088 
00089   // So it is tcl wrapped
00090   void ComputeIJKToRASFromScanOrder(char *order, 
00091                                     double spacing1, double spacing2, double spacing3, 
00092                                     int dims1, int dims2, int dims3,
00093                                     bool centerImage,
00094                                     vtkMatrix4x4 *IJKToRAS);
00095 
00096   static const char* ComputeScanOrderFromIJKToRAS(vtkMatrix4x4 *IJKToRAS);
00097 
00098 
00099   void SetIJKToRASDirections(double dirs[3][3]);
00100   void SetIJKToRASDirections(double ir, double ia, double is,
00101                              double jr, double ja, double js,
00102                              double kr, double ka, double ks);
00103   void SetIToRASDirection(double ir, double ia, double is);
00104   void SetJToRASDirection(double jr, double ja, double js);
00105   void SetKToRASDirection(double kr, double ka, double ks);
00106 
00107   void GetIJKToRASDirections(double dirs[3][3]);
00108   void GetIToRASDirection(double dirs[3]);
00109   void GetJToRASDirection(double dirs[3]);
00110   void GetKToRASDirection(double dirs[3]);
00111 
00115   vtkGetVector3Macro (Spacing, double);
00116   vtkSetVector3Macro (Spacing, double);
00117   vtkGetVector3Macro (Origin, double);
00118   vtkSetVector3Macro (Origin, double);
00119 
00124   void GetIJKToRASMatrix(vtkMatrix4x4* mat);
00125   void GetRASToIJKMatrix(vtkMatrix4x4* mat);
00126 
00127   void GetIJKToRASDirectionMatrix(vtkMatrix4x4* mat);
00128   void SetIJKToRASDirectionMatrix(vtkMatrix4x4* mat);
00129 
00133   void SetIJKToRASMatrix(vtkMatrix4x4* mat);
00134   void SetRASToIJKMatrix(vtkMatrix4x4* mat);
00135 
00138   virtual vtkMRMLVolumeDisplayNode* GetVolumeDisplayNode()
00139   {
00140     return vtkMRMLVolumeDisplayNode::SafeDownCast(this->GetDisplayNode());
00141   }
00142 
00145   vtkGetObjectMacro(ImageData, vtkImageData);
00146   void SetAndObserveImageData(vtkImageData *ImageData);
00147 
00150   virtual void ProcessMRMLEvents ( vtkObject * /*caller*/, 
00151                                    unsigned long /*event*/, 
00152                                    void * /*callData*/ );
00153 
00154 //BTX
00158   enum
00159     {
00160       ImageDataModifiedEvent = 18001
00161     };
00162 //ETX
00163 
00164 //BTX
00167   void SetMetaDataDictionary( const itk::MetaDataDictionary& );
00168   const itk::MetaDataDictionary& GetMetaDataDictionary() const;
00169 //ETX
00170 
00171   virtual bool CanApplyNonLinearTransforms() { return false; }
00172   virtual void ApplyTransform(vtkMatrix4x4* transformMatrix);
00173   virtual void ApplyTransform(vtkAbstractTransform* transform);
00174 
00178   virtual void UpdateFromMRML();
00179   
00182   virtual vtkMRMLStorageNode* CreateDefaultStorageNode()
00183     {
00184     return Superclass::CreateDefaultStorageNode();
00185     };
00186 
00187 
00188 protected:
00189   vtkMRMLVolumeNode();
00190   ~vtkMRMLVolumeNode();
00191   vtkMRMLVolumeNode(const vtkMRMLVolumeNode&);
00192   void operator=(const vtkMRMLVolumeNode&);
00193 
00194   vtkSetObjectMacro(ImageData, vtkImageData);
00195 
00197   double IJKToRASDirections[3][3];
00198 
00200   double Spacing[3];
00201   double Origin[3];
00202 
00203   vtkImageData               *ImageData;
00204 
00205 //BTX
00206   itk::MetaDataDictionary Dictionary;
00207 //ETX  
00208 };
00209 
00210 #endif
00211 
00212 
00213  
00214 

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1