# DICE + HD for 5 models

**URL:** https://discourse.slicer.org/t/dice-hd-for-5-models/26263
**Category:** Support
**Tags:** segmentation
**Created:** [November 16, 2022, 4:50pm UTC](https://discourse.slicer.org/t/dice-hd-for-5-models/26263 "2022-11-16T16:50:10Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![SlicerBP](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@SlicerBP](https://discourse.slicer.org/u/SlicerBP)
#### Post date: [November 16, 2022, 4:50pm UTC](https://discourse.slicer.org/t/dice-hd-for-5-models/26263/1 "2022-11-16T16:50:10Z")

</div>

Dear Community,

how can I calculate the HD and DICE for 5 segmented models. As a comparison, the average model of all 5 models should be used as a basis.

Thank you very much!  
BP

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [December 1, 2022, 7:14am UTC](https://discourse.slicer.org/t/dice-hd-for-5-models/26263/2 "2022-12-01T07:14:46Z")

</div>

You can use Segment Comparison module of SlicerRT extension.

---

<div class="post-metadata">

### Author: ![SlicerBP](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@SlicerBP](https://discourse.slicer.org/u/SlicerBP)
#### Post date: [December 4, 2022, 3:50pm UTC](https://discourse.slicer.org/t/dice-hd-for-5-models/26263/3 "2022-12-04T15:50:51Z")

</div>

Thanks, but this only works if you want to compare 2 models. As soon as you want to compare more than 2 models

Best regards  
BP

---

<div class="post-metadata">

### Author: ![gcsharp](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gcsharp/32/863_2.png) [@gcsharp](https://discourse.slicer.org/u/gcsharp)
#### Post date: [December 5, 2022, 6:23pm UTC](https://discourse.slicer.org/t/dice-hd-for-5-models/26263/4 "2022-12-05T18:23:50Z")

</div>

Why not take the average (or median, or max) of all pair-wise results?

---

<div class="post-metadata">

### Author: ![SlicerBP](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@SlicerBP](https://discourse.slicer.org/u/SlicerBP)
#### Post date: [December 7, 2022, 5:07pm UTC](https://discourse.slicer.org/t/dice-hd-for-5-models/26263/5 "2022-12-07T17:07:27Z")

</div>

Thank you! That’s a good idea. I did that 🙂 But the question is, what could be applied as ground truth. There is the method according to RCA, however I would like to set a simpler solution.

You can’t form a median between segmentations, can you? A function with the logical operation “median” does not exist or?

---

<div class="post-metadata">

### Author: ![gcsharp](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gcsharp/32/863_2.png) [@gcsharp](https://discourse.slicer.org/u/gcsharp)
#### Post date: [December 7, 2022, 9:11pm UTC](https://discourse.slicer.org/t/dice-hd-for-5-models/26263/6 "2022-12-07T21:11:29Z")

</div>

There are a few ways to do it. The easiest is majority voting. So if a voxel is inside 3 of 5 segmentations, it is part of the consensus. I think you would need to use python for this.
