Image segmentation evaluation

I am working on image segmentation. To evaluate my model I am using Hausdorff distance. When I use my binary masks as type double it gives my very large value of Hausdorff distance around 3000, but when I change data type as logical it gives values around 7 or 8.
Can anyone guide me why there is such a big difference and which data type I must use to evaluate the model?

Hello mshoaib,
The difference in the distance measured is because of the data type you originally use and/or the image size change (if any) after the logical conversion.
Check the image sizes, they should be of the same size and then the data type.
If you are using ImageJ/Fiji then 8 bit binary would be the best bet.

I am using python Scipy to calculate the distance. The image size is same for all data types. Now I am worried that if I have to mention Hausdorff value of my model which value should I use? As I have two different values one form double data type and one from logical data type.

Hello again mshoaib,
As long as you also mention ‘which’ data type you are using it will make no difference. Use the one that sounds the most impressive. It is the actual pixel to pixel size similarity that gets measured.
Great work.

OK thanks a lot Bob.

There are several ways to do this. Commonly used ones are the

and the

1 Like

How can I convert my Hausdorff distance value to HD value in millimeters?

Hello mshoaib,
Go to Analyze > Calibrate and set your perimeters. just remember to switch back when you are through obtaining data unless you will always use these settings.

I am using Scipy in python to calculate the HD value. Are you talking about ImageJ/Fiji to go to analyze???

Hello once again mshoaib,
Yes I am, yet Scipy should have a way to do so also. I cannot give a better explaination unless I can know the form your data is being output. It is a simple conversion and could be done with many things.

Thanks a lot Bob. I will search how to calculate in mm using Scipy. Will come to you again If I have any question :blush: