# How to export a red slice view while keeping the pixel value according to the Color Scalar Bar?

**URL:** <https://discourse.slicer.org/t/how-to-export-a-red-slice-view-while-keeping-the-pixel-value-according-to-the-color-scalar-bar/23955>\
**Category:** Support\
**Created:** [June 20, 2022, 9:51am UTC](https://discourse.slicer.org/t/how-to-export-a-red-slice-view-while-keeping-the-pixel-value-according-to-the-color-scalar-bar/23955 "2022-06-20T09:51:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![user4](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/user4/32/13172_2.png) [@user4](https://discourse.slicer.org/u/user4)\
**Post date:** [June 20, 2022, 9:51am UTC](https://discourse.slicer.org/t/how-to-export-a-red-slice-view-while-keeping-the-pixel-value-according-to-the-color-scalar-bar/23955/1 "2022-06-20T09:51:42Z")

</div>

Hi all,  
This is a sample data,I want to do some quantitative analysis so I need the pixel values.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/d/ada128dd0d1b5070797fe033d6e74c0f03168a5a.jpeg)  
I can use data probe to see the pixel value marked in blue.Now I want to save this picture,but if I use screen capture to save it as a png file,the pixel value becomes between 0-255.  
There is a color bar marked in green, I want to know if I can save the whole 2D view while keeping the original pixel values?  
Thank you in advance for your help!

---

<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:** [June 20, 2022, 7:28pm UTC](https://discourse.slicer.org/t/how-to-export-a-red-slice-view-while-keeping-the-pixel-value-according-to-the-color-scalar-bar/23955/2 "2022-06-20T19:28:19Z")

</div>

You can’t fit the original pixel values into a png file. You would need to use a different format, such as nrrd.

---

<div class="post-metadata">

**Author:** ![user4](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/user4/32/13172_2.png) [@user4](https://discourse.slicer.org/u/user4)\
**Post date:** [June 21, 2022, 7:24am UTC](https://discourse.slicer.org/t/how-to-export-a-red-slice-view-while-keeping-the-pixel-value-according-to-the-color-scalar-bar/23955/4 "2022-06-21T07:24:45Z")

</div>

Thanks Steve,  
If I want to save the 2D view as a nrrd file, **not the whole volume** ,just only the slice,does Slicer4.13 currently have an existing GUI or does script repository have relevant python code?

---

<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 21, 2022, 5:09pm UTC](https://discourse.slicer.org/t/how-to-export-a-red-slice-view-while-keeping-the-pixel-value-according-to-the-color-scalar-bar/23955/5 "2022-06-21T17:09:46Z")

</div>

You can get access to the resliced image before intensity rescaling as shown in [this code snippet](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#extract-randomly-oriented-slabs-of-given-shape-from-a-volume).
