imglib / imglib2-roi

Regions of interest (ROIs) and labelings for ImgLib2
Other
8 stars 8 forks source link

Simplify quantification of overlapping labels #56

Closed imagejan closed 3 years ago

imagejan commented 4 years ago

This pull request adds an OverlappingLabels class that allows to quantify the overlap between all pairs of labels in a given ImgLabeling (by creating a confusion/co-occurrence matrix).

It makes use of FragmentProperties from LabelRegions, so we need to change the field visibility of indexToFragmentProperties to protected.

The test (OverlappingLabelsTest) illustrates the functionality, given the following test labeling:

1 1
2 123 1 3
3 3

The labels 1 and 3 overlap by 2 pixels.

The labels 2 and 3 overlap by 1 pixel, which corresponds to fractions of 0.5 (of label 2) and 0.25 (of label 3).

Let me know if this would be useful to have in imglib2-roi. I wasn't sure about the naming, so feel free to suggest changes.

imagesc-bot commented 4 years ago

This pull request has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/overlap-tracker-in-imagej/40711/3

tpietzsch commented 3 years ago

thanks!