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

minor fix to template shape injection #119

Merged
merged 1 commit into from
Dec 4, 2021
Merged

minor fix to template shape injection #119

merged 1 commit into from
Dec 4, 2021

Conversation

akhanf
Copy link
Member

@akhanf akhanf commented Dec 1, 2021

This fixes a minor bug in template shape injection. The nnunet segmentation is split into channels, and those channels are used for registration when doing template injection. The segmentation labels we retain are specified in a config (e.g. to skip the cyst label, 7). The bug is that the code was assuming the channel indices in the split images (i.e.. label_##.nii.gz) were as they are in that config list (ie. 1-6,8) but the splitting process always writes them as 1-N (where N is the number of labels retained). So it ended up looking for label 8 instead of label 7, which is always missing, so the dentate doesn't end up getting used in the registration.

I think this is a pretty minor fix that probably won't change the resulting segmentation that much (since adding one channel to the multi-channel registration isn't going to have a huge effect). The nice thing is we won't see the warning message that label_08 doesn't exist anymore (which was what caught my attention in the first place)..

Was leaving out DG from template injection registration inadvertently, since split labels are always mapped to 1 to N.
@akhanf akhanf requested a review from jordandekraker December 1, 2021 00:51
@akhanf akhanf added the bug Something isn't working label Dec 1, 2021
Copy link
Collaborator

@jordandekraker jordandekraker left a comment

Choose a reason for hiding this comment

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

Good find on this oversight!

@akhanf akhanf merged commit 8f7f96a into master Dec 4, 2021
@akhanf akhanf deleted the fix_shapeinject branch December 4, 2021 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants