# Four dipsplay Window

**URL:** https://discourse.vtk.org/t/four-dipsplay-window/414
**Category:** Support
**Created:** [March 6, 2019, 7:05am UTC](https://discourse.vtk.org/t/four-dipsplay-window/414 "2019-03-06T07:05:54Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![dp1991](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b782af/32.png) [@dp1991](https://discourse.vtk.org/u/dp1991)
#### Post date: [March 6, 2019, 7:05am UTC](https://discourse.vtk.org/t/four-dipsplay-window/414/1 "2019-03-06T07:05:55Z")

</div>

Hi  
i need to display my image into 4 window  
1 axial 2- sagittal 3- coronal 4- 3D view  
like 3dslicer default  
how to do it ??

---

<div class="post-metadata">

### Author: ![Harry](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/h/f6c823/32.png) [@Harry](https://discourse.vtk.org/u/Harry)
#### Post date: [March 6, 2019, 3:11pm UTC](https://discourse.vtk.org/t/four-dipsplay-window/414/2 "2019-03-06T15:11:26Z")

</div>

This is a big question, but in general my strategy is to create a vtkImageActor from my vtkImageData, and then for each plane use SetDisplayExtent() to display the appropriate portion of the image actor.

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [March 7, 2019, 7:55am UTC](https://discourse.vtk.org/t/four-dipsplay-window/414/3 "2019-03-07T07:55:05Z")

</div>

There may be examples in the VTK Examples that you can look at. A quick look shows that this may be useful: [https://lorensen.github.io/VTKExamples/site/Cxx/Meshes/Decimation/](https://lorensen.github.io/VTKExamples/site/Cxx/Meshes/Decimation/) Here the same source uses different actors in different windows. Additionally, the actors can be oriented differently in each window.

---

<div class="post-metadata">

### Author: ![dp1991](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/d/b782af/32.png) [@dp1991](https://discourse.vtk.org/u/dp1991)
#### Post date: [March 7, 2019, 1:05pm UTC](https://discourse.vtk.org/t/four-dipsplay-window/414/4 "2019-03-07T13:05:29Z")

</div>

thanks, i solved it…

---

<div class="post-metadata">

### Author: ![banesullivan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/banesullivan/32/7143_2.png) [@banesullivan](https://discourse.vtk.org/u/banesullivan)
#### Post date: [March 8, 2019, 6:31am UTC](https://discourse.vtk.org/t/four-dipsplay-window/414/5 "2019-03-08T06:31:36Z")

</div>

_Just an FYI:_ I’ve been working on something lately to do exactly this in Python: [https://github.com/vtkiorg/vtki/issues/111](https://github.com/vtkiorg/vtki/issues/111)

---

<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: [March 15, 2019, 6:54pm UTC](https://discourse.vtk.org/t/four-dipsplay-window/414/6 "2019-03-15T18:54:59Z")

</div>

Hi davood 🙂 i have to do the same thing…i have a volume that i have to display in a window: 1/4 for the 3D volume, 1/4 for the axial plane, 1/4 for the sagittal plane and 1/4 for the coronal plane. Could u explain me how u manage to do it? I also have to ‘scroll’ up/down mi planes through the volume…  
Thanks in advance,  
Marco

---

<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: [April 19, 2019, 9:49am UTC](https://discourse.vtk.org/t/four-dipsplay-window/414/7 "2019-04-19T09:49:40Z")

</div>

@dp1991 could u help me? i have your same problem…

---

<div class="post-metadata">

### Author: ![amaclean](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amaclean/32/224_2.png) [@amaclean](https://discourse.vtk.org/u/amaclean)
#### Post date: [April 19, 2019, 12:29pm UTC](https://discourse.vtk.org/t/four-dipsplay-window/414/8 "2019-04-19T12:29:10Z")

</div>

These examples may help:  
[https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/SideBySideViewports/](https://lorensen.github.io/VTKExamples/site/Cxx/Visualization/SideBySideViewports/)  
Or a more complex example using vectors (C++) or lists (Python) using multiple windows:  
[https://lorensen.github.io/VTKExamples/site/Cxx/GeometricObjects/ParametricObjectsDemo/](https://lorensen.github.io/VTKExamples/site/Cxx/GeometricObjects/ParametricObjectsDemo/)

---

<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: [April 19, 2019, 1:48pm UTC](https://discourse.vtk.org/t/four-dipsplay-window/414/9 "2019-04-19T13:48:30Z")

</div>

Hi @amaclean and thank u for your quick answer! I know how to ‘split’ a render window, but how can i do MPR? I think i should use vtkResliceImageViewer but how?

Thanks in advance for any help!

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [April 19, 2019, 10:38pm UTC](https://discourse.vtk.org/t/four-dipsplay-window/414/10 "2019-04-19T22:38:36Z")

</div>

> [@Marco\_Festugato](#):
>
> should use vtkResliceImageViewer but how?

There are tests and examples for every VTK class that demonstrate how to use them.

---

<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: [April 20, 2019, 6:52am UTC](https://discourse.vtk.org/t/four-dipsplay-window/414/11 "2019-04-20T06:52:34Z")

</div>

thank u @lassoan for your answer. Unfortunately, the only example I found [here](https://vtk.org/doc/nightly/html/c2_vtk_e_4.html#c2_vtk_e_vtkResliceImageViewer) doesn’t help me ☹

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [April 22, 2019, 12:30am UTC](https://discourse.vtk.org/t/four-dipsplay-window/414/12 "2019-04-22T00:30:55Z")

</div>

Maybe others will have more patience to lead you through all the steps of building an image viewer application from scratch. I would just suggest you to study open-source VTK-based applications that already do everything that you need - MPR, 4-up views, image reslicing, volume rendering, etc. - [there are many of those](https://discourse.vtk.org/t/import-3d-volume-from-itk-to-vtk/497/6?u=lassoan).
