# X-Ray Phase Contrast Volume Reconstructions  

**URL:** <https://discourse.slicer.org/t/x-ray-phase-contrast-volume-reconstructions/6596>\
**Category:** Support\
**Tags:** segmentation, volume-rendering\
**Created:** [April 24, 2019, 8:33pm UTC](https://discourse.slicer.org/t/x-ray-phase-contrast-volume-reconstructions/6596 "2019-04-24T20:33:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![matdonoghue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@matdonoghue](https://discourse.slicer.org/u/matdonoghue)\
**Post date:** [April 24, 2019, 8:33pm UTC](https://discourse.slicer.org/t/x-ray-phase-contrast-volume-reconstructions/6596/1 "2019-04-24T20:33:12Z")

</div>

Hi all,

I am doing a bit of research in x-ray phase contrast imaging. Part of the research is to demonstrate that this new imaging technique can be used for soft tissue volume reconstruction. The image slices demonstrate that glandular breast tissue can be clearly distinguished from the denser in situ ductal carcinoma. This is however not the case for the volume rendering and I believe the issue stems from the pixel values in the slices ranging from 1.2x10^-7 to 1.75x10^-7. I attached an image and will also attach a link to a drop box with the image slices. If anyone has any suggestions on how to improve the volume rendering please let me know.

Thanks,

Matthew

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/5/75b435e2141eeb48ff0efc58387044d72d81afe0.png)

[https://www.dropbox.com/sh/l80ywcjqd127i6h/AADpiQG6Te7wDx2Q6CgviIQ9a?dl=0](https://www.dropbox.com/sh/l80ywcjqd127i6h/AADpiQG6Te7wDx2Q6CgviIQ9a?dl=0)

---

<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 24, 2019, 5:45pm UTC](https://discourse.slicer.org/t/x-ray-phase-contrast-volume-reconstructions/6596/2 "2019-05-24T17:45:36Z")

</div>

The data seems not to have exported right. I get lots of these warnings when I try to load:

> TIFFReadDirectory: Warning, Unknown field with tag 50839 (0xc697) encountered.

Also when I spot check one image I see that the values are very small as you say. If you can export the data another way so it loads as a volume you can rescale the pixel values in Slicer pretty easily (`a = array('Tiff*'); a*= 1e9` then save and reload the file to get a better window/level).

---

<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 24, 2019, 6:38pm UTC](https://discourse.slicer.org/t/x-ray-phase-contrast-volume-reconstructions/6596/3 "2019-05-24T18:38:16Z")

</div>

I’ve checked this now and the problem is that the folder contains two image series, each with different slice size. Since file name prefixes are almost the same, Slicer tries to load them as one stack and fails.

You can load the two series if you separate the files into two folders:

- TiffSaver-tomo0111.nrrd … TiffSaver-tomo0476.tif
- TiffSaver-tomo00000.tif … TiffSaver-tomo00180.tif

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/c/8c8b01472f0bca01b0f2e6ef73ed4bb658cf962c.jpeg)

I would recommend to use the new utility functions for getting and updating the voxel array:

```auto
volNode = getNode('Tiff*')
a=arrayFromVolume(volNode)
a*= 1e10
arrayFromVolumeModified(volNode)

```

---

<div class="post-metadata">

**Author:** ![matdonoghue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@matdonoghue](https://discourse.slicer.org/u/matdonoghue)\
**Post date:** [May 24, 2019, 6:55pm UTC](https://discourse.slicer.org/t/x-ray-phase-contrast-volume-reconstructions/6596/4 "2019-05-24T18:55:51Z")

</div>

Thanks so much, apologies for the incorrect images being uploaded as well. I noticed that there also some images missing too. I can upload the correct tiff files when I get into work on Monday. The advice you’ve given me already has been a great help.

---

<div class="post-metadata">

**Author:** ![matdonoghue](https://avatars.discourse-cdn.com/v4/letter/m/f19dbf/32.png) [@matdonoghue](https://discourse.slicer.org/u/matdonoghue)\
**Post date:** [May 27, 2019, 11:19am UTC](https://discourse.slicer.org/t/x-ray-phase-contrast-volume-reconstructions/6596/5 "2019-05-27T11:19:53Z")

</div>

I have the link for the correct series of slices below [https://www.dropbox.com/s/p9tq32mdcpkyaav/cropped3.tif?dl=0](https://www.dropbox.com/s/p9tq32mdcpkyaav/cropped3.tif?dl=0)

I am new to 3-D slicer is there a document that describes how to access and use the utility functions? I can not find anything on it.

Kind regards,

Matthew

---

<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 27, 2019, 12:34pm UTC](https://discourse.slicer.org/t/x-ray-phase-contrast-volume-reconstructions/6596/6 "2019-05-27T12:34:00Z")

</div>

> [@matdonoghue](#):
>
> is there a document that describes how to access and use the utility functions?

The functions are documented here: [slicer — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/slicer.html#module-slicer.util)
