# \[fixed\]Is hausdorff distance implement in SimpleITK aware of spacing?

**URL:** https://discourse.itk.org/t/fixed-is-hausdorff-distance-implement-in-simpleitk-aware-of-spacing/1830
**Category:** Beginner Questions
**Created:** [May 1, 2019, 3:01pm UTC](https://discourse.itk.org/t/fixed-is-hausdorff-distance-implement-in-simpleitk-aware-of-spacing/1830 "2019-05-01T15:01:16Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![hubutui](https://discourse.itk.org/user_avatar/discourse.itk.org/hubutui/32/716_2.png) [@hubutui](https://discourse.itk.org/u/hubutui)
#### Post date: [May 1, 2019, 3:01pm UTC](https://discourse.itk.org/t/fixed-is-hausdorff-distance-implement-in-simpleitk-aware-of-spacing/1830/1 "2019-05-01T15:01:16Z")

</div>

I check [https://itk.org/SimpleITKDoxygen/html/classitk\_1\_1simple\_1\_1HausdorffDistanceImageFilter.html](https://itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1HausdorffDistanceImageFilter.html), but still confused.

1. Is hausdorff distance implement in SimpleITK aware of spacing?
2. Does the HausdorffDistanceImageFilter assumes that args images are binary? 0 for background, 1 for foreground?

---

<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: [May 1, 2019, 3:12pm UTC](https://discourse.itk.org/t/fixed-is-hausdorff-distance-implement-in-simpleitk-aware-of-spacing/1830/2 "2019-05-01T15:12:14Z")

</div>

Hello hubutui!

- Yes, the filter is aware of image spacing. You can assume all SimpleITK or ITK algorithm are aware of Image spacing.
- The recommended [common convention](https://simpleitk.readthedocs.io/en/master/Documentation/docs/source/conventions.html) for SimpleITK is to represent masks with 0s for the background and 1s for the foreground. For this filter technically any non-zero value is foreground.

There’s a Jupyter notebook using the Hausdorff Distance for segmentations evaluation here:  
[http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python\_html/34\_Segmentation\_Evaluation.html](http://insightsoftwareconsortium.github.io/SimpleITK-Notebooks/Python_html/34_Segmentation_Evaluation.html)

Enjoy!
