# ScreenCapture - PNG stack looks flattened

**URL:** <https://discourse.slicer.org/t/screencapture-png-stack-looks-flattened/10948>\
**Category:** Support\
**Created:** [March 31, 2020, 9:24pm UTC](https://discourse.slicer.org/t/screencapture-png-stack-looks-flattened/10948 "2020-03-31T21:24:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![KTing](https://avatars.discourse-cdn.com/v4/letter/k/ebca7d/32.png) [@KTing](https://discourse.slicer.org/u/KTing)\
**Post date:** [March 31, 2020, 9:24pm UTC](https://discourse.slicer.org/t/screencapture-png-stack-looks-flattened/10948/1 "2020-03-31T21:24:48Z")

</div>

Hello,

When I re-load images from the Screen Capture module back into Slicer, my volume appears flattened. Attached is an example using the MRHead sample data and generating 50 PNGs. All of the slices are generated but the volume rendering does not look correct

This is fixed by using a larger number of PNG’s, but I’m wondering if it’s possible to scale this automatically such that I can generate 50 PNG’s and just get a smaller but correctly-scaled model?

Thank you.

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

---

<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:** [March 31, 2020, 9:27pm UTC](https://discourse.slicer.org/t/screencapture-png-stack-looks-flattened/10948/2 "2020-03-31T21:27:06Z")

</div>

You lost the correct z spacing, when you saved the volume as PNG stack. PNG doesn’t retain this information. You can manually enter the correct spacing (I think it is 1.3mm for the original MRHead.NRRD) using the `Volumes` module

---

<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:** [March 31, 2020, 9:59pm UTC](https://discourse.slicer.org/t/screencapture-png-stack-looks-flattened/10948/3 "2020-03-31T21:59:16Z")

</div>

Note that screen capture is a lossy operation (you lose dynamic range, window/level settings are burnt in, etc), so do not use it for data export. It is for presentations, testing, etc.

---

<div class="post-metadata">

**Author:** ![KTing](https://avatars.discourse-cdn.com/v4/letter/k/ebca7d/32.png) [@KTing](https://discourse.slicer.org/u/KTing)\
**Post date:** [April 1, 2020, 6:25pm UTC](https://discourse.slicer.org/t/screencapture-png-stack-looks-flattened/10948/4 "2020-04-01T18:25:37Z")

</div>

Thanks! 1.3mm looks about right for MRHead.

---

<div class="post-metadata">

**Author:** ![KTing](https://avatars.discourse-cdn.com/v4/letter/k/ebca7d/32.png) [@KTing](https://discourse.slicer.org/u/KTing)\
**Post date:** [April 1, 2020, 6:28pm UTC](https://discourse.slicer.org/t/screencapture-png-stack-looks-flattened/10948/5 "2020-04-01T18:28:43Z")

</div>

Is there another method you would recommend for data export?  
I’m working with segmentations which I’ve exported to labelmaps, then volumeNodes.

I also tried using SlicerFab bitmap generator but kept getting copies of one layer rather than slices throughout the whole volume.

---

<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:** [April 1, 2020, 6:40pm UTC](https://discourse.slicer.org/t/screencapture-png-stack-looks-flattened/10948/6 "2020-04-01T18:40:58Z")

</div>

Why aren’t you saving them NRRD? It is not clear to me what you are trying to accomplish. The cross-sections above seems like regular slices from the sample data, not an output SlicerFab. So, the best would be use the default volume format, NRRD which will retain slice spacing.

---

<div class="post-metadata">

**Author:** ![KTing](https://avatars.discourse-cdn.com/v4/letter/k/ebca7d/32.png) [@KTing](https://discourse.slicer.org/u/KTing)\
**Post date:** [April 1, 2020, 6:45pm UTC](https://discourse.slicer.org/t/screencapture-png-stack-looks-flattened/10948/7 "2020-04-01T18:45:35Z")

</div>

The application I’m working on creates voxel objects by loading in stacks of PNG’s. I have some segmentation files (NRRD) in Slicer and the goal is to export them to PNGs so I can load them into my application

---

<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:** [April 1, 2020, 7:07pm UTC](https://discourse.slicer.org/t/screencapture-png-stack-looks-flattened/10948/8 "2020-04-01T19:07:32Z")

</div>

I think all you need to do is to convert your segmentation to label map and then save it NRRD. I don’t think slicer output a volume as sequence of PNG files through the save dialog box, and using the screen capture has the potential issues @lassoan pointed out (although I am not sure how relevant they are for label maps). You can use Fiji to convert your NRRD to PNG sequence…

---

<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 4, 2020, 9:16pm UTC](https://discourse.slicer.org/t/screencapture-png-stack-looks-flattened/10948/9 "2020-04-04T21:16:22Z")

</div>

> [@muratmaga](#):
>
> You can use Fiji to convert your NRRD to PNG sequence…

You can write out a 3D numpy array as a png sequence using a few lines of Python code (you can find examples by web search; you can use `pip_install` command in Slicer to install any additional packages for png writing).
