HausdorffDistance on an image with multiple Labels

I’m evaluating the predictions of a lung lobe segmentation model using the HausdorffDistanceImageFilter.
Thus, I’m passing the ground truth and the prediction (both have equal size with 6 labels) into the image filter.

I’m a bit puzzled about the result, that is the results make sense that worse models have a higher distance and better models have a smaller distance. But I’m a bit puzzled about the unit of the results and how multiple labels change the results.
In the documentation, I only find the explanation for sets.

Additionally, what’s the difference between GetHausdorffDistance and GetAverageHausdorffDistance?

Looking at the code explains it:

Average is distance average for all pixels, HausdorffDistance is maximum distance among all pixels.

Thanks a lot!

Can you also explain how this works with multiple labels? Is each label considered as a set and then the hausdorff distance is calculated for the given images per label/set and then the maximum of those is returned?

From the documentation, I understood that all non-zero pixels are considered to belong to the same label. So if you want per label measures, you would use threshold filter to extract the appropriate label before measuring distance.

Thanks again. Do you know if this happens for the dice coefficient calculation as well?

LabelOverlapMeasuresImageFilter seems to treat the different labels separately.