00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00059 #ifndef __vtkImageViewer2_h
00060 #define __vtkImageViewer2_h
00061
00062 #include "vtkObject.h"
00063
00064 class vtkAlgorithmOutput;
00065 class vtkImageActor;
00066 class vtkImageData;
00067 class vtkImageMapToWindowLevelColors;
00068 class vtkInteractorStyleImage;
00069 class vtkRenderWindow;
00070 class vtkRenderer;
00071 class vtkRenderWindowInteractor;
00072
00073 class VTK_RENDERING_EXPORT vtkImageViewer2 : public vtkObject
00074 {
00075 public:
00076 static vtkImageViewer2 *New();
00077 vtkTypeRevisionMacro(vtkImageViewer2,vtkObject);
00078 void PrintSelf(ostream& os, vtkIndent indent);
00079
00081 virtual const char *GetWindowName();
00082
00084 virtual void Render(void);
00085
00087
00088 virtual void SetInput(vtkImageData *in);
00089 virtual vtkImageData *GetInput();
00090 virtual void SetInputConnection(vtkAlgorithmOutput* input);
00092
00094
00095 enum
00096 {
00097 SLICE_ORIENTATION_YZ = 0,
00098 SLICE_ORIENTATION_XZ = 1,
00099 SLICE_ORIENTATION_XY = 2
00100 };
00101
00102 vtkGetMacro(SliceOrientation, int);
00103 virtual void SetSliceOrientation(int orientation);
00104 virtual void SetSliceOrientationToXY()
00105 { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XY); };
00106 virtual void SetSliceOrientationToYZ()
00107 { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_YZ); };
00108 virtual void SetSliceOrientationToXZ()
00109 { this->SetSliceOrientation(vtkImageViewer2::SLICE_ORIENTATION_XZ); };
00111
00113
00115 vtkGetMacro(Slice, int);
00116 virtual void SetSlice(int s);
00118
00128 virtual void UpdateDisplayExtent();
00129
00131
00133 virtual int GetSliceMin();
00134 virtual int GetSliceMax();
00135 virtual void GetSliceRange(int range[2])
00136 { this->GetSliceRange(range[0], range[1]); }
00137 virtual void GetSliceRange(int &min, int &max);
00138 virtual int* GetSliceRange();
00140
00142
00143 virtual double GetColorWindow();
00144 virtual double GetColorLevel();
00145 virtual void SetColorWindow(double s);
00146 virtual void SetColorLevel(double s);
00148
00150
00151 virtual void SetDisplayId(void *a);
00152 virtual void SetWindowId(void *a);
00153 virtual void SetParentId(void *a);
00155
00157
00158 virtual int* GetPosition();
00159 virtual void SetPosition(int a,int b);
00160 virtual void SetPosition(int a[2]) { this->SetPosition(a[0],a[1]); }
00162
00164
00165 virtual int* GetSize();
00166 virtual void SetSize(int a, int b);
00167 virtual void SetSize(int a[2]) { this->SetSize(a[0],a[1]); }
00169
00171
00173 vtkGetObjectMacro(RenderWindow,vtkRenderWindow);
00174 vtkGetObjectMacro(Renderer, vtkRenderer);
00175 vtkGetObjectMacro(ImageActor,vtkImageActor);
00176 vtkGetObjectMacro(WindowLevel,vtkImageMapToWindowLevelColors);
00177 vtkGetObjectMacro(InteractorStyle,vtkInteractorStyleImage);
00179
00181
00182 virtual void SetRenderWindow(vtkRenderWindow *arg);
00183 virtual void SetRenderer(vtkRenderer *arg);
00185
00187 virtual void SetupInteractor(vtkRenderWindowInteractor*);
00188
00190
00193 virtual void SetOffScreenRendering(int);
00194 virtual int GetOffScreenRendering();
00195 vtkBooleanMacro(OffScreenRendering,int);
00197
00199 VTK_LEGACY(int GetWholeZMin());
00200
00202 VTK_LEGACY(int GetWholeZMax());
00203
00205 VTK_LEGACY(int GetZSlice());
00206
00208 VTK_LEGACY(void SetZSlice(int));
00209
00210 protected:
00211 vtkImageViewer2();
00212 ~vtkImageViewer2();
00213
00214 virtual void InstallPipeline();
00215 virtual void UnInstallPipeline();
00216
00217 vtkImageMapToWindowLevelColors *WindowLevel;
00218 vtkRenderWindow *RenderWindow;
00219 vtkRenderer *Renderer;
00220 vtkImageActor *ImageActor;
00221 vtkRenderWindowInteractor *Interactor;
00222 vtkInteractorStyleImage *InteractorStyle;
00223
00224 int SliceOrientation;
00225 int FirstRender;
00226 int Slice;
00227
00228 virtual void UpdateOrientation();
00229
00230 private:
00231 vtkImageViewer2(const vtkImageViewer2&);
00232 void operator=(const vtkImageViewer2&);
00233 };
00234
00235 #endif
00236
00237