# Printing volume renderings in plastic

**URL:** <https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017>\
**Category:** Support\
**Tags:** volume-rendering, 3d-printing\
**Created:** [May 30, 2018, 12:42pm UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017 "2018-05-30T12:42:49Z")\
**Posts on this page:** 18\
**Page:** 1

<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:** [May 30, 2018, 12:42pm UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/1 "2018-05-30T12:42:49Z")

</div>

A question that comes up on this forum from time to time is why we can’t [just 3D print the volume rendered view](https://discourse.slicer.org/t/save-volume-rendering-as-stl-file/524). We explain that most printers today expect STL surface models and we go into the difference between volume rendering and surface segmentation.

I wanted to point out some just published research about new printing techniques that are much closer to directly printing out a volume rendering.

These are photographs of 3D prints made using this technique:

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

Here’s our paper that describes the method:

[https://www.liebertpub.com/doi/pdf/10.1089/3dp.2017.0140](https://www.liebertpub.com/doi/pdf/10.1089/3dp.2017.0140)

It still requires special printers and materials, but if the technique proves useful we can expect it to become more commonly available.

---

<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:** [May 30, 2018, 1:38pm UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/2 "2018-05-30T13:38:33Z")

</div>

These look beautiful and it’s great that you don’t need to segment your data.

---

<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 10, 2018, 4:11am UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/3 "2018-10-10T04:11:41Z")

</div>

An extension has been added to Slicer that can print such models: [SlicerFab](https://github.com/SlicerFab/SlicerFab). It is available in the extension manager for recent nightly builds.

---

<div class="post-metadata">

**Author:** ![Wan](https://avatars.discourse-cdn.com/v4/letter/w/8dc957/32.png) [@Wan](https://discourse.slicer.org/u/Wan)\
**Post date:** [April 10, 2020, 2:20am UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/6 "2020-04-10T02:20:31Z")

</div>

Hello, I am a Chinese student and I am going to print a heart model like this:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/0/4028e827a6289d977a922bb17574dffae0c9ba22.jpeg)  
But I encountered certain difficulties in volume rendering, my heart model is dark, like this picture. It doesn’t has any color, so I got numbers of bitmap(png) without colors. How can I save this problem.

---

<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:** [April 10, 2020, 2:52am UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/7 "2020-04-10T02:52:07Z")

</div>

In cardiac CT images, all contrast-filled structures have similar image intensity, so direct volume rendering will not help. You need to segment the image as explained here in detail:

---

<div class="post-metadata">

**Author:** ![Wan](https://avatars.discourse-cdn.com/v4/letter/w/8dc957/32.png) [@Wan](https://discourse.slicer.org/u/Wan)\
**Post date:** [April 10, 2020, 12:16pm UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/8 "2020-04-10T12:16:20Z")

</div>

I‘m sorry. My English is poor, I will describe my question more clearly:  
I want to 3D print a heart model. In the 3D slicer, I used the “grow from seed” method and got the following picture:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/1/71d4ab9ee27322c37288cd2c626b32d5c7196759.jpeg)  
I know that only the volume can be rendered, so I want to convert these 8 segmentation into volume. In this step, I used the “split volume” method. This way I got 8 volumes。  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/d/ed241e4ad053f6678bc045d69a5fceab5df83f41.png)  
I want to render these volumes one by one, superimposed in the window, like this:  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/8/5864da9a86224f80ded91bdcf0f47eddaa1f0d9a.jpeg)

---

<div class="post-metadata">

