# Doubts about evaluating metric

**URL:** https://discourse.itk.org/t/doubts-about-evaluating-metric/3400
**Category:** Beginner Questions
**Tags:** simpleitk, registration, python
**Created:** [August 19, 2020, 4:00am UTC](https://discourse.itk.org/t/doubts-about-evaluating-metric/3400 "2020-08-19T04:00:05Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![TJH123456](https://discourse.itk.org/user_avatar/discourse.itk.org/tjh123456/32/1654_2.png) [@TJH123456](https://discourse.itk.org/u/TJH123456)
#### Post date: [August 19, 2020, 4:00am UTC](https://discourse.itk.org/t/doubts-about-evaluating-metric/3400/1 "2020-08-19T04:00:05Z")

</div>

Hello

I have a very confused question. When calculating the similarity of two identical images, the value obtained should be 1 or greater than 1 (because I don’t know whether the value is normalized or not), but a very strange problem arises. The value obtained is more than - 0.8. There are two problems: (1) the problem of negative value. I have consulted the documents and papers, and understand that it is caused by the definition. (2) If the value is more than 0.8, I don’t know how to understand it. The metric I use is “jointhistogrammutualinformation”.

And when I rotate the registered floating image 1 ° in one direction (or 1 mm translation), I find that the calculated value is better than the registered value. Is this the problem of registration algorithm?

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [August 19, 2020, 12:28pm UTC](https://discourse.itk.org/t/doubts-about-evaluating-metric/3400/2 "2020-08-19T12:28:26Z")

</div>

The registration framework is set up to always minimize the metric (think mean square error), so mutual information metrics report negative values (the more negative, the better).

---

<div class="post-metadata">

### Author: ![TJH123456](https://discourse.itk.org/user_avatar/discourse.itk.org/tjh123456/32/1654_2.png) [@TJH123456](https://discourse.itk.org/u/TJH123456)
#### Post date: [August 19, 2020, 2:12pm UTC](https://discourse.itk.org/t/doubts-about-evaluating-metric/3400/3 "2020-08-19T14:12:23Z")

</div>

Thank you for your answer.  
I understand that mutual information value is negative in simpleitk. The smaller the value, the better.

But what I don’t understand is: (1) the parameters after registration are optimized, which should be the best in theory, right? But when I add 1 ° or 1 mm to this parameter, the result is better, which puzzles me. (2) When I use “join this diagram information”, I use two identical graphs to measure the similarity without registration. I don’t know if the value is normalized, so the value should be no more than - 1, but the result is not, the value is - 0.8.

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [August 19, 2020, 2:16pm UTC](https://discourse.itk.org/t/doubts-about-evaluating-metric/3400/4 "2020-08-19T14:16:39Z")

</div>

Value -0.8 is worse than -1.0, because less is better, and -1.0\<-0.8. I guess that MI’s range is [-1.0, 0.0].

---

<div class="post-metadata">

### Author: ![TJH123456](https://discourse.itk.org/user_avatar/discourse.itk.org/tjh123456/32/1654_2.png) [@TJH123456](https://discourse.itk.org/u/TJH123456)
#### Post date: [August 19, 2020, 2:24pm UTC](https://discourse.itk.org/t/doubts-about-evaluating-metric/3400/5 "2020-08-19T14:24:29Z")

</div>

Yes, that’s right.But the graphs I used are the same, so I think the value is - 1, not - 0.8 .(use your range [- 1,0])
