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

sct_register_to_template: Fixed wrong projection in case labels not in same space #1978

Merged
merged 4 commits into from
Aug 15, 2018

Conversation

jcohenadad
Copy link
Member

Description

In sct_register_to_template.project_labels_on_spinalcord(), the labels are re-oriented to RPI, which can cause bugs in case labels (i) are not in the same voxel space as the input segmentation and (ii) are not RPI. In fact, labels should not be re-oriented, because their coordinates are transformed into physical coordinates.

The implemented fix consisted in removing the re-orientation of labels before projecting them onto the cord centerline.

Fixes #1977

@jcohenadad jcohenadad added bug category: fixes an error in the code sct_register_to_template context: labels Aug 2, 2018
@jcohenadad jcohenadad added this to the v3.2.4 milestone Aug 2, 2018
@jcohenadad jcohenadad self-assigned this Aug 2, 2018
zougloub added a commit that referenced this pull request Aug 2, 2018
zougloub
zougloub previously approved these changes Aug 2, 2018
Copy link
Contributor

@zougloub zougloub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK.

@zougloub zougloub dismissed their stale review August 2, 2018 03:19

realized Travis failed and other

@jcohenadad
Copy link
Member Author

jcohenadad commented Aug 6, 2018

currently breaking because of project_labels_on_spinalcord(). Working on it...

UPDATE 2018-08-06 16.54: I was doing something wrong for the fix. Both the segmentation and the labels need to be re-oriented to RPI. Now checking why this has caused an issue in the particular scan.

UPDATE 2018-08-06 17.33: Nevermind my previous update: i was doing something right, but because of some bugs related to set_orient(), I got wrong results. So: the proposed fix (i.e. do not reorient labels to RPI and work with physical coordinates) should work. The reason it does not work is because sct_image.setorient() sometimes corrupts the physical coordinates of the output images. This is likely related to #1944, hence it would probably be wise to wait until issues with setorient are fixed before moving forward with the present issue.

@zougloub zougloub merged commit aa04bb0 into master Aug 15, 2018
@zougloub zougloub deleted the jca/1977-reg2template-label-projection branch August 15, 2018 02:37
jcohenadad pushed a commit that referenced this pull request Dec 18, 2019
…rojection

sct_register_to_template: Fixed wrong projection in case labels not in same space

Former-commit-id: aa04bb0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug category: fixes an error in the code priority:HIGH sct_register_to_template context:
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sct_register_to_template: Wrong projection of labels onto centerline is labels are not in the same space
2 participants