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

Binary and softsegs produce the same registration results (is thresholding performed on the segmentation?) #4504

Closed
plbenveniste opened this issue May 31, 2024 · 1 comment
Assignees
Labels
bug category: fixes an error in the code sct_register_multimodal context:
Milestone

Comments

@plbenveniste
Copy link
Contributor

plbenveniste commented May 31, 2024

Opening this issue to investigate if there is a thresholding during image registration using algo=centermass.
The investigation comes from the fact that we saw that the registration output of a registration done using a soft SC seg and the output of the registration done using a binary SC seg are identical.

This is related to issue 91 and PR 95.

@joshuacwnewton joshuacwnewton self-assigned this Jun 3, 2024
@joshuacwnewton joshuacwnewton added this to the 6.4 milestone Jun 3, 2024
@joshuacwnewton joshuacwnewton added bug category: fixes an error in the code sct_register_multimodal context: labels Jun 3, 2024
@joshuacwnewton
Copy link
Member

joshuacwnewton commented Jun 19, 2024

It looks like there is a rounding step specifically for the PCA computation used by centermass and centermassrot here:

data2d = data2d.round().astype(int)

I think that this is essentially equivalent to binarizing the image at 0.5? (<=0.5 --> 0, >0.5 --> 1)

Note

It turns out that for sct_register_to_templtae, there is also another binarization step that gets performed on all segmentations (regardless of algo):

# binarize segmentation (in case it has values below 0 caused by manual editing)
printv('\nBinarize segmentation', verbose)
ftmp_seg_, ftmp_seg = ftmp_seg, add_suffix(ftmp_seg, "_bin")
img = Image(ftmp_seg_)
out = img.copy()
out.data = binarize(out.data, 0.5)
out.save(path=ftmp_seg)

But this does not occur for sct_register_multimodal.

If you have any other questions, feel free to ask! :)

@joshuacwnewton joshuacwnewton changed the title Thresholding during image registration Binary and softsegs produce the same registration results (is thresholding performed on the segmentation?) Jun 19, 2024
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 sct_register_multimodal context:
Projects
None yet
Development

No branches or pull requests

2 participants