# How to save the volume pixel data in display area?

**URL:** <https://discourse.slicer.org/t/how-to-save-the-volume-pixel-data-in-display-area/20674>\
**Category:** Support\
**Created:** [November 18, 2021, 3:31am UTC](https://discourse.slicer.org/t/how-to-save-the-volume-pixel-data-in-display-area/20674 "2021-11-18T03:31:11Z")\
**Posts on this page:** 4\
**Page:** 2

<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:** [December 29, 2021, 12:10am UTC](https://discourse.slicer.org/t/how-to-save-the-volume-pixel-data-in-display-area/20674/22 "2021-12-29T00:10:12Z")

</div>

Yes, if you have different dots per inch in the x and y directions you would expect to see a distortion like that. You can set both dpi values to match what your matlab code expects.

---

<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:** [December 30, 2021, 9:28am UTC](https://discourse.slicer.org/t/how-to-save-the-volume-pixel-data-in-display-area/20674/23 "2021-12-30T09:28:12Z")

</div>

Thanks Steve,  
I set the XY resolution 300 x 300 which is according to my volume information in Slicer

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/1/41d995e7e207f864e20177dda7e222c667bec40a.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/1/3142bc34efa5245914d960431746573b22001f8b.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/8/788a6ca4c2b26977f70b1677e2896bb5fb3ff6c2.png)

But when I load one slice into MATLAB,the 2D image seemingly is compressed.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/a/8affd793546fe9efc883b26a773c9084a0b7ee4c.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/9/79f5f2fa8790810ff7b6f154c71da96ddacbbba4.png)

The dimension should be 300x300 right?

---

<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:** [December 30, 2021, 8:32pm UTC](https://discourse.slicer.org/t/how-to-save-the-volume-pixel-data-in-display-area/20674/24 "2021-12-30T20:32:47Z")

</div>

> [@user4](#):
>
> I set the XY resolution 300 x 300 which is according to my volume information in Slicer

The output resolution in dpi is not related to the resolution of your input volume, since Slicer is volume rendering in patient space. So you want to specify the output resolution in terms of the physical size of your subject and the expectations of the matlab code. HTH.

---

<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:** [December 31, 2021, 3:37am UTC](https://discourse.slicer.org/t/how-to-save-the-volume-pixel-data-in-display-area/20674/25 "2021-12-31T03:37:07Z")

</div>

Thanks Steve,  
I have tried several times and set the XY resolution by 510 and got the 2D slice image dimension 300x300 in MATLAB.So it is confused to me,what’s the relationship between the output image and the printer parameters setting?  
Another quesion,If I do some volume rendering and silce with the same parameters setting,the output image size is different from the raw volume without any rendering.  
Can you describe the reason in detail? Thank you very much!

[Previous page](https://discourse.slicer.org/t/how-to-save-the-volume-pixel-data-in-display-area/20674.md?page=1)
