# Combining two microCT Datasets for higher Quality images

**URL:** <https://discourse.slicer.org/t/combining-two-microct-datasets-for-higher-quality-images/34244>\
**Category:** Support\
**Created:** [February 11, 2024, 4:42am UTC](https://discourse.slicer.org/t/combining-two-microct-datasets-for-higher-quality-images/34244 "2024-02-11T04:42:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nixxon94](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nixxon94/32/69306_2.png) [@nixxon94](https://discourse.slicer.org/u/nixxon94)\
**Post date:** [February 11, 2024, 4:42am UTC](https://discourse.slicer.org/t/combining-two-microct-datasets-for-higher-quality-images/34244/1 "2024-02-11T04:42:24Z")

</div>

Hello everyone,  
I am looking to combine two micro-CT scans in such a way that I get a new image stack that might have reduced noise.  
I have two scans of the same specimen in the exact same position and aquisition protocols. I am looking to reduce image noise and create a new image stack.  
I have tried this approach : [GitHub - maitek/image\_stacking: Automatic Image Stacking in OpenCV](https://github.com/maitek/image_stacking)  
but I am running into issues with cv2 on my python install for some reason and wondering if there is a more elegant way of doing this in slicer.

---

<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:** [February 11, 2024, 6:04am UTC](https://discourse.slicer.org/t/combining-two-microct-datasets-for-higher-quality-images/34244/2 "2024-02-11T06:04:05Z")

</div>

I don’t think there is such an averageVolumes module, but If they are already aligned, and have the exact same dimensions what you want to do is quite simply taking an average of two numpy arrays using `arrayFromVolume` method and saving as a new volume.

You can see example of python scripts interacting 3D volumes as numpy arrays here: [Script repository — 3D Slicer documentation](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#get-value-of-a-volume-at-specific-voxel-coordinates)

But increasing the signal to noise ratio at the acquisition time is more meaningful then trying to rescan. This is usually done by frame averaging (acquiring multiple frames -anywhere from 2 to 20- at the same rotation step, and average them).

If the original projections were not high quality, averaging two reconstructions from two acquisitions are not likely to give you a much better result. I suspect what you are trying to do would be roughly equivalent to running a median filter on one of the volumes.

---

<div class="post-metadata">

**Author:** ![nixxon94](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nixxon94/32/69306_2.png) [@nixxon94](https://discourse.slicer.org/u/nixxon94)\
**Post date:** [February 11, 2024, 1:41pm UTC](https://discourse.slicer.org/t/combining-two-microct-datasets-for-higher-quality-images/34244/3 "2024-02-11T13:41:36Z")

</div>

Thank you very much for your reply! I will look into the array averaging method.
