# Get the volume associated with an vtkimageactor

**URL:** https://discourse.vtk.org/t/get-the-volume-associated-with-an-vtkimageactor/301
**Category:** Support
**Created:** [February 20, 2019, 2:05pm UTC](https://discourse.vtk.org/t/get-the-volume-associated-with-an-vtkimageactor/301 "2019-02-20T14:05:24Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![swetha](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/ebca7d/32.png) [@swetha](https://discourse.vtk.org/u/swetha)
#### Post date: [February 20, 2019, 2:05pm UTC](https://discourse.vtk.org/t/get-the-volume-associated-with-an-vtkimageactor/301/1 "2019-02-20T14:05:24Z")

</div>

Hi All,

I am displaying thumbnail of all the ultrasound volumes captured and when the user selects the thumbnail it opens in another window , it is supposed to render in axial,saggital ,coronal view. How I do it is i find the renderer which is poked and pass the actor associated with the renderer. The following is the code which renders in all 3 orientation.

```
   vtkSmartPointer<vtkMatrix4x4> axialresliceAxes =vtkSmartPointer<vtkMatrix4x4>::New();
   axialresliceAxes->DeepCopy(axialElements);
   axialresliceAxes->SetElement(0, 3, center[0]);
   axialresliceAxes->SetElement(1, 3, center[1]);
   axialresliceAxes->SetElement(2, 3, center[2]);
   vtkSmartPointer<vtkPropCollection>propcollection = vtkSmartPointer<vtkPropCollection>::New();
  
   resliceImage->SetResliceAxes(axialresliceAxes);
   resliceImage->SetInputConnection(pokedActor->GetMapper()->GetOutputPort());
   //pokedActor->GetMapper()->GetInputDataObject(pokedActor->GetMapper()->GetOutputPortInformation()->,)
   //vtkSmartPointer<vtkImageData>imgData = pokedActor->g
   resliceImage->SetInputData(pokedActor->GetInput());
   //resliceImage->SetInputData(pokedActor->GetMapper()->getin);
   resliceImage->SetInterpolationModeToLinear();
   
   vtkSmartPointer<vtkImageActor> axialActor = vtkSmartPointer<vtkImageActor>::New();
   //axialActor = pokedActor;
   axialActor->GetMapper()->AddInputConnection(resliceImage->GetOutputPort());
   //axialActor->SetOrientation(coronalElements);
   axialRenderer->SetBackground(0.0, 0.0, 0.0);
   int i = 0;
   axialRenderer->SetViewport(0.5*(i & 1), 0.25*(i & 2),
          0.5 + 0.5*(i & 1), 0.5 + 0.25*(i & 2));
   axialRenderer->AddActor(axialActor);
   axialRenderer->ResetCamera();

```

I do not get the volume which I selected the pokedActor-\>GetInput() has empty image data. How do you get volume data in the vtkImageActor.  
-swetha
