vtkMRMLSliceNode.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: vtkMRMLSliceNode.h,v $
00010   Date:      $Date: 2006/03/19 17:12:29 $
00011   Version:   $Revision: 1.3 $
00012 
00013 =========================================================================auto=*/
00020 //
00021 
00022 #ifndef __vtkMRMLSliceNode_h
00023 #define __vtkMRMLSliceNode_h
00024 
00025 #include "vtkMRML.h"
00026 #include "vtkMRMLNode.h"
00027 
00028 #include "vtkMatrix4x4.h"
00029 class vtkMRMLVolumeNode;
00030 
00031 class VTK_MRML_EXPORT vtkMRMLSliceNode : public vtkMRMLNode
00032 {
00033   public:
00034   static vtkMRMLSliceNode *New();
00035   vtkTypeMacro(vtkMRMLSliceNode,vtkMRMLNode);
00036   void PrintSelf(ostream& os, vtkIndent indent);
00037 
00038   virtual vtkMRMLNode* CreateNodeInstance();
00039 
00042   virtual void ReadXMLAttributes( const char** atts);
00043 
00046   virtual void WriteXML(ostream& of, int indent);
00047 
00050   virtual void Copy(vtkMRMLNode *node);
00051 
00056   virtual void UpdateScene(vtkMRMLScene *);
00057 
00060   virtual const char* GetNodeTagName() {return "Slice";};
00061 
00065   vtkGetObjectMacro (SliceToRAS, vtkMatrix4x4);
00066   vtkSetObjectMacro (SliceToRAS, vtkMatrix4x4);
00067 
00070   vtkGetMacro ( SliceVisible, int );
00071   vtkSetMacro ( SliceVisible, int );
00072 
00075   vtkGetMacro ( WidgetVisible, int );
00076   vtkSetMacro ( WidgetVisible, int );
00077 
00080   vtkGetMacro ( UseLabelOutline, int );
00081   vtkSetMacro ( UseLabelOutline, int );
00082   vtkBooleanMacro ( UseLabelOutline, int );
00083   
00088   void SetOrientationToAxial();
00089   void SetOrientationToSagittal();
00090   void SetOrientationToCoronal();
00091 
00094   void SetOrientationToReformat();
00095   
00098   vtkGetStringMacro (OrientationString);
00099   vtkSetStringMacro (OrientationString);
00100 
00104   vtkGetStringMacro (OrientationIntentString);
00105   vtkSetStringMacro (OrientationIntentString);
00106 
00109   vtkGetVector3Macro (FieldOfView, double);
00110   void SetFieldOfView (double x, double y, double z);
00111 
00115   vtkGetVector3Macro (Dimensions, unsigned int);
00116   void SetDimensions (unsigned int x, unsigned int y, unsigned int z);
00117 
00121   vtkGetObjectMacro (XYToSlice, vtkMatrix4x4);
00122 
00126   vtkGetObjectMacro (XYToRAS, vtkMatrix4x4);
00127 
00131   int Matrix4x4AreEqual(vtkMatrix4x4 *m1, vtkMatrix4x4 *m2);
00132 
00136   void UpdateMatrices();
00137 
00140   void SetLayoutName(const char *layoutName) {
00141     this->SetSingletonTag(layoutName);
00142   }
00143   char *GetLayoutName() {
00144     return this->GetSingletonTag();
00145   }
00146 
00150   void SetLayoutGrid( int rows, int columns );
00151 
00154   vtkGetMacro (LayoutGridRows, int);
00155   virtual void SetLayoutGridRows(int rows);
00156   
00159   vtkGetMacro (LayoutGridColumns, int);
00160   virtual void SetLayoutGridColumns(int cols);
00161   
00168   void SetSliceToRASByNTP (double Nx, double Ny, double Nz,
00169                            double Tx, double Ty, double Tz,
00170                            double Px, double Py, double Pz,
00171                            int Orientation);
00172 
00176   void JumpSlice(double r, double a, double s);
00177   void JumpAllSlices(double r, double a, double s);
00178   void JumpSliceByOffsetting(double r, double a, double s);
00179   void JumpSliceByOffsetting(int k, double r, double a, double s);
00180   void JumpSliceByCentering(double r, double a, double s);
00181 
00184   //BTX
00185   enum {CenteredJumpSlice=0, OffsetJumpSlice};
00186   //ETX
00187 
00193   vtkSetMacro(JumpMode, int);
00194   vtkGetMacro(JumpMode, int);
00195   void SetJumpModeToCentered();
00196   void SetJumpModeToOffset();
00197   
00201   //BTX
00202   enum {AutomaticSliceSpacingMode=0, PrescribedSliceSpacingMode};
00203   //ETX
00204   
00208   vtkGetMacro(SliceSpacingMode, int);
00209   vtkSetMacro(SliceSpacingMode, int);
00210   void SetSliceSpacingModeToAutomatic();
00211   void SetSliceSpacingModeToPrescribed();
00212 
00216   vtkSetVector3Macro(PrescribedSliceSpacing, double);
00217   vtkGetVector3Macro(PrescribedSliceSpacing, double);
00218 
00222   vtkSetMacro(ActiveSlice, int);
00223   vtkGetMacro(ActiveSlice, int);
00224 
00230   void RotateToVolumePlane(vtkMRMLVolumeNode *volumeNode);
00231   
00232 protected:
00233 
00234 
00235   vtkMRMLSliceNode();
00236   ~vtkMRMLSliceNode();
00237   vtkMRMLSliceNode(const vtkMRMLSliceNode&);
00238   void operator=(const vtkMRMLSliceNode&);
00239 
00240 
00241   vtkMatrix4x4 *SliceToRAS;
00242   vtkMatrix4x4 *XYToSlice;
00243   vtkMatrix4x4 *XYToRAS;
00244 
00245   int JumpMode;
00246   
00247   int SliceVisible;
00248   int WidgetVisible;
00249   int UseLabelOutline;
00250   double FieldOfView[3];
00251   unsigned int Dimensions[3];
00252   char *OrientationString;
00253   char *OrientationIntentString;
00254 
00255   int LayoutGridRows;
00256   int LayoutGridColumns;
00257 
00258   int SliceSpacingMode;
00259   double PrescribedSliceSpacing[3];
00260 
00261   int ActiveSlice;
00262 };
00263 
00264 #endif
00265 

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1