# Volume rendering gives solid box despite working XYZ views and adjusting preset/shift

**URL:** <https://discourse.slicer.org/t/volume-rendering-gives-solid-box-despite-working-xyz-views-and-adjusting-preset-shift/31775>\
**Category:** Support\
**Tags:** volume, volume-rendering\
**Created:** [September 18, 2023, 6:16pm UTC](https://discourse.slicer.org/t/volume-rendering-gives-solid-box-despite-working-xyz-views-and-adjusting-preset-shift/31775 "2023-09-18T18:16:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shika](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@shika](https://discourse.slicer.org/u/shika)\
**Post date:** [September 18, 2023, 6:16pm UTC](https://discourse.slicer.org/t/volume-rendering-gives-solid-box-despite-working-xyz-views-and-adjusting-preset-shift/31775/1 "2023-09-18T18:16:19Z")

</div>

Hello there,  
I am a new user of Slicer but I have read through the wiki and other related help forums. I have been having issues with rendering from a stack of images, specifically using the SlicerMorph [ImageStacks](https://github.com/SlicerMorph/S_2020/blob/master/Day_1/ImageStacks/ImageStacks.md) utility to convert a stack of png files (which were converted from full color jpg files and then scaled down to 25%) to a volume. The data is found [here](https://www.mediafire.com/file/bvvb1xxuayux4wi/brain-25-scale0000.nrrd/file). The views of individual dimensions (X, Y, Z) operate as expected (though the interpolation could be smoother):

 ![Screenshot 2023-09-18 014537](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/d/cd4a9a0a9ae3276407de30249d5505e0e2dae759.png)  
However whenever I try to render a volume, I get a solid color block no matter which preset or shift I try.  
 ![Screenshot 2023-09-18 014821](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/6/36a1bf4d548dd7a740fe11cc0d3f23e03bebe7c9.png)  
Using crop to reveal the interior of the volume reveals no “tunnels” or anything of the sort; it is still just a solid block:  
 ![Screenshot 2023-09-18 015018](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/0/c0a950a15c47453a469045115c877e19303f2450.png)  
Is there a way to fix this? I have spent many hours trying to troubleshoot this myself and it has been quite fruitless. I would greatly appreciate any help.

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [September 18, 2023, 6:50pm UTC](https://discourse.slicer.org/t/volume-rendering-gives-solid-box-despite-working-xyz-views-and-adjusting-preset-shift/31775/2 "2023-09-18T18:50:31Z")

</div>

You got couple issues going on:

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

First your dataset has 3076 px in X dimension. This is probably exceeding your gpu’s max3Dtexture dimension (it did in my intel GPU, which has a cap of 2048px). So you get an empty box. If you resample to a lower resolution. It renders

Your dataset is not aligned (there are shifts in object position from one slice to the next) and there is huge difference in resolution (50 times less data in Z slices). so it renders very poorly.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/a/da9148ddb68a75e8eb8d5991da71a397c907d1d8.jpeg)

This looks like one of the brain atlases, i don’t think it is meant to be rendered in 3D (not with labels embeded in the image). Why are you trying to render this in 3D?

---

<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:** [September 18, 2023, 7:14pm UTC](https://discourse.slicer.org/t/volume-rendering-gives-solid-box-despite-working-xyz-views-and-adjusting-preset-shift/31775/3 "2023-09-18T19:14:27Z")

</div>

I would recommend converting this to a segmentation. It can then be nicely visualized in both 2D and 3D.

The simplest would be to load the the image as a segmentation by selecting “Segmentation” in the “Description” column when you load the nrrd file. You can then go to Segmentations module and click “Show 3D” to see in 3D:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/d/cde5ac31fcbaa894777db35cac16843572fd677e.jpeg)

The problems are:

- Problem 1: Slices are not aligned (the position within the slice seems random)
- Problem 2: The segments don’t have a discrete gray level (at the boundary the values are interpolated and there are labels within the segments)

You could fix **problem 2** by segmenting the image using Segment Editor, for example using Grow from seeds effect:

- Specify seeds:

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

- Apply the region growing and click Show 3D:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/f/d/fd42692e1026a06f0fc3b0a29095b096d38d5600.jpeg)

However, for **problem 1** (misaligned slices) Slicer does not have a good solution. You can find image stack alignment tools in ImageJ that you can use and then import the results into Slicer. Or, you can ask the authors of the atlas to provide you the atlas as a 3D image that contains the slices already aligned.

---

<div class="post-metadata">

**Author:** ![shika](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@shika](https://discourse.slicer.org/u/shika)\
**Post date:** [September 18, 2023, 11:38pm UTC](https://discourse.slicer.org/t/volume-rendering-gives-solid-box-despite-working-xyz-views-and-adjusting-preset-shift/31775/4 "2023-09-18T23:38:57Z")

</div>

Thank you for your assistance and advice. It is very helpful!

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [September 19, 2023, 9:44pm UTC](https://discourse.slicer.org/t/volume-rendering-gives-solid-box-despite-working-xyz-views-and-adjusting-preset-shift/31775/5 "2023-09-19T21:44:17Z")

</div>

To my eye this data is not misaligned, it’s inconsistently segmented, since individual segments grow and shrink between slices rather than being consistently shifted one way or another. So probably you won’t get a good 3D reconstruction using this data, but you may be able to use it as a guide for doing a fresh fully 3D segmentation of a volumetric scan of the same species.
