# Improving Slice overlay functionality to visualize registration differences using different color "channel" for fixed and moving

**URL:** <https://discourse.slicer.org/t/improving-slice-overlay-functionality-to-visualize-registration-differences-using-different-color-channel-for-fixed-and-moving/10920>\
**Category:** Support\
**Created:** [March 30, 2020, 9:59pm UTC](https://discourse.slicer.org/t/improving-slice-overlay-functionality-to-visualize-registration-differences-using-different-color-channel-for-fixed-and-moving/10920 "2020-03-30T21:59:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [March 30, 2020, 9:59pm UTC](https://discourse.slicer.org/t/improving-slice-overlay-functionality-to-visualize-registration-differences-using-different-color-channel-for-fixed-and-moving/10920/1 "2020-03-30T21:59:49Z")

</div>

To support generating overlay like this one (useful to visualize registration differences):

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/e/ae353192447d09b913fd77cece86b3ee7c6f9f62.png)

Image copied from [here](https://dipy.org/documentation/1.1.0./examples_built/streamline_registration/)

An idea would be to add a new blending mode. Currently we have the following:

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/9/c9707dbfd6f41c7d98ddc73404044969ea4084bd.png)

Would that generally be useful ?

cc: @Samuel_Gerber

---

<div class="post-metadata">

**Author:** ![Samuel\_Gerber](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/samuel_gerber/32/6410_2.png) [@Samuel\_Gerber](https://discourse.slicer.org/u/Samuel_Gerber)\
**Post date:** [March 30, 2020, 10:01pm UTC](https://discourse.slicer.org/t/improving-slice-overlay-functionality-to-visualize-registration-differences-using-different-color-channel-for-fixed-and-moving/10920/2 "2020-03-30T22:01:03Z")

</div>

Maybe the blending should be adding and you would pick colors that add together to white / gray. Then you’d a get grayscale image where the images are registered well and otherwise some of one or the other color

---

<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:** [March 30, 2020, 10:13pm UTC](https://discourse.slicer.org/t/improving-slice-overlay-functionality-to-visualize-registration-differences-using-different-color-channel-for-fixed-and-moving/10920/3 "2020-03-30T22:13:00Z")

</div>

Hi - can you elaborate on what blend function that would be?

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [March 30, 2020, 10:16pm UTC](https://discourse.slicer.org/t/improving-slice-overlay-functionality-to-visualize-registration-differences-using-different-color-channel-for-fixed-and-moving/10920/4 "2020-03-30T22:16:50Z")

</div>

> [@pieper](#):
>
> can you elaborate on what blend function that would be?

I am assuming we would have to write a custom blend function.

For reference, here is the code used to generate the figure above.

> <https://github.com/dipy/dipy/blob/003c3b49f9db711a8101d03365d2e0ea1abd34d5/dipy/viz/regtools.py#L343-L424>

---

<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:** [March 30, 2020, 10:35pm UTC](https://discourse.slicer.org/t/improving-slice-overlay-functionality-to-visualize-registration-differences-using-different-color-channel-for-fixed-and-moving/10920/5 "2020-03-30T22:35:00Z")

</div>

Hmm, I see, yes that could be useful. It would be easy enough to add a blend mode yes. Also though very easy to have a scripted module or cli that just makes a red/green mix of the two volumes with hot update. Could also be added as an extension to the CompareVolumes module. I don’t have a strong preference.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [March 30, 2020, 10:51pm UTC](https://discourse.slicer.org/t/improving-slice-overlay-functionality-to-visualize-registration-differences-using-different-color-channel-for-fixed-and-moving/10920/6 "2020-03-30T22:51:49Z")

</div>

> [@pieper](#):
>
> Could also be added as an extension to the CompareVolumes module. I don’t have a strong preference.

Agreed.

We currently do not need this feature, @Samuel_Gerber and I discussed this in the context of a proposal and I wanted to have this documented so that we could refer to it at a later time.
