# Question about combing different scans according to rules

**URL:** <https://discourse.slicer.org/t/question-about-combing-different-scans-according-to-rules/5626>\
**Category:** Support\
**Created:** [February 3, 2019, 5:18am UTC](https://discourse.slicer.org/t/question-about-combing-different-scans-according-to-rules/5626 "2019-02-03T05:18:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rowan\_miller](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rowan_miller/32/80472_2.png) [@rowan\_miller](https://discourse.slicer.org/u/rowan_miller)\
**Post date:** [February 3, 2019, 5:18am UTC](https://discourse.slicer.org/t/question-about-combing-different-scans-according-to-rules/5626/1 "2019-02-03T05:18:19Z")

</div>

I have DWI and T2 axial images. I’d like to create a new set of images through combining those. However i’d like the combination to occur according to a set of rules:

if dwi dark + t2 dark -\> dark  
if dwi dark + t2 bright -\> dark  
if dwi light + t2 light -\> dark  
if dwi light + t2 dark -\> hot pink!

could anyone point me to some modules or suggest a way to get started on this?

regards,

---

<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:** [February 5, 2019, 2:54pm UTC](https://discourse.slicer.org/t/question-about-combing-different-scans-according-to-rules/5626/2 "2019-02-05T14:54:42Z")

</div>

Sounds like you can do that by writing a small python script that applies a formula from the two input volumes to calculate the output value. Then apply a color table to make the bright parts pink. Note that you may need to resample the dwi into the t2 space before doing numpy array options.

[https://www.slicer.org/wiki/Documentation/4.10/Developers/Python\_scripting#Start\_Here](https://www.slicer.org/wiki/Documentation/4.10/Developers/Python_scripting#Start_Here)
