# Hurry! Some problems about similarity measurement.

**URL:** <https://discourse.itk.org/t/hurry-some-problems-about-similarity-measurement/6011>\
**Category:** Uncategorized\
**Created:** [June 23, 2023, 9:57am UTC](https://discourse.itk.org/t/hurry-some-problems-about-similarity-measurement/6011 "2023-06-23T09:57:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ljjiayou](https://discourse.itk.org/user_avatar/discourse.itk.org/ljjiayou/32/3211_2.png) [@ljjiayou](https://discourse.itk.org/u/ljjiayou)\
**Post date:** [June 23, 2023, 9:57am UTC](https://discourse.itk.org/t/hurry-some-problems-about-similarity-measurement/6011/1 "2023-06-23T09:57:51Z")

</div>

1. I am doing a task, which is to rotate the reference image and the registered image to observe the change of the evaluation index. Is there any relevant code? I also need to observe different evaluation indicators. What are the evaluation indicators in SimpleITK? Are there MIND and LNCC and NMI?
2. I also want to know how to calculate the similarity index of two images directly without the need for registration.
3. I also need to use different evaluation indicators for image registration. If some evaluation indicators are not available, how can I add them to the registration framework.  
Please help me, thank you

---

<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:** [June 23, 2023, 3:22pm UTC](https://discourse.itk.org/t/hurry-some-problems-about-similarity-measurement/6011/2 "2023-06-23T15:22:07Z")

</div>

This [example](https://examples.itk.org/src/registration/common/computemeansquarebetweentwoimages/documentation) shows how to compute mean squares metric between two images without registering them.

---

<div class="post-metadata">

**Author:** ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)\
**Post date:** [June 23, 2023, 3:34pm UTC](https://discourse.itk.org/t/hurry-some-problems-about-similarity-measurement/6011/3 "2023-06-23T15:34:59Z")

</div>

> [@ljjiayou](#):
>
> to use different evaluation indicators for image registration. If some evaluation indicators are not available, how can I add them to the registration framework.  
> Please help me, thank you

You may find this SimpleITK Notebooks usage of [ImageRegistrationMethod:MetricEvaluate](https://simpleitk.org/doxygen/latest/html/classitk_1_1simple_1_1ImageRegistrationMethod.html#a9b1f96dc287a747c1705f8185f5abe0a) useful: [63\_Registration\_Initialization](http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python_html/63_Registration_Initialization.html#Register-using-sampling-of-the-parameter-space)

---

<div class="post-metadata">

**Author:** ![ljjiayou](https://discourse.itk.org/user_avatar/discourse.itk.org/ljjiayou/32/3211_2.png) [@ljjiayou](https://discourse.itk.org/u/ljjiayou)\
**Post date:** [June 24, 2023, 9:33am UTC](https://discourse.itk.org/t/hurry-some-problems-about-similarity-measurement/6011/4 "2023-06-24T09:33:05Z")

</div>

thanks

---

<div class="post-metadata">

**Author:** ![ljjiayou](https://discourse.itk.org/user_avatar/discourse.itk.org/ljjiayou/32/3211_2.png) [@ljjiayou](https://discourse.itk.org/u/ljjiayou)\
**Post date:** [June 24, 2023, 9:33am UTC](https://discourse.itk.org/t/hurry-some-problems-about-similarity-measurement/6011/5 "2023-06-24T09:33:43Z")

</div>

Thanks, but I’d like to know how to wrap my own loss function into simpleitk for registration. I’ve read the documentation but still don’t know how to solve it.Do you know what to do?

---

<div class="post-metadata">

**Author:** ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)\
**Post date:** [June 24, 2023, 6:52pm UTC](https://discourse.itk.org/t/hurry-some-problems-about-similarity-measurement/6011/6 "2023-06-24T18:52:44Z")

</div>

Hello @ljjiayou,

Please see [this discussion](https://discourse.itk.org/t/3d-multi-modal-medical-image-registration-using-user-defined-function-for-similarity-metric-computation/5064) which describes how to add a custom similarity (loss function) into ITK and then expose it in SimpleITK.

---

<div class="post-metadata">

**Author:** ![ljjiayou](https://discourse.itk.org/user_avatar/discourse.itk.org/ljjiayou/32/3211_2.png) [@ljjiayou](https://discourse.itk.org/u/ljjiayou)\
**Post date:** [June 25, 2023, 7:12am UTC](https://discourse.itk.org/t/hurry-some-problems-about-similarity-measurement/6011/7 "2023-06-25T07:12:09Z")

</div>

Thank you very much
