# Mismatch in volume size of same segmentation

**URL:** <https://discourse.slicer.org/t/mismatch-in-volume-size-of-same-segmentation/25567>\
**Category:** Support\
**Tags:** registration, segmentation, 3d-model\
**Created:** [October 5, 2022, 11:20pm UTC](https://discourse.slicer.org/t/mismatch-in-volume-size-of-same-segmentation/25567 "2022-10-05T23:20:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Young\_Wang](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/young_wang/32/13926_2.png) [@Young\_Wang](https://discourse.slicer.org/u/Young_Wang)\
**Post date:** [October 5, 2022, 11:20pm UTC](https://discourse.slicer.org/t/mismatch-in-volume-size-of-same-segmentation/25567/1 "2022-10-05T23:20:07Z")

</div>

Hi there,

I’m working on a registration-related project. While I was working on this project, I noticed something interesting after performing the following steps:

1. created a segmentation from one volume
2. shifted the original volume via a linear transformation
3. created a second segmentation from the transformed volume
4. performed segment comparison

I noticed that the reference volume and the compare volumes are different in size under the Dice similarity metrics. I wonder if I misunderstood how to use the segment comparison module or if there is a bug that needs to be addressed.

I attached a screenshot of what I have just described and a screenshot. I can send you a copy of what I did(I tried to include the source file here but I can’t upload it from here)  
Thanks in advance for your help.

 ![Screen Shot 2022-10-05 at 20.06.43](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/3/33cd5b4b8cab3306ca5802249ee14814b774da03.jpeg)

---

<div class="post-metadata">

**Author:** ![ebrahim](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ebrahim/32/13403_2.png) [@ebrahim](https://discourse.slicer.org/u/ebrahim)\
**Post date:** [October 6, 2022, 1:02pm UTC](https://discourse.slicer.org/t/mismatch-in-volume-size-of-same-segmentation/25567/2 "2022-10-06T13:02:36Z")

</div>

Could the difference be due to the discrete regular grid?

Depending on your policy for when to include or exclude voxels that are only partially in the target region, segmentation might not commute with rigid rotation. Exaggerated example rotating a square and getting larger segmentation:

![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/1/3170f6875516594ad7ecce0e1212cd1fb4177e39.png)

---

<div class="post-metadata">

**Author:** ![Young\_Wang](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/young_wang/32/13926_2.png) [@Young\_Wang](https://discourse.slicer.org/u/Young_Wang)\
**Post date:** [October 7, 2022, 7:31pm UTC](https://discourse.slicer.org/t/mismatch-in-volume-size-of-same-segmentation/25567/3 "2022-10-07T19:31:45Z")

</div>

@ebrahim thank you for your reply. I found out the issue by doing the following:

1. created a segmentation from one volume
2. clone the original volume
3. shifted the cloned volume via a linear transformation
4. created a second segmentation from the cloned volume
5. performed segment comparison

With that change, the reference volume and the compare volume now have the same size.
