Open plbenveniste opened 1 year ago
Hold on; I believe there is no need to reimplement the same thing to Python.
That's true. But since I had already done it, I might as well add it to the code. Also, in my opinion, in makes more sense to have everything in Python (instead of having both .py and .sh code)
Optimisation idea: as mentionned in issue 46 : could work to change the parameter to 64 x 192 x -1
Experiment results: great quality overall for both PSIR and STIR.
Results of QC:
For the minor correction, often, a part of the eye is included in the segmentation : this is easily solvable by changing the cropping regions.
As for the bigger problems, sometimes it is linked to poor image quality, sometimes there is a hole in middle of the segmentation (as in the sc is segmented entirely expect between certain vertebral levels)... However, something that we can note is that it happens almost only for PSIR and majorly for sub-mon
et sub-van
subjects (currently investigating this).
The QC is available on ~/duke/temp/plben/sc_seg_canproco_contrast_agnostic/qc_folder_2
The QC is available on ~/duke/temp/plben/sc_seg_canproco_contrast_agnostic/qc_folder_2
If not too big (<10MB) could you please upload a ZIP of the QC? If not no worries I'll look into duke
.
Its about 100 MB.
In general, I notice that the edge slice is not well segmented, example:
Could it be because of:
Another observation, which points to a possible bug, is that the slice on the right is better segmented than the one on the left:
Maybe an issue with resampling?
idea from @plbenveniste : flip RL and re-run the inference as a quick check to see if there is an asymmetry bias in the inference
For the minor correction, often, a part of the eye is included in the segmentation : this is easily solvable by changing the cropping regions.
that's another argument for adding post-processing (https://github.com/sct-pipeline/contrast-agnostic-softseg-spinalcord/issues/73)
Spinal cord segmentation was performed using x, y, z flip and sum of the 4 files (the original one as well). The output was saved before and after binarization (in case we want to modify the segmentation mask before binarization). Inference was performed: it took a long time: around 15 hours (25 sec per inference; 4 per subjects; 446 subjects).
The QC folder is available at : ~/duke/temp/plben/sc_seg_canproco_contrast_agnostic/qc_folder_flip_xyz
Visual observation of QC :
To summarize this : only 35/ 446 files (8%) have segmentation issues.
Among them, 19 have points outside the spinal cord which are segmented : easily solvable using keep_largest_object function
(@valosekj).
For the rest, 6 have a chunk of the spinal cord which is forgotten and 10 have major segmentation issue.
After investigation: the 10 major segmentation issues come from image quality issues : see issue 53.
I confirm that segmentation results look much better with "flip_xyz". In general, much less false negatives. Below are four representative examples at each site, comparing the previous method (single inference) with the "flip_xyz" method (for posterity):
So
On branch
plb/sc_seg-contrast-agnostic
Issue to document work on spinal cord segmentation using the contrast-agnostic model.Related to #46
As discussed with @valosekj, I am doing this to have the code in Python (@valosekj is doing it in
.sh
).Parameters used: