External Email - Use Caution
Dear support I'm running the following command in Freesurfer 7.4:
samseg --t1w ${SUBJECTS_DIR}/subjOPA${ss}/mri/orig/001.mgz --flair ${SUBJECTS_DIR}/subjOPA${ss}/mri/orig/oFL.mgz --t2w ${SUBJECTS_DIR}/subjOPA${ss}/mri/orig/oT2.mgz --s subjOPA${ss} --refmode t1w --pallidum-separate --lesion --fill --threads 16 --save-posteriors
everything runs smoothly, but when I check the results I see some holes in the midbrain, in particular the red nucleus is labeled as csf. If I look at the T2.mgz file in the mri folder (I also run samseg2recon so I'm not sure it is the name given by samseg) I see that the red nucleus is set to zero, despite having non-zero values in the T2.norm.mgz volume.
Two questions: 1) how can I avoid low-intensity T2 regions to be set to CSF? 2) is it possible to provide a brain mask to samseg if I already have a reliable one?
[image: Screenshot from 2025-04-02 15-20-51.png] Simone Cauzzo
External Email - Use Caution
Hi Simone,
It's a bit tricky to answer your question because you've ran samseg using different scripts than the bare-bones samseg version documented here: https://secure-web.cisco.com/1W24pJUwHUwcNtFrI5gPFpl5c1B_fmPwIcKp4o3PA4RZaiA...
I think Doug wrote the scripts "samseg" and "samseg2recon" so he might be able to answer you better. In the bare-bones version of samseg, a voxel that has a zero intensity in any of the input channels is automatically assigned to the background, so I'm not sure why in your case it's labeled as CSF.
The default masking in bare-bones samseg is a very liberal mask encompassing much more than simply the brain (e.g., most of the scalp will be included). You can force samseg to use a precomputed mask by masking its input images yourself (i.e., set intensities to zero). If this interferes with samseg's affine registration step (from the subject to the samseg atlas), you could try doing the registration step first on the non-masked images, and then run the segmentation on the masked images.
Switching the samseg masking off altogether should be possible using a JSON file (by setting different maskingProbabilityThreshold and maskingDistance).
Hope this helps,
Koen
On Wed, Apr 2, 2025 at 10:11 AM Simone Cauzzo cauzzo.simone@gmail.com wrote:
External Email - Use CautionDear support I'm running the following command in Freesurfer 7.4:
samseg --t1w ${SUBJECTS_DIR}/subjOPA${ss}/mri/orig/001.mgz --flair ${SUBJECTS_DIR}/subjOPA${ss}/mri/orig/oFL.mgz --t2w ${SUBJECTS_DIR}/subjOPA${ss}/mri/orig/oT2.mgz --s subjOPA${ss} --refmode t1w --pallidum-separate --lesion --fill --threads 16 --save-posteriors
everything runs smoothly, but when I check the results I see some holes in the midbrain, in particular the red nucleus is labeled as csf. If I look at the T2.mgz file in the mri folder (I also run samseg2recon so I'm not sure it is the name given by samseg) I see that the red nucleus is set to zero, despite having non-zero values in the T2.norm.mgz volume.
Two questions:
- how can I avoid low-intensity T2 regions to be set to CSF?
- is it possible to provide a brain mask to samseg if I already have a
reliable one?
[image: Screenshot from 2025-04-02 15-20-51.png] Simone Cauzzo _______________________________________________ Freesurfer mailing list Freesurfer@nmr.mgh.harvard.edu https://secure-web.cisco.com/110ZoV3DZuC-heYvNrEPCGgoSoHTFLKEnEB-IKvCxhb3XXW... The information in this e-mail is intended only for the person to whom it is addressed. If you believe this e-mail was sent to you in error and the e-mail contains patient information, please contact the Mass General Brigham Compliance HelpLine at https://secure-web.cisco.com/1ihlqAKc2Ee20pkN7A4_Ow5WxQekyrWuy_XaBY4FvkyRLaR... < https://secure-web.cisco.com/1ihlqAKc2Ee20pkN7A4_Ow5WxQekyrWuy_XaBY4FvkyRLaR... .
freesurfer@nmr.mgh.harvard.edu