Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Segment statistics ignores parent transform #4942

Closed
lassoan opened this issue May 28, 2020 · 3 comments · Fixed by #5060
Closed

Segment statistics ignores parent transform #4942

lassoan opened this issue May 28, 2020 · 3 comments · Fixed by #5060
Assignees
Labels
Type: Bug Something isn't working correctly
Milestone

Comments

@lassoan
Copy link
Contributor

lassoan commented May 28, 2020

Segment statistics module silently ignores parent transform, which may lead to unexpected results.

This could be fixed by cloning segmentation to a temporary node, hardening the transform, and computing everything on that.

Transformation of master volume should be taken into account, too (but probably that is done already).

@lassoan lassoan added the Type: Bug Something isn't working correctly label May 28, 2020
@lassoan lassoan added this to the Slicer 4.11.0 milestone May 28, 2020
@Sunderlandkyl
Copy link
Member

Sunderlandkyl commented May 28, 2020

Which statistics are ignoring the parent transform?

As far as I can tell, the relevant labelmap and scalar volume statistics take the parent transform into account,

@lassoan
Copy link
Contributor Author

lassoan commented May 28, 2020

Labelmap statistics without scalar volume, with the new metrics. See for example this scene, which contains a sphere drawn over MRHead that is somewhat flattened with a linear transform:

https://1drv.ms/u/s!Arm_AFxB9yqHu5s6KPuhhzm-pJgSig?e=ypUKj3

Roundness should be well below 1.0.

If I harden the transform then I get quite strange results (roundness > 1.1).

If I resample the segmentation to be isotropic (change segmentation geometry, force isotropic) then I finally get reasonable results (roundness well below 1).

@Sunderlandkyl
Copy link
Member

Ah, I see! I was only thinking of the statistics with obvious RAS coordinates (centroid, OBB, etc.).

Sunderlandkyl added a commit to Sunderlandkyl/Slicer that referenced this issue Jul 24, 2020
In order to ensure that the segment statistics are calculated in world coordinates, the segmentation is duplicated to a temporary segmentation node and the transform is hardened.

fixes Slicer#4942
Sunderlandkyl added a commit to Sunderlandkyl/Slicer that referenced this issue Jul 27, 2020
In order to ensure that the segment statistics are calculated in world coordinates, the segmentation is duplicated to a temporary segmentation node and the transform is hardened.

fixes Slicer#4942
Sunderlandkyl added a commit to Sunderlandkyl/Slicer that referenced this issue Jul 27, 2020
In order to ensure that the segment statistics are calculated in world coordinates, the segmentation is duplicated to a temporary segmentation node and the transform is hardened.

fixes Slicer#4942
Sunderlandkyl added a commit that referenced this issue Jul 27, 2020
In order to ensure that the segment statistics are calculated in world coordinates, the segmentation is duplicated to a temporary segmentation node and the transform is hardened.

fixes #4942
adamrankin pushed a commit to adamrankin/Slicer that referenced this issue Jul 28, 2020
In order to ensure that the segment statistics are calculated in world coordinates, the segmentation is duplicated to a temporary segmentation node and the transform is hardened.

fixes Slicer#4942
adamrankin pushed a commit to adamrankin/Slicer that referenced this issue Jul 28, 2020
In order to ensure that the segment statistics are calculated in world coordinates, the segmentation is duplicated to a temporary segmentation node and the transform is hardened.

fixes Slicer#4942
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working correctly
Development

Successfully merging a pull request may close this issue.

2 participants