sct-pipeline / contrast-agnostic-softseg-spinalcord

Contrast-agnostic spinal cord segmentation project with softseg
MIT License
4 stars 3 forks source link

Revise CenterCrop #41

Closed jcohenadad closed 11 months ago

jcohenadad commented 1 year ago

The CenterCrop might be problematic for datasets where:

Suggestions:

jcohenadad commented 1 year ago

@ebadrian @louisfb01 pls see how this was done for sct_deepseg_sc and sct_deepseg_gm -- document everything you find (link to training script, preprocessing, etc)

EDIT 20230116_122839: sct_deepsegsc first finds the centerline and then extract patches, on a slice-by-slice basis, around that centerline. See [code](https://github.com/spinalcordtoolbox/spinalcordtoolbox/blob/master/spinalcordtoolbox/deepseg/sc.py). Also same idea as in https://github.com/ivadomed/ivadomed/issues/1259#issuecomment-1371528151

ebadrian commented 1 year ago

@louisfb01 @jcohenadad Here are the script lines related to the cropping strategy for the different version of sct_deepseg:

naga-karthik commented 11 months ago

Based on the current version of the model, here are the updates:

For updated dataset, find max(Z)-- or maybe not required because at inference, the CenterCrop parameter can be removed (to make sure the ENTIRE image is segmented)

Yes, for inference, we're currently leaving the Z to be -1 meaning that the model takes the original size in the S-I dim. (whatever it might be). Removing CenterCrop did not result as good results as the one with cropping. The errors were mainly spurious segmentations outsdie the SC (which can be removed in postprocessing)

Based on these (final) updates, closing this issue