**Author:** ![Wan](https://avatars.discourse-cdn.com/v4/letter/w/8dc957/32.png) [@Wan](https://discourse.slicer.org/u/Wan)\
**Post date:** [April 10, 2020, 12:20pm UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/9 "2020-04-10T12:20:24Z")

</div>

Finally I got the picture below

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/5/6/56fc0d30b32429a0040877d832081b7a670411a5.jpeg)  
But I have this very serious problem when using bitmap generator. There is nothing left  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/7/87a5b90b6537b60707a540630ed24d43446210a5.jpeg)  
I think maybe multiple volumes cause an error, but the same problem still happens when I try render one volume and generate bitmap.  
I ’m sure there are no errors in my bitmap, because the picture below is a successful example  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/e/1/e11cd441ed6c57d2fb2d6be7b058840812a12da1.jpeg)  
Thank you for reading, I look forward to your answer, thank you

---

<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:** [April 10, 2020, 1:05pm UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/10 "2020-04-10T13:05:01Z")

</div>

@Wan - Can you try the latest nightly preview of Slicer and the SlicerFab extension? If the bitmap generator is not working for you please share a scene that can be used to replicate the issue.

---

<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:** [April 10, 2020, 4:52pm UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/11 "2020-04-10T16:52:06Z")

</div>

If you already segmented your volume then you don’t need bitmap printing but you can use a regular plastic color printer. You need to export the segmentation to STL or colored OBJ (using Export to files feature in Segment Editor). You may also export to colored VRML (as described [here](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Export_entire_scene_as_VRML)) or glTF (using [SlicerOpenAnatomy extension](https://github.com/PerkLab/SlicerOpenAnatomy)).

---

<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:** [December 12, 2020, 9:32pm UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/12 "2020-12-12T21:32:42Z")

</div>

A post was split to a new topic: [I have lots of questions. Can I write you an email?](https://discourse.slicer.org/t/i-have-lots-of-questions-can-i-write-you-an-email/15025)

---

<div class="post-metadata">

**Author:** ![facfox](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/facfox/32/15733_2.png) [@facfox](https://discourse.slicer.org/u/facfox)\
**Post date:** [June 22, 2022, 2:43am UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/13 "2022-06-22T02:43:21Z")

</div>

Hi @lassoan , thanks a lot for the great plugin!  
However after exporting the slicing images using Slicerfab with only 6 colors, the Voxel Print Utility still shows error “voxel data contains 4043(too many) colors”… Guess the boundaries are still not clear enough… Any solution to that??

 ![b863390c6f4cfd62408bde8370fa41c](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/9/8/98990e40f3e7db0d7d1ab719a69e871ff96070f7.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:** [June 22, 2022, 1:38pm UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/14 "2022-06-22T13:38:46Z")

</div>

Slicer exports full-color images. You need to apply dithering on the exported images if you want to reduce the total number of colors used. I have never gone further than generating the full-color images, so I cannot recommend any specific software to do that. If you find a good one then please share it here to help future users.

---

<div class="post-metadata">

**Author:** ![facfox](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/facfox/32/15733_2.png) [@facfox](https://discourse.slicer.org/u/facfox)\
**Post date:** [June 23, 2022, 6:18am UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/15 "2022-06-23T06:18:31Z")

</div>

Thanks! I got the same answer from Stratasys team asking me to use the dithering/halftoning tools to process the image, I will find a way to bulk process them then.

---

<div class="post-metadata">

**Author:** ![Esteban\_Barreiro](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/esteban_barreiro/32/5430_2.png) [@Esteban\_Barreiro](https://discourse.slicer.org/u/Esteban_Barreiro)\
**Post date:** [June 23, 2022, 9:02am UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/16 "2022-06-23T09:02:19Z")

</div>

it could be great if SlicerFab have dithering within the algorithm. We were using Gimp with Bimp (the batch mode modification for Gimp, all free and open source software) to change the amount of colours by dithering the images, but still having errors to solve. And I recently post an error, I was using SlicerFab properly until today [https://discourse.slicer.org/t/slicerfab-doesnt-work-properly-in-5-0-2/24001](https://discourse.slicer.org/t/slicerfab-doesnt-work-properly-in-5-0-2/24001)

---

<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:** [June 23, 2022, 3:07pm UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/17 "2022-06-23T15:07:52Z")

</div>

> [@Esteban\_Barreiro](#):
>
> it could be great if SlicerFab have dithering within the algorithm

Dithering should be done by the printer manufacturer, because only they know the optimal parameters (which colors are available, what is the resolution, what amount of each color can be deposited, etc.).

However, until they provide this feature it woul be indeed nice if Slicer could do some generic dithering.

Integrating Gimp/Bimp with Slicer could be somewhat complicated, as they are both applications and I’m not sure if they have a command-line interface.

However, using [ImageMagick](https://imagemagick.org/) should be quite easy. It has nice [quantization features](https://legacy.imagemagick.org/Usage/quantize/#intro) and Slicer could run the command-line tool to quantize each captured image slice.

---

<div class="post-metadata">

**Author:** ![Dr3dGeoff](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@Dr3dGeoff](https://discourse.slicer.org/u/Dr3dGeoff)\
**Post date:** [August 19, 2022, 1:03pm UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/18 "2022-08-19T13:03:32Z")

</div>

Hi, I’m a bit confused how to use this extension to convert a .STL file into a stack of images for use in inkjet 3D printing. I can import the .STL fine, but then when I try to use the extension it returns a traceback error, attached below.

I’ll be honest, I’m a materials development person. Software always throws me for a loop. Any help understanding what I’m looking at, what’s going wrong, and how the software understands STLs would be wonderful.

"Traceback (most recent call last):  
File “C:/Users/geoff/AppData/Local/NA-MIC/Slicer 5.0.3/NA-MIC/Extensions-30893/SlicerFab/lib/Slicer-5.0/qt-scripted-modules/BitmapGenerator.py”, line 157, in onApplyButton  
self.logic.generate(volumeRenderingNode, filePattern)  
File “C:/Users/geoff/AppData/Local/NA-MIC/Slicer 5.0.3/NA-MIC/Extensions-30893/SlicerFab/lib/Slicer-5.0/qt-scripted-modules/BitmapGenerator.py”, line 268, in generate  
self.create3dView(volumeRenderingNode)  
File “C:/Users/geoff/AppData/Local/NA-MIC/Slicer 5.0.3/NA-MIC/Extensions-30893/SlicerFab/lib/Slicer-5.0/qt-scripted-modules/BitmapGenerator.py”, line 251, in create3dView  
self.threeDViewNode.SetAndObserveParentLayoutNodeID(viewOwnerNode.GetID())  
AttributeError: ‘NoneType’ object has no attribute ‘GetID’

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “C:/Users/geoff/AppData/Local/NA-MIC/Slicer 5.0.3/NA-MIC/Extensions-30893/SlicerFab/lib/Slicer-5.0/qt-scripted-modules/BitmapGenerator.py”, line 160, in onApplyButton  
logging.error(“Error: {0}”.format(e.message))  
AttributeError: ‘AttributeError’ object has no attribute ‘message’"

---

<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:** [August 19, 2022, 1:49pm UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/19 "2022-08-19T13:49:37Z")

</div>

It looks like the SlicerFab extension needs to be updated to work with the recent Slicer5 release. Probably you can have it working with an older release.

But FYI, if you are starting with an STL file than SlicerFab is not what you need. The BitmapGenerator is for taking volumetric data, like a CT scan and making rendered slices (rgb images). STL files are already surface models.

---

<div class="post-metadata">

**Author:** ![Dr3dGeoff](https://avatars.discourse-cdn.com/v4/letter/d/d2c977/32.png) [@Dr3dGeoff](https://discourse.slicer.org/u/Dr3dGeoff)\
**Post date:** [August 19, 2022, 3:40pm UTC](https://discourse.slicer.org/t/printing-volume-renderings-in-plastic/3017/20 "2022-08-19T15:40:32Z")

</div>

Ah, I see, thank you. This is what came up while hunting around online, I guess the keywords were a bit tricked. Thanks so much!
