ivadomed / canproco

Code for preprocessing the CanProCo brain and spinal cord dataset
MIT License
4 stars 1 forks source link

How are segmentations and labels manually corrected? #92

Open jcohenadad opened 4 months ago

jcohenadad commented 4 months ago

@leelisae while working on #91 I was wondering, after you run the processing on a subject and you do the QC, if you notice issues with the segmentation, where is the manually corrected segmentation or mask stored? The storage location of derivative is important as it should be considered by the analysis script, such that, if it exists, instead of re-running the segmentation the code would instead use the manually corrected segmentation/label (as done, e.g., in this other project: https://github.com/sct-pipeline/spine-park).

leelisae commented 4 months ago

@jcohenadad - The example data I shared via Dropbox passed QC (C2-C4 is the region of my interest).

However, with the CanProCo dataset, I noticed frequent QC failures, primarily related to vertebral labeling and/or registration, and in rare instances, segmentation. I approached each QC failure case-by-case, experimenting to find the most effective solution.

For example, while I initially preferred manual initialization for vertebral labeling corrections, I often found this insufficient, requiring me to manually place the labels entered in the SC. For registration, I’d adjust parameters (based on your previous guidance too), but occasionally had to resort to segmentation-based registration.

I replaced the filenames of the original QC-failed outputs with corrected versions and re-ran the rest of the code. I now understand that there are more sophisticated methods available, but given my limited scripting knowledge and storage capacity (I was provided only a MacBook and external hard drive), this approach seemed practical at the time.

Currently, I have several upcoming deadlines. However, I’m open to modifying the analysis script in the future to be more sophisticated, if needed. Thank you!

jcohenadad commented 4 months ago

Thank you for providing additional context @leelisae, I understand better how the pipeline was run now. So, unfortunately, it means that your analysis pipeline is not reproducible then (if it involved manually tweaking syntaxes and manually replacing file names). In the future we should absolutely make sure the entire processing pipeline is reproducible.

given my limited [...] storage capacity

The derivatives only takes a few kB (these are compressed binary files), so that's not an issue.

So, moving forward with #91, I hope that the additional code in the spine.sh file will work for all subjects, given that, as I understand, not all subjects were processed the same way (hence, a single generic script, without derivatives, will not suffice).

leelisae commented 4 months ago

@jcohenadad - Thank you & I hope you had a lovely long weekend!

I don't see the additional code on my end in the spine.sh. How can I see what you've refined like in this commit on pull request #90? Or is there another way to see your edits?

jcohenadad commented 4 months ago

I don't see the additional code on my end in the spine.sh.

because there is none (i had lots of urgent matters to deal with-- i hope to find time to work on this within the next 2-3 days)-- you will be able to see changes on the next PR

leelisae commented 4 months ago

No worries, I misunderstood your earlier message. Thank you!