# VTK multi-volume ROI not working

**URL:** <https://discourse.slicer.org/t/vtk-multi-volume-roi-not-working/10000>\
**Category:** Support\
**Created:** [January 29, 2020, 4:47pm UTC](https://discourse.slicer.org/t/vtk-multi-volume-roi-not-working/10000 "2020-01-29T16:47:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fbordignon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fbordignon/32/5269_2.png) [@fbordignon](https://discourse.slicer.org/u/fbordignon)\
**Post date:** [January 29, 2020, 4:47pm UTC](https://discourse.slicer.org/t/vtk-multi-volume-roi-not-working/10000/1 "2020-01-29T16:47:22Z")

</div>

See image below.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/9/b9ac5f9843e78320daebb01fc287c7f9e700d8b0.jpeg)

Also if I go from VTK multi-volume back to GPU ray casting, slicer crashes.

> **Error log**
>
> [DEBUG][Qt] 29.01.2020 13:32:04 (unknown:0) - Session start time …: 2020-01-29 13:32:04  
> [DEBUG][Qt] 29.01.2020 13:32:04 (unknown:0) - Slicer version …: 4.11.0-2020-01-20 (revision 28737) win-amd64 - installed release  
> [DEBUG][Qt] 29.01.2020 13:32:04 (unknown:0) - Operating system …: Windows / Professional / (Build 9200) - 64-bit  
> [DEBUG][Qt] 29.01.2020 13:32:04 (unknown:0) - Memory …: 130742 MB physical, 174630 MB virtual  
> [DEBUG][Qt] 29.01.2020 13:32:04 (unknown:0) - CPU …: GenuineIntel , 12 cores, 12 logical processors  
> [DEBUG][Qt] 29.01.2020 13:32:04 (unknown:0) - VTK configuration …: OpenGL2 rendering, TBB threading  
> [DEBUG][Qt] 29.01.2020 13:32:04 (unknown:0) - Qt configuration …: version 5.10.1, with SSL, requested OpenGL 3.2 (compatibility profile)  
> [DEBUG][Qt] 29.01.2020 13:32:04 (unknown:0) - Developer mode enabled …: no  
> [DEBUG][Qt] 29.01.2020 13:32:04 (unknown:0) - Prefer executable CLI …: yes  
> [DEBUG][Qt] 29.01.2020 13:32:04 (unknown:0) - Application path …: C:/Users/bordi/AppData/Local/NA-MIC/Slicer 4.11.0-2020-01-20/bin  
> [DEBUG][Qt] 29.01.2020 13:32:04 (unknown:0) - Additional module paths …: C:/Users/bordi/slicerltrace/Multicore, C:/Users/bordi/AppData/Roaming/NA-MIC/Extensions-28737/SegmentEditorExtraEffects/lib/Slicer-4.11/qt-scripted-modules  
> [DEBUG][Python] 29.01.2020 13:32:07 [Python] (C:\Users\bordi\AppData\Local\NA-MIC\Slicer 4.11.0-2020-01-20\lib\Slicer-4.11\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: Annotations  
> [DEBUG][Python] 29.01.2020 13:32:07 [Python] (C:\Users\bordi\AppData\Local\NA-MIC\Slicer 4.11.0-2020-01-20\lib\Slicer-4.11\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: SegmentEditor  
> [DEBUG][Python] 29.01.2020 13:32:07 [Python] (C:\Users\bordi\AppData\Local\NA-MIC\Slicer 4.11.0-2020-01-20\lib\Slicer-4.11\qt-scripted-modules\SubjectHierarchyPlugins\AbstractScriptedSubjectHierarchyPlugin.py:36) - Scripted subject hierarchy plugin registered: SegmentStatistics  
> [DEBUG][Qt] 29.01.2020 13:32:08 (unknown:0) - Switch to module: “Welcome”  
> [INFO][VTK] 29.01.2020 13:32:16 [vtkMRMLVolumeArchetypeStorageNode (00000195E4B6D600)] (D:\D\P\Slicer-0\Libs\MRML\Core\vtkMRMLVolumeArchetypeStorageNode.cxx:471) - Loaded volume from file: C:/Users/bordi/AppData/Local/Temp/Slicer/RemoteIO/MR-head.nrrd. Dimensions: 256x256x130. Number of components: 1. Pixel type: short.  
> [DEBUG][Qt] 29.01.2020 13:32:16 (unknown:0) - “Volume” Reader has successfully read the file “C:/Users/bordi/AppData/Local/Temp/Slicer/RemoteIO/MR-head.nrrd” “[0.16s]”  
> [DEBUG][Qt] 29.01.2020 13:32:23 (unknown:0) - Switch to module: “VolumeRendering”  
> [ERROR][VTK] 29.01.2020 13:33:01 [vtkShaderProgram (00000195F03AC460)] (D:\D\P\Slicer-0-build\VTK\Rendering\OpenGL2\vtkShaderProgram.cxx:461) - 1: #version 150
> 
> ========A LOT OF CODE HERE========
> 
> [ERROR][VTK] 29.01.2020 13:33:03 [vtkShaderProgram (00000195E4292220)] (D:\D\P\Slicer-0-build\VTK\Rendering\OpenGL2\vtkShaderProgram.cxx:462) - 0(816) : error C7623: implicit narrowing of type from “vec4” to “float”  
> 0(816) : error C1103: too few parameters in function call  
> 0(815) : error C7623: implicit narrowing of type from “vec4” to “float”  
> 0(816) : error C1102: incompatible type for parameter #2 (“colorTF.72”)  
> 0(815) : error C1035: assignment of incompatible types  
> [ERROR][VTK] 29.01.2020 13:33:03 [vtkOpenGLGPUVolumeRayCastMapper (00000195E0FC9810)] (D:\D\P\Slicer-0-build\VTK\Rendering\VolumeOpenGL2\vtkOpenGLGPUVolumeRayCastMapper.cxx:2938) - Shader failed to compile

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 29, 2020, 4:48pm UTC](https://discourse.slicer.org/t/vtk-multi-volume-roi-not-working/10000/2 "2020-01-29T16:48:08Z")

</div>

Multi-volume rendering is still experimental. Shading and clipping are not supported yet.

---

<div class="post-metadata">

**Author:** ![fbordignon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fbordignon/32/5269_2.png) [@fbordignon](https://discourse.slicer.org/u/fbordignon)\
**Post date:** [January 29, 2020, 5:05pm UTC](https://discourse.slicer.org/t/vtk-multi-volume-roi-not-working/10000/3 "2020-01-29T17:05:20Z")

</div>

@pieper indicated that we need to use the multi-volume if we need to display multiple volumes: [display incorrectly when two volume rendering by3D slicer 4.10.0 - #2 by pieper](https://discourse.slicer.org/t/display-incorrectly-when-two-volume-rendering-by3d-slicer-4-10-0/4669/2)

When I use the GPU ray-casting, I have the same isse as in [display incorrectly when two volume rendering by3D slicer 4.10.0](https://discourse.slicer.org/t/display-incorrectly-when-two-volume-rendering-by3d-slicer-4-10-0/4669)

The top head is always showing in foreground:

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/9/e9f78b4d27f5a352b4dbf9019474d6fda90f148a.png)

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [January 29, 2020, 5:13pm UTC](https://discourse.slicer.org/t/vtk-multi-volume-roi-not-working/10000/4 "2020-01-29T17:13:21Z")

</div>

Multi-volume rendering will allow you to intermix multiple volumes correctly. However, until its limitations (shading, cropping, and maybe a few others that we are not aware yet) are addressed, you can use workarounds including using independent volume renderers (for highly transparent volumes they may provide acceptable quality), merging multiple volumes into a single volume, and/or using model and segmentation nodes for visualization.

I’ve added an issue to track resolving of mult-volume rendering limitations: [https://issues.slicer.org/view.php?id=4719](https://issues.slicer.org/view.php?id=4719)

---

<div class="post-metadata">

**Author:** ![fbordignon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/fbordignon/32/5269_2.png) [@fbordignon](https://discourse.slicer.org/u/fbordignon)\
**Post date:** [January 29, 2020, 5:40pm UTC](https://discourse.slicer.org/t/vtk-multi-volume-roi-not-working/10000/5 "2020-01-29T17:40:33Z")

</div>

Thank you, I think it would be a great improvement for Slicer. Great job.

---

<div class="post-metadata">

**Author:** ![MissMac](https://avatars.discourse-cdn.com/v4/letter/m/c57346/32.png) [@MissMac](https://discourse.slicer.org/u/MissMac)\
**Post date:** [May 5, 2021, 1:19pm UTC](https://discourse.slicer.org/t/vtk-multi-volume-roi-not-working/10000/6 "2021-05-05T13:19:22Z")

</div>

Hello,

I would like to reopen this question to ask if VTK multi-volume ROI works now with the latest VTK version.
