Feature request: CSF segmentation (and maybe probabilistic maps) for deepseg

Dear Julien and co!

As discussed breifly during the meeting, I would like to request that deepseg segment out the CSF, not just GM/WM. Would this be possible?

As a very much secondary request: If possible (though I understand this to be a hard problem to solve), the outputs could be made into probability maps, rather than binary ones. I am not sure this is possible with a CNN.

Best wishes


Hi Daniel,

Great suggestions!

CSF segmentation with deep learning: a ticket has been opened here

Probabilistic segmentations: a ticket has been opened here. You will notice that “probabilistic” output (by means of test-time augmentation, so it is not probabilistic per se) is already implemented for sct_deepseg_gm and can be activated via slight modification of the code, as explained in the issue.


Dear Julien

Thank you very much!

I’ll keep an eye on this thread.


Dear Julien

In light of the recent thread of propseg’s CSF segmentation, do you have an ETA for the deep learning CSF feature? I am writing a paper and a local (and hopefully more than local) best practices recommendation, and I would like to know if I should stick with propseg for the time being.

My practice and recommendation is to take the CSF mask segmented by propseg, and erode it by one from each side. While this does get rid of errant cord voxels, it can cause discontinuities in the mask. I also only use CSF for normalisation, so this might not be feasible for others.

Best wishes, and sorry for pestering you


this feature request seems to be gaining more and more priority, so we might as well do it soon :wink:

one thing that would help us tremendously would be to know what kind of contrast you will be using for segmenting CSF, so we can start by creating models for specific contrasts only. I would recommend the T2w (TSE) sequence.

1 Like

Awesome! :slight_smile:

For my project, the relevant contrasts are T2*/MEDIC (as that is where GM and WM are segmented from for the final analysis), and perhaps MT-weighted (native space for my results, and good results for deepseg_sc and deepseg_gm) if you have the time. Example data here:

Password: spinalcord