2 #include "vtkImageViewer2_XYZ.h"
5 //-------------------------------------------------------------------
6 //-------------------------------------------------------------------
7 //-------------------------------------------------------------------
8 vtkImageViewer2_XYZ::vtkImageViewer2_XYZ()
10 _vtkimageviewer2= vtkImageViewer2::New();
12 //-------------------------------------------------------------------
13 vtkImageViewer2_XYZ::~vtkImageViewer2_XYZ()
15 _vtkimageviewer2->Delete();
17 //-------------------------------------------------------------------
18 void vtkImageViewer2_XYZ::SetExtentDimension(int x1,int x2,
29 //-------------------------------------------------------------------
30 void vtkImageViewer2_XYZ::SetXSlice(int slice)
32 vtkImageActor *imageActor = _vtkimageviewer2->GetImageActor();
33 imageActor->SetDisplayExtent(slice, slice, _y1, _y2, _z1, _z2 );
35 //-------------------------------------------------------------------
36 void vtkImageViewer2_XYZ::SetYSlice(int slice)
38 vtkImageActor *imageActor = _vtkimageviewer2->GetImageActor();
39 imageActor->SetDisplayExtent(_x1, _x2, slice, slice, _z1, _z2 );
41 //-------------------------------------------------------------------
42 void vtkImageViewer2_XYZ::SetZSlice(int slice)
44 #if (VTK_MAJOR_VERSION >= 5)
45 // _vtkimageviewer2->SetSlice( slice );
46 vtkImageActor *imageActor = _vtkimageviewer2->GetImageActor();
47 imageActor->SetDisplayExtent(_x1, _x2, _y1, _y2, slice, slice );
49 _vtkimageviewer2->SetZSlice( slice );
54 //-------------------------------------------------------------------
55 int vtkImageViewer2_XYZ::GetXSlice()
57 vtkImageActor *imageActor = _vtkimageviewer2->GetImageActor();
58 return imageActor->GetDisplayExtent()[0];
60 //-------------------------------------------------------------------
61 int vtkImageViewer2_XYZ::GetYSlice()
63 vtkImageActor *imageActor = _vtkimageviewer2->GetImageActor();
64 return imageActor->GetDisplayExtent()[2];
66 //-------------------------------------------------------------------
67 int vtkImageViewer2_XYZ::GetZSlice()
71 #if (VTK_MAJOR_VERSION >= 5)
72 result= _vtkimageviewer2->GetSlice( );
74 result= _vtkimageviewer2->GetZSlice( );
80 //-------------------------------------------------------------------
81 vtkImageViewer2 *vtkImageViewer2_XYZ::GetVtkImageViewer2()
83 return _vtkimageviewer2;
87 //-------------------------------------------------------------------
88 //-------------------------------------------------------------------
89 //-------------------------------------------------------------------