# Volume rendering shows a solid box

**URL:** <https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390>\
**Category:** Support\
**Created:** [October 14, 2018, 5:53am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390 "2018-10-14T05:53:25Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@Gary](https://discourse.slicer.org/u/Gary)\
**Post date:** [October 14, 2018, 5:53am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/1 "2018-10-14T05:53:25Z")

</div>

Hi everyone,

As a beginner of this excellent software, Could anyone teach me how to get the surface of the border, which is the line between white and black region?

 ![NEWCapture](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/6/86a746d203928ad5f6a68daa0c91fee903818b7b.png)

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [October 14, 2018, 9:01am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/2 "2018-10-14T09:01:31Z")

</div>

Hi Gary,

Thanks for reaching out.

for sake of completness, here are the two other comment you posted in an identical post:

- I am trying to find the volume rendering of 2d pictures. After click the volume rendering button, it shows me a black solid box, which is not what I want.

- The goal is to find the surface between black and white region of the picture. Could anyone give me some tips or instructions?

Ps: Generally speaking we try to avoid asking the same question multiple time with a difference title, if needed, you should be able to edit the title of your post.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [October 14, 2018, 9:08am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/3 "2018-10-14T09:08:22Z")

</div>

You could use the [Segment Editor](https://slicer.readthedocs.io/en/latest/user_guide/module_segmenteditor.html) to threshold your image and erase the wanted region, then you could use the `Segment Statistics` module to get information like the number of voxel. From there, you should be able to compute the surface using metatdata specific to your image (or “picture”)

[![](https://img.youtube.com/vi/fM_rxfDTRi0/maxresdefault.jpg "Segment statistics - new module in 3D Slicer") ](https://www.youtube.com/watch?v=fM_rxfDTRi0)

> [@Segment Statistics Volume Calculation](https://discourse.slicer.org/t/segment-statistics-volume-calculation/3252):
>
> Hello, I am new to Slicer and have a few questions about the Segment Statistics Module, particularly how it calculates volume. I am currently segmenting muscle groups, subcutaneous and intramuscular fat within a single slice from MR Images of the thigh. I have read that the Labelmap Statistics calculates volume as the product of the pixel spacing (mm3) and the pixel count. I am curious if Slicer is using the actual pixel dimensions given in the DICOM header combined with the slice thickness or n…

---

<div class="post-metadata">

**Author:** ![Gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@Gary](https://discourse.slicer.org/u/Gary)\
**Post date:** [October 14, 2018, 8:36pm UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/4 "2018-10-14T20:36:52Z")

</div>

Sorry about posting same questions multiple times and Thanks for your reply.

The goal is to get the lines between white region and black region, and these lines will form a surface without the black and white region.

Here is what I did, I used the threshold to mark the white region, and use Islands to remove the white part. How could I remove the black region and obtain the boundary surface.

---

<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:** [October 16, 2018, 7:04pm UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/5 "2018-10-16T19:04:05Z")

</div>

The main problem is that all volume rendering presets assume that background is darker than the object that you would like to see. In your case, the object is dark and background box is bright, therefore you’ll only see a solid box.

The simplest is probably to invert your image by using SimpleFilters module: Filter = ShiftScaleImageFilter, Scale = -1.

If you don’t want to change your input image then you need to adjust volume rendering transfer functions to make bright values transparent. Something like this should work:

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/6/864503757ba074e04fea6153177038d19d507b0b.png)

I’ve added an “inverted” volume rendering preset, CT-Air, which will be available in nightly builds that you download tomorrow or later. If you choose this preset and adjust “Shift” slider then dark structures should show up in the 3D view.

---

<div class="post-metadata">

**Author:** ![Gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@Gary](https://discourse.slicer.org/u/Gary)\
**Post date:** [October 17, 2018, 4:10am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/6 "2018-10-17T04:10:06Z")

</div>

Thanks for your patient and reply Andras.I tried it on my computer, and it works now!!!

By the way, Do we have mesh in 3D slicer? Because I would like to collect data of every point on the surface.

Thanks for your help again, I do really appreciate it.

---

<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:** [October 17, 2018, 4:40am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/7 "2018-10-17T04:40:47Z")

</div>

> [@Gary](#):
>
> Do we have mesh in 3D slicer?

Yes. Post a new topic about what you would like to have exactly.

---

<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:** [October 17, 2018, 4:41am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/8 "2018-10-17T04:41:15Z")

</div>

> [@Gary](#):
>
> I tried it on my computer, and it works now!!!

Would you mind posting a screenshot of the end result?

---

<div class="post-metadata">

**Author:** ![Gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@Gary](https://discourse.slicer.org/u/Gary)\
**Post date:** [October 17, 2018, 4:09am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/9 "2018-10-17T04:09:02Z")

</div>

Thanks for your patient and reply Andras.I tried it on my computer, it works now.  
By the way, Do we have mesh in 3D slicer? Because I would like to collect data of every point on the surface.

---

<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:** [October 18, 2018, 1:01am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/10 "2018-10-18T01:01:06Z")

</div>

> [@Gary](#):
>
> Do we have mesh in 3D slicer?

Yes. Post a new topic about what you would like to have exactly.

---

<div class="post-metadata">

**Author:** ![Gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@Gary](https://discourse.slicer.org/u/Gary)\
**Post date:** [October 20, 2018, 1:21am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/11 "2018-10-20T01:21:57Z")

</div>

Here is what I got from 3D Slicer.  
By the way, could I do surface mesh rather than volume mesh on this software, and export them as .stl file.  
Because I would like to use and analyze the surface mesh data.I

 ![Capture](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/9/69c51acaec39496c75a355ae7db870a54dc20e3a.png)

---

<div class="post-metadata">

**Author:** ![cpinter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/cpinter/32/7995_2.png) [@cpinter](https://discourse.slicer.org/u/cpinter)\
**Post date:** [October 20, 2018, 3:50pm UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/12 "2018-10-20T15:50:19Z")

</div>

Yes, image segmentation is one of the major features that have seen a lot of improvements lately, see  
[https://www.slicer.org/wiki/Documentation/Nightly/Training#Slicer4\_Image\_Segmentation](https://www.slicer.org/wiki/Documentation/Nightly/Training#Slicer4_Image_Segmentation)

---

<div class="post-metadata">

**Author:** ![Gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@Gary](https://discourse.slicer.org/u/Gary)\
**Post date:** [October 21, 2018, 2:10am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/13 "2018-10-21T02:10:42Z")

</div>

Thanks for your reply, could you give me a hint about how to do the surface mesh on 3D slicer?

---

<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:** [October 21, 2018, 2:32am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/14 "2018-10-21T02:32:42Z")

</div>

Once your segmentation is completed, the easiest way to export a surface mesh file is to use [_Export to files_ function](https://discourse.slicer.org/t/save-segmentation-directly-to-stl-or-obj-files/2428) in Segment Editor module.

---

<div class="post-metadata">

**Author:** ![Gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@Gary](https://discourse.slicer.org/u/Gary)\
**Post date:** [October 21, 2018, 2:57am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/15 "2018-10-21T02:57:45Z")

</div>

Thanks for your reply Andras,

After I change the brighter setting, which only show the black region rather than the white region, could I directly do the surface triangle mesh and export the files as .stl file?

If I can export the files as .stl format, will the data only contain the black region, or both white and black region?

---

<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:** [October 21, 2018, 3:14am UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/16 "2018-10-21T03:14:09Z")

</div>

If you need only an STL file then you don’t need volume rendering. You can use Segment Editor module’s Threshold effect to create a segment, click _Show 3D_ to verify how the mesh looks in 3D, and save as STL using _Export to files_ feature.

---

<div class="post-metadata">

**Author:** ![Gary](https://avatars.discourse-cdn.com/v4/letter/g/839c29/32.png) [@Gary](https://discourse.slicer.org/u/Gary)\
**Post date:** [October 27, 2018, 6:04pm UTC](https://discourse.slicer.org/t/volume-rendering-shows-a-solid-box/4390/17 "2018-10-27T18:04:47Z")

</div>

Thanks for your help Andras, I finished the first step, your suggestions are really helpful!!

By the way, is there any way to remove the outside surface(connected), to get the volume as the file attached?

There should be two holes on the top of the heart, and I want to remove the surface parts that are connected to those two holes.

Andras Lasso [slicer@discoursemail.com](mailto:slicer@discoursemail.com) 于2018年10月20日周六 下午11:24写道：

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