# Error with calculation image difference using ROI

**URL:** <https://discourse.slicer.org/t/error-with-calculation-image-difference-using-roi/15315>\
**Category:** Support\
**Created:** [January 2, 2021, 11:46am UTC](https://discourse.slicer.org/t/error-with-calculation-image-difference-using-roi/15315 "2021-01-02T11:46:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marianaslicer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/marianaslicer/32/8555_2.png) [@marianaslicer](https://discourse.slicer.org/u/marianaslicer)\
**Post date:** [January 2, 2021, 11:46am UTC](https://discourse.slicer.org/t/error-with-calculation-image-difference-using-roi/15315/1 "2021-01-02T11:46:25Z")

</div>

Slicer version: 4.13.0 and Slicer 4.11.20200930

Hello everyone,

I want to calculate the image difference between the fixed and warped image, after registration, using a specified ROI. I manually created the ROI, but after assign it the role as ROI in Registration Quality Assurance module, there was a shift and the result of the image difference was wrong.

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

The error occurred in both 3D Slicer versions.

If anyone could help me. I would really appreciate it.

---

<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:** [January 2, 2021, 3:53pm UTC](https://discourse.slicer.org/t/error-with-calculation-image-difference-using-roi/15315/2 "2021-01-02T15:53:51Z")

</div>

You may need to harden the transform on the warped image.

---

<div class="post-metadata">

**Author:** ![marianaslicer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/marianaslicer/32/8555_2.png) [@marianaslicer](https://discourse.slicer.org/u/marianaslicer)\
**Post date:** [January 2, 2021, 4:42pm UTC](https://discourse.slicer.org/t/error-with-calculation-image-difference-using-roi/15315/3 "2021-01-02T16:42:06Z")

</div>

Thank Andras for your response.

Usually is not necessary to harden the transform on the warped image since the warped image is already the result of the transformation. Nonetheless, I tried to do it and nothing changed.  
I also tried to convert the transformation into a vector volume node and then assign it the role as forward vector field. But I’m getting the same error even with a different ROI.

If I don’t use any ROI, the module calculates the difference between the two images correctly. Maybe the difference between the two images can not be calculated with ROI? or is it a bug?

Thanks,  
Mariana

---

<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:** [January 3, 2021, 7:32pm UTC](https://discourse.slicer.org/t/error-with-calculation-image-difference-using-roi/15315/4 "2021-01-03T19:32:34Z")

</div>

It seems that maintainer of this extension does not read the Slicer forum, so I would recommend to file an error report in the extension’s repository. If you don’t get any answer within 2 weeks then let us know.
