# How to pass a specific label to LabelOverlapMeasuresImageFilter

**URL:** https://discourse.itk.org/t/how-to-pass-a-specific-label-to-labeloverlapmeasuresimagefilter/2300
**Category:** Beginner Questions
**Tags:** simpleitk
**Created:** [October 4, 2019, 2:22pm UTC](https://discourse.itk.org/t/how-to-pass-a-specific-label-to-labeloverlapmeasuresimagefilter/2300 "2019-10-04T14:22:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![TanjaIvanovska](https://discourse.itk.org/user_avatar/discourse.itk.org/tanjaivanovska/32/885_2.png) [@TanjaIvanovska](https://discourse.itk.org/u/TanjaIvanovska)
#### Post date: [October 4, 2019, 2:22pm UTC](https://discourse.itk.org/t/how-to-pass-a-specific-label-to-labeloverlapmeasuresimagefilter/2300/1 "2019-10-04T14:22:22Z")

</div>

Hi,  
i would like to get values of the overlap measures for specific labels in my masks, and not just the averaged values for all mask labels.  
In the original code of Nick Tustison that was possible, but i do not find how to get it in sitk.

Thank you and kind regards,  
Tanya

---

<div class="post-metadata">

### Author: ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)
#### Post date: [October 4, 2019, 6:16pm UTC](https://discourse.itk.org/t/how-to-pass-a-specific-label-to-labeloverlapmeasuresimagefilter/2300/2 "2019-10-04T18:16:01Z")

</div>

Hello @TanjaIvanovska,

This is a missing feature in SimpleITK, please [create an issue on github](https://github.com/SimpleITK/SimpleITK/issues).

As a temporary workaround the following should work:

```auto
#Assume we have label images with the following names
# reference_segmentation
# new_segmentation

label_list = [0,1,2]
def compute_overlap_measures(segmentation1, segmentation2, label):
    overlap_measures_filter = sitk.LabelOverlapMeasuresImageFilter()
    overlap_measures_filter.Execute(segmentation1==label, segmentation2==label)
    # List of all overlap measures we are interested in.
    return [overlap_measures_filter.GetDiceCoefficient(),
            overlap_measures_filter.GetFalseNegativeError(),
            overlap_measures_filter.GetFalsePositiveError()]

overlap_measures_per_label = [compute_overlap_measures(reference_segmentation, new_segmentation, label) for label in label_list]

```
