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

Issue with contrast-agnostic soft SC predictions #72

Open
naga-karthik opened this issue Dec 12, 2023 · 1 comment
Open

Issue with contrast-agnostic soft SC predictions #72

naga-karthik opened this issue Dec 12, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@naga-karthik
Copy link
Member

I was going through contrast-agnostic soft predictions on PSIR/STIR images along with @valosekj and found an issue with this line:

https://github.com/ivadomed/canproco/blob/7316f4cff9bac0c72f2db0582b091b2b319e32ac/segment_sc_contrast-agnostic/01_segment_sc_contrast-agnostic.sh#L181C12-L181C12

While it seems like this line adds 4 predictions (the original + 3 flipped), in reality it is indeed adding only 2 predictions. The max value of the soft prediction is 2 (see the picture below)

incorrect max value Screen Shot 2023-12-12 at 6 40 01 PM

I corrected this line locally using -add only once and the images to add in a list:

sct_maths -i sub-cal056_ses-M0_STIR_flip_x_pred_back.nii.gz -add sub-cal056_ses-M0_STIR_flip_y_pred_back.nii.gz sub-cal056_ses-M0_STIR_flip_z_pred_back.nii.gz sub-cal056_ses-M0_STIR_pred.nii.gz -o sub-cal056_ses-M0_STIR_pred_sum4.nii.gz

and got the following result:

correct max value Screen Shot 2023-12-12 at 6 42 05 PM

This error should not have affected an immediate results as these predictions were binarized here. However, these soft preds cannot be used for re-training the contrast-agnostic model with STIR/PSIR contrasts.

@valosekj
Copy link
Member

Yeah, sorry, my mistake. I should have used only a single -add. I do not know why I used -add three times.

@valosekj valosekj added the bug Something isn't working label Dec 12, 2023
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

No branches or pull requests

2 participants