VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkImageViewer2.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00060 #ifndef __vtkImageViewer2_h 00061 #define __vtkImageViewer2_h 00062 00063 #include "vtkInteractionImageModule.h" // For export macro 00064 #include "vtkObject.h" 00065 00066 class vtkAlgorithm; 00067 class vtkAlgorithmOutput; 00068 class vtkImageActor; 00069 class vtkImageData; 00070 class vtkImageMapToWindowLevelColors; 00071 class vtkInformation; 00072 class vtkInteractorStyleImage; 00073 class vtkRenderWindow; 00074 class vtkRenderer; 00075 class vtkRenderWindowInteractor; 00076 00077 class VTKINTERACTIONIMAGE_EXPORT vtkImageViewer2 : public vtkObject 00078 { 00079 public: 00080 static vtkImageViewer2 *New(); 00081 vtkTypeMacro(vtkImageViewer2,vtkObject); 00082 void PrintSelf(ostream& os, vtkIndent indent); 00083 00085 virtual const char *GetWindowName(); 00086 00088 virtual void Render(void); 00089 00091 00092 virtual void SetInputData(vtkImageData *in); 00093 virtual vtkImageData *GetInput(); 00094 virtual void SetInputConnection(vtkAlgorithmOutput* input); 00096 00098 00099 enum 00100 { 00101 SLICE_ORIENTATION_YZ = 0, 00102 SLICE_ORIENTATION_XZ = 1, 00103 SLICE_ORIENTATION_XY = 2 00104 }; 00105 //ETX 00106 vtkGetMacro(SliceOrientation, int); 00107 virtual void SetSliceOrientation(int orientation); 00108 virtual void SetSliceOrientationToXY() 00109 { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XY); }; 00110 virtual void SetSliceOrientationToYZ() 00111 { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_YZ); }; 00112 virtual void SetSliceOrientationToXZ() 00113 { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XZ); }; 00115 00117 00119 vtkGetMacro(Slice, int); 00120 virtual void SetSlice(int s); 00122 00132 virtual void UpdateDisplayExtent(); 00133 00135 00137 virtual int GetSliceMin(); 00138 virtual int GetSliceMax(); 00139 virtual void GetSliceRange(int range[2]) 00140 { this->GetSliceRange(range[0], range[1]); } 00141 virtual void GetSliceRange(int &min, int &max); 00142 virtual int* GetSliceRange(); 00144 00146 00147 virtual double GetColorWindow(); 00148 virtual double GetColorLevel(); 00149 virtual void SetColorWindow(double s); 00150 virtual void SetColorLevel(double s); 00152 00154 00155 virtual void SetDisplayId(void *a); 00156 virtual void SetWindowId(void *a); 00157 virtual void SetParentId(void *a); 00159 00161 00162 virtual int* GetPosition(); 00163 virtual void SetPosition(int a,int b); 00164 virtual void SetPosition(int a[2]) { this->SetPosition(a[0],a[1]); } 00166 00168 00169 virtual int* GetSize(); 00170 virtual void SetSize(int a, int b); 00171 virtual void SetSize(int a[2]) { this->SetSize(a[0],a[1]); } 00173 00175 00177 vtkGetObjectMacro(RenderWindow,vtkRenderWindow); 00178 vtkGetObjectMacro(Renderer, vtkRenderer); 00179 vtkGetObjectMacro(ImageActor,vtkImageActor); 00180 vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors); 00181 vtkGetObjectMacro(InteractorStyle,vtkInteractorStyleImage); 00183 00185 00186 virtual void SetRenderWindow(vtkRenderWindow *arg); 00187 virtual void SetRenderer(vtkRenderer *arg); 00189 00191 virtual void SetupInteractor(vtkRenderWindowInteractor*); 00192 00194 00197 virtual void SetOffScreenRendering(int); 00198 virtual int GetOffScreenRendering(); 00199 vtkBooleanMacro(OffScreenRendering,int); 00201 00202 protected: 00203 vtkImageViewer2(); 00204 ~vtkImageViewer2(); 00205 00206 virtual void InstallPipeline(); 00207 virtual void UnInstallPipeline(); 00208 00209 vtkImageMapToWindowLevelColors *WindowLevel; 00210 vtkRenderWindow *RenderWindow; 00211 vtkRenderer *Renderer; 00212 vtkImageActor *ImageActor; 00213 vtkRenderWindowInteractor *Interactor; 00214 vtkInteractorStyleImage *InteractorStyle; 00215 00216 int SliceOrientation; 00217 int FirstRender; 00218 int Slice; 00219 00220 virtual void UpdateOrientation(); 00221 00222 vtkAlgorithm* GetInputAlgorithm(); 00223 vtkInformation* GetInputInformation(); 00224 00225 friend class vtkImageViewer2Callback; 00226 00227 private: 00228 vtkImageViewer2(const vtkImageViewer2&); // Not implemented. 00229 void operator=(const vtkImageViewer2&); // Not implemented. 00230 }; 00231 00232 #endif