Segment comparison module (Dice and Hausdorff) - but with markup points

Hi,

I want to evaluate segmentation by comparing them to markup points.
I would be interested in the Dice metrics; however, the only module I found with Dice is the segment comparison which works only with segments.
I tried a few ways to solve the problem, my ideas were to mask a volume or segmentation with the points or create new segmentations from the points, but they all failed.
If someone can give me a solution to create small uniform dots for each of the points in a node, that would solve my problem.

Thank you!

After a few re-reads of your description it is not clear to me how would you compare segmentation to markups (image to points basically).

How are these markup points placed? Are they marking the edge of the object? If you use the Surface cut effect in Segment Editor (you may need to install the SegmentEditorExtraEffects extension), does it help?

Dear Csaba,

Thank you for your reply.
I would like to compare left atrium electroanatomic maps to segmentations I made from MRI images.
The electroanatomic maps from Carto arrive in a .txt format, which can be imported to slicer as markup points (Or at least I could only import them that way).
In this other thread, we discussed about it with @lassoan and @stephan. That’s my other challenge, but the data is the same.
I would like to convert the points to segments/models to be able to get the Dice and Hausdorff metrics. By this I mean converting each point in a markup node to a segment that has small uniform volumes, like 1 mm wide spheres for each point so I can run the Segment Comparison module to calculate Hausdorff distances and Slice metrics.
The markup points basically the raw data of the electroanatomic map, however I filtered them based on bipolar value, to create two sets of points: scarred and not scarred regions.
I know I can recreate the approximation of the map by using the MarkupsToModel module, but it would just give me two slightly different shape, that won’t correspond to the atrium wall.
On the screenshots, I tried to show the wall segmentation and the points that I’d like to compare.

Screenshot 2021-10-28 at 9.38.31
Screenshot 2021-10-28 at 9.38.51

I think your best bet is still the MarkupsToModel approach, then importing that model into a segmentation (right-click model in Data module), then use the Segment Comparison module to compute the values you need.

If you read about how Dice and Hausdorff works (I think you should), then you’ll see that Dice works on volumes. Also Dice performs very poorly on data that consists of thin or elaborately shaped objects, and your small sphere approach fits this category fully, so Dice will give you values that cannot be interpreted well. For a simple maximum Hausdorff distance you don’t actually need volumes, you can just compare the two sets of points. It is quite easy to do with a short Python script.