Imageorientation problem-medical images

Hi,

I want to display the volume read in axial,sagital and coronal views. I tried using the vtkInteractorstyleImage setorientation method. It displays the volume in the axial orientation but empty viewport in the other two direction. The input given to the vtkImageactor is a vtkImagereslice with its orientation set to axial direction. Could this be the reason?
The following is the code where the style is set
actor2->GetMapper()->SetInputConnection(color->GetOutputPort());

              renderer2->SetBackground(0, 0, 0);
              renderer2->SetViewport(0.5*(i & 1), 0.25*(i & 2),
                     0.5 + 0.5*(i & 1), 0.5 + 0.25*(i & 2));
              renderer2->AddActor(actor2);
       
                  renderer2->ResetCamera();
                  vtkSmartPointer<vtkInteractorStyleImage> imstyle = 
                 vtkSmartPointer<vtkInteractorStyleImage>::New();
              
              double vector1[3] = { 1.0, 0.0 ,0.0 };
              double vector2[3] = { 0.0,0.0,1.0 };
              imstyle->SetCurrentRenderer(renderer2);
              imstyle->SetImageOrientation(vector1, vector2);
               renderer2->ResetCamera();
              interactor->SetInteractorStyle( imstyle )

the sagital and coronal views are gettings rendered out of viewport I guess,How do I bring it in the viewport?

Hi,

Setting the image orientation on the interactor style would just change the camera position. You would have to set up vtkImageReslice to slice along the direction you want.

For an example, see https://vtk.org/gitweb?p=VTK.git;a=blob;f=Examples/ImageProcessing/Cxx/ImageSlicing.cxx

Best,
Sankhesh

Hi, I have the same problem here. I have to display in a window the axial, sagittal and coronal plane of a volume i read…do u have any suggestions/code/classes that i could use?
I also have to be able to ‘scroll’ up/down throgh the volume with my planes.
Thanks in advance,
Marco

Take a look at vtkImageResliceMapper