# New to ITK - moving from ImageJ macros - SimpleITK arithmetic Q

**URL:** <https://discourse.itk.org/t/new-to-itk-moving-from-imagej-macros-simpleitk-arithmetic-q/2101>\
**Category:** Beginner Questions\
**Tags:** simpleitk\
**Created:** [July 27, 2019, 7:59pm UTC](https://discourse.itk.org/t/new-to-itk-moving-from-imagej-macros-simpleitk-arithmetic-q/2101 "2019-07-27T19:59:09Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![richardM](https://discourse.itk.org/letter_avatar_proxy/v4/letter/r/ea666f/32.png) [@richardM](https://discourse.itk.org/u/richardM)\
**Post date:** [July 29, 2019, 3:50pm UTC](https://discourse.itk.org/t/new-to-itk-moving-from-imagej-macros-simpleitk-arithmetic-q/2101/5 "2019-07-29T15:50:10Z")

</div>

Thanks for the reply Dženan,

When I take a single image and translate/rotate a copy, then run registration, the mean square reported goes from a high at the start of 650,000 to a fitted value of 300,000. You can see this in the images below, showing the metric as well as the fitted image overlaid the “original”.

**So these images are identical - except for translation/rotation**. So I would expect that a mean squares metric would be essentially zero. (assuming its a mean squared difference that’s being reported).

I tried setting the translation to only (2,2) and rotation to only 2 degrees, and even in that case the metric returned is still ~300,000 when fitted.

These images are 512x512 originally int32’s with a value range ~ -3000-3000. In the example below the 2nd image is a translation by (10,10) and rotation of 25 degrees.

The only reason I can think it isn’t, is that the metric is being calculated without a mask to make sure to only to take values from where the images overlap. But even then, I made sure I moved the minimum of each image to 0 prior to registration, so that if it was doing that, and using a default value of 0 for any undefined points, it wouldn’t affect the result

![Unknown](https://discourse.itk.org/uploads/default/original/1X/302edc99087744c3052d1d7738fa402708b85e26.png) ![Unknown-2](https://discourse.itk.org/uploads/default/original/1X/42a47ff826f9e2c1d6014608080bc05be3a9a251.png)

 ![Unknown-3](https://discourse.itk.org/uploads/default/original/1X/0c95c20b0254430ef50253ffc6acc8e0ee324921.png)

---

_[View the full topic](https://discourse.itk.org/t/new-to-itk-moving-from-imagej-macros-simpleitk-arithmetic-q/2101)._
