Sign2DViewer.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * Program:   Slicer Image-Guided Navigator (The SIGN)
00004  * Module:    $RCSfile: Sign2DViewer.h,v $
00005  */
00017 #ifndef _SIGN2DVIEWER_H
00018 #define _SIGN2DVIEWER_H
00019 
00020 #include <vector>
00021 #include <string>
00022 
00023 #include <SignViewer.h>
00024 #include <SignDLL.h>
00025 
00026 class SignImageViewer;
00027 class vtkRenderWindow;
00028 class vtkImageData;
00029 class vtkImageReslice;
00030 class vtkMatrix4x4;
00031 class vtkRenderer;
00032 class vtkCallbackCommand;
00033 class vtkTextMapper;
00034 class vtkMatrix4x4;
00035 class vtkKWRenderWidget;
00036 class vtkKWScale;
00037 class vtkTransform;
00038 class SignImageReslice;
00039 class vtkKWMenuButton;
00040 class vtkImageImport;
00041 class vtk2DSymbol;
00042 class vtkCrossHair;
00043 class SignContext;
00044 class vtkMRMLVolumeNode;
00045 class vtkActor2D;
00046 class SignOTSink;
00047 
00048 typedef std::vector<SignImageReslice*> SignSlicers;
00049 
00050 
00051 class SIGN_EXPORT Sign2DViewer : public SignViewer
00052 {
00053  public:
00054   vtkTypeRevisionMacro(Sign2DViewer,SignViewer);
00055   virtual void PrintSelf(ostream& os, vtkIndent indent);
00056 
00057   static Sign2DViewer *New();
00058 
00061   void SetImageData(vtkImageData *im);
00062 
00065   void SetImageData(SignSlicers *slicers);
00066 
00068   vtkImageData* GetImageData();
00069 
00071   void SetVolumeNode(vtkMRMLVolumeNode *node);
00072 
00074   vtkMRMLVolumeNode* GetVolumeNode();
00075 
00078   void SetupRenderWindow(std::string view);
00079 
00081   void SetupScrollbar(vtkKWScale *scrollbar);
00082 
00086   void SetWindowLevel(double w, double l);
00087 
00091   void SetSlice(int s,bool updateScrollbar=false);
00092 
00094   static void SetLocator(vtkObject* caller,unsigned long,void* data,void*calldata);
00095   static void SetPlane(vtkObject* caller,unsigned long,void* data,void*calldata);
00096   //  void SetLocator(vtkMatrix4x4 *matrix);
00097 
00099   void Cycle();
00100 
00104   vtkCrossHair* Add2DMarkerInViewer(float *coord, double *color);
00105 
00107   SignImageViewer *GetImageViewer();
00108 
00110   const vtkMatrix4x4* GetImageMatrix();
00111 
00113   void SetImageMatrix(vtkMatrix4x4 *matrix);
00114   void SetImageMatrix(vtkTransform *trans);
00115 
00117   int GetSlice()
00118   { return slice;}
00119 
00121   void SetDrivenByLocator(bool drivenByLocator_)
00122   { drivenByLocator=drivenByLocator_;}
00123 
00125   bool GetDrivenByLocator()
00126   { return drivenByLocator;}
00127 
00129   void SetOrientationSelectorVisible(bool _orientationSelectorVisible)
00130   { orientationSelectorVisible=_orientationSelectorVisible;}
00131 
00133         void SetScrollbarVisible(bool _scrollbarVisible)
00134   { scrollbarVisible=_scrollbarVisible;}
00135 
00137   void Image2World(double imagePos[3], double worldPos[3]);
00138 
00140   void World2Image(double worldPos[3], double imagePos[3]);
00141 
00143         void GetPos(int pos[2]);
00144 
00146   void SetSelectorPlane(char* plane);
00147 
00149   std::string GetPlane();
00150 
00152   void SetTrackerActorToArrow();
00153 
00155   void SetTrackerActorToCrossHair();
00156 
00158   void SetActorPosition(SignOTSink *sink);
00159 
00161         vtkSetMacro(TrackerActorLength, double)
00163   vtkGetMacro(TrackerActorLength, double)
00164   void ResetTimePoint();
00165  protected:
00166   Sign2DViewer();
00167   ~Sign2DViewer();
00168   virtual void CreateWidget();
00169 
00170 
00171  private:
00172   static void scrollbarCallback(vtkObject *caller,unsigned long, void* data,void*);
00173 
00174   static void OnRightButtonRelease(vtkObject *caller,unsigned long, void* data,void*);
00175   static void OnRenderWindowModified(vtkObject *caller,unsigned long, void* data,void*);
00176 
00177   void UpdateAnnotationActors();
00178 
00179   vtkMRMLVolumeNode *VolumeNode;
00180   SignImageViewer *imageViewer;
00181   vtkImageData *imageData;
00182   vtkImageImport *dummyData;
00183   vtkMatrix4x4 *imageMatrix;
00184   vtkTransform *imageTransform;
00185   bool drivenByLocator;
00186 
00187   int timepoint;
00188 
00189   SignSlicers *SlicerCollection;
00190 
00191   int NumbersInCycle;
00192   int curr_visible;
00193 
00194   vtk2DSymbol *trackerCrossHair;
00195 
00196   vtkKWScale *zScrollbar;
00197 
00198   std::string viewname;
00199 
00200   int middleButtonClickPos[2];
00201   vtkCallbackCommand *lccallback;
00202 
00203   bool orientationSelectorVisible;
00204   bool scrollbarVisible;
00205 
00206   vtkActor2D *actor1,*actor2,*actor3,*actor4;
00207   vtkTextMapper *text1,*text2,*text3,*text4;
00208 
00210   int slice;
00211   vtkKWMenuButton *menubutton;
00212   vtkKWFrame *frame;
00213 
00214   double TrackerActorLength;
00215 
00216   Sign2DViewer(const Sign2DViewer&);  // Not implemented.
00217   void operator=(const Sign2DViewer&);  // Not implemented.
00218 
00219 };
00220 
00221 #endif

Generated on Mon Feb 26 12:11:16 2007 for TheSIGN by  doxygen 1.4.6