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

Is dilation necessary at inference time? #44

Open
jcohenadad opened this issue Jan 26, 2022 · 3 comments
Open

Is dilation necessary at inference time? #44

jcohenadad opened this issue Jan 26, 2022 · 3 comments
Assignees

Comments

@jcohenadad
Copy link
Member

Dilation adds a line of code for users, so it would be nice if this step was not necessary. See e.g. this tutorial for using the new models: spinalcordtoolbox/spinalcordtoolbox#3637 (comment)

I've tried without and with dilation (ball=5) in one subject (P007), and results are slightly different, but a more systematic comparison should be done in order to advise on the best course of action.

@uzaymacar do you have any suggestions/insights? I'm thinking that maybe in the future we could also train without dilation (I don't think it is really necessary because the SC will always be included in the cropped image, even without dilation).

@joshuacwnewton
Copy link
Member

Dilation adds a line of code for users, so it would be nice if this step was not necessary. See e.g. this tutorial for using the new models: spinalcordtoolbox/spinalcordtoolbox#3637 (comment)

Perhaps I'm missing something, but I don't see a dilation step in the linked comment. Could you clarify what you mean by "line of code for our users"?

@jcohenadad
Copy link
Member Author

Sorry for the lack of clarity. Indeed, the link to spinalcordtoolbox#3637 did not include the dilation step, which is precisely the point of this issue.

By default, dilation is performed during preprocessing, before training the model:

sct_maths -i ${file_seg}.nii.gz -dilate 5 -shape ball -o ${file_seg}_dilate.nii.gz

And my suggestion would be to get rid of this dilation step.

@uzaymacar
Copy link
Contributor

I saw dilation as an non-vital, extra preprocessing step to make sure we capture the ROI during inference and model development. For example, I would expect it to be helpful in cases where lesions are near the boundaries of the SC mask.

That being said, the following next steps can help us decide whether or not we can remove the dilation step safely:

  • Inference-time: Compare lesion segmentation results with and without dilation on all test subjects (extend @jcohenadad's work)
  • Training-time: Train SC segmentation without dilation, then train lesion segmentation on top of the new SC-cropped images, and compare lesion segmentation results to before

@uzaymacar uzaymacar self-assigned this Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants