# vtkResliceImageViewer

**URL:** https://discourse.vtk.org/t/vtkresliceimageviewer/1233
**Category:** Support
**Created:** [June 28, 2019, 8:36am UTC](https://discourse.vtk.org/t/vtkresliceimageviewer/1233 "2019-06-28T08:36:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Marco\_Festugato](https://discourse.vtk.org/user_avatar/discourse.vtk.org/marco_festugato/32/327_2.png) [@Marco\_Festugato](https://discourse.vtk.org/u/Marco_Festugato)
#### Post date: [June 28, 2019, 8:36am UTC](https://discourse.vtk.org/t/vtkresliceimageviewer/1233/1 "2019-06-28T08:36:07Z")

</div>

Hello, I want to perform MPR on my 3D volume and display the 3 planes (axial, coronal and sagittal) in one render window. Problem is that, if I want to change the cursor (and update the other 2 views) in the upper plane I can’t because the mouse takes the red line of the lower plane, so that I have to rotate this line (figure 2) if I want to move the cursor of the upper plane.

 ![1](https://discourse.vtk.org/uploads/default/original/1X/e5ef26403c517041ab801d20e6621af6554dcc48.jpeg)

 ![2](https://discourse.vtk.org/uploads/default/original/1X/109a335631236209b0000a1bae2c705e11dc6745.jpeg)

Now I can move the cursor of the upper plane

 ![3](https://discourse.vtk.org/uploads/default/original/1X/b4457561934ec8620dadb4b782b233f394bb4653.jpeg)

How can I do so that the red line of the lower plane ‘exists’ only in the lower viewport?  
This is the part of the code I think I need to fix:

```
  vtkSmartPointer< vtkResliceImageViewer > viewer = vtkSmartPointer< vtkResliceImageViewer >::New();
  vtkSmartPointer< vtkRenderWindowInteractor > interactor = vtkSmartPointer< vtkRenderWindowInteractor >::New();

  interactor -> SetRenderWindow( viewer -> GetRenderWindow() );
  viewer -> SetupInteractor( interactor );
  
  viewer -> SetInputData( reader -> GetOutput() ); // pipeline

  viewer -> SetResliceMode( 1 ); 
  
  viewer -> GetRenderer() -> SetViewport( xmins[0], ymins[0], xmaxs[0], ymaxs[0] ); 

  vtkSmartPointer< vtkResliceImageViewer > viewer2 = vtkSmartPointer< vtkResliceImageViewer >::New();

  viewer2 -> SetRenderWindow( viewer -> GetRenderWindow() );
  viewer2 -> SetupInteractor( interactor );
  
  viewer2 -> GetRenderer() -> SetViewport( xmins[1], ymins[1], xmaxs[1], ymaxs[1] ); // questo viewer verrà visualizzato in alto a sx

  viewer2 -> SetInputData( reader -> GetOutput() );

  viewer2 -> SetResliceMode( 1 );

  // make them all share the same reslice cursor object.
  vtkResliceCursorLineRepresentation *rep = vtkResliceCursorLineRepresentation::SafeDownCast( viewer -> GetResliceCursorWidget() -> GetRepresentation() );
  viewer -> SetResliceCursor( viewer -> GetResliceCursor() );
 
  rep -> GetResliceCursorActor() -> GetCursorAlgorithm() -> SetReslicePlaneNormal( 2 );
 
  viewer -> SetSliceOrientation( 2 );
  
  vtkResliceCursorLineRepresentation *rep2 = vtkResliceCursorLineRepresentation::SafeDownCast( viewer2 -> GetResliceCursorWidget() -> GetRepresentation());
  viewer2 -> SetResliceCursor( viewer -> GetResliceCursor() );
 
  rep2 -> GetResliceCursorActor() -> GetCursorAlgorithm() -> SetReslicePlaneNormal( 1 );
 
  viewer2 -> SetSliceOrientation( 1 );

```

Thanks in advance for any help!!
