# Image Registration of binary images

**URL:** <https://discourse.itk.org/t/image-registration-of-binary-images/2911>\
**Category:** Algorithms\
**Created:** [April 8, 2020, 11:13am UTC](https://discourse.itk.org/t/image-registration-of-binary-images/2911 "2020-04-08T11:13:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felippe\_Trigueiro\_An](https://discourse.itk.org/user_avatar/discourse.itk.org/felippe_trigueiro_an/32/1015_2.png) [@Felippe\_Trigueiro\_An](https://discourse.itk.org/u/Felippe_Trigueiro_An)\
**Post date:** [April 8, 2020, 11:13am UTC](https://discourse.itk.org/t/image-registration-of-binary-images/2911/1 "2020-04-08T11:13:43Z")

</div>

HI guys, I’d like to register two binary brain images. I tried to use the MSE, correlation and MI in the SimpleITK but the result was not so good, so what metric do you suggest? I think that I need a metric which compares binary images, but what? And is It possible to add a new metric for the registration process in the SimpleITK?

Thanks.

---

<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:** [April 8, 2020, 12:23pm UTC](https://discourse.itk.org/t/image-registration-of-binary-images/2911/2 "2020-04-08T12:23:25Z")

</div>

Similarity metric for binary images and label maps is called Match Cardinality in ITK. You could use that, or compute [signed distance field](https://itk.org/Doxygen/html/classitk_1_1SignedMaurerDistanceMapImageFilter.html) of both images and register SDFs using MSE.

---

<div class="post-metadata">

**Author:** ![guo7212](https://discourse.itk.org/letter_avatar_proxy/v4/letter/g/7ab992/32.png) [@guo7212](https://discourse.itk.org/u/guo7212)\
**Post date:** [November 3, 2021, 2:01am UTC](https://discourse.itk.org/t/image-registration-of-binary-images/2911/3 "2021-11-03T02:01:23Z")

</div>

Could someone explain the math behind Match Cardinality in ITK?

---

<div class="post-metadata">

**Author:** ![guo7212](https://discourse.itk.org/letter_avatar_proxy/v4/letter/g/7ab992/32.png) [@guo7212](https://discourse.itk.org/u/guo7212)\
**Post date:** [November 3, 2021, 6:28am UTC](https://discourse.itk.org/t/image-registration-of-binary-images/2911/4 "2021-11-03T06:28:52Z")

</div>

I read the source code, and I found it was easy.
