Skull Stripping


I am currently using to complete my pre-processing, and as I was completing my quality checks, I noticed that chunks of two participant’s brains were removed during skull stripping. I used the various options indicated in 3dSkullStrip to help alleviate this problem but this did not help. Are there any other suggestions I can try? I have attached a copy of the resulting anatomical for both of these participants.

Various codes I used to fix the issue:
3dSkullStrip -input 11987.anat+orig -prefix 11987_skullstrip_1 -push_to_edge
3dSkullStrip -input 11987.anat+orig -prefix 11987_skullstrip_2 -ld 30
3dSkullStrip -input 11987.anat+orig -prefix 11987_skullstrip_4 -no_avoid_eyes
3dSkullStrip -input 11987.anat+orig -prefix 11987_skullstrip_5 -shrink_fac 0.5
3dSkullStrip -input 11987.anat+orig -prefix 11987_skullstrip_8 -blur_fwhm 2 -use_skull
3dSkullStrip -input 11987.anat+orig -prefix 11987_skullstrip_9 -blur_fwhm 2 -use_skull -avoid_vent -avoid_vent -init_radius 75

Thank you in advance for your help.




I would try using @SSwarper (“skullstrip + warp”) before running

It will both skullstrip the anatomical and calculate a nonlinear warp to template space (using 3dQwarp).

Target data sets for it include things in the distribution that end with “_SSW.nii.gz”, as described in the @SSwarper help file; if you are using one of those as target template space already, you should be good to go.

The outputs of @SSwarper can be put directly into your command, so you don’t have to do skullstripping there or calculate the nonlinear warp again. Examples for doing that are in the @SSwarper help file.


Thank you for the information! I will try this.

I have been using MNI152_T1_2009c+tlrc as the base in my script. I notice that @SSwarper offers the MNI152_2009_template_SSW.nii.gz template. Are there any differences between these two templates? Are there potential problems if I use the “2009” template on 2-3 participants and the “2009c” template on the rest?

Thank you,

Hi, Tamara-

The two templates do have different per voxel values, even though they appear to overlay pretty much exactly.

The “3dinfo -history” of each file tells a bit of their respective stories. For MNI152_T1_2009c, its history is one primarily of scaling:

3dcalc -a mni_icbm152_t1_tal_nlin_asym_09c.nii -b mni_icbm152_t1_tal_nlin_asym_09c_mask.nii -expr 'a*step(b)*255/97.66312' -datum byte -nscale -prefix MNI152_T1_2009c

MNI152_2009_template_SSW.nii.gz is copied from an intermediate file called “MNI_temp+tlrc”, and I don’t know its origins; it does appear to have more tissue contrast in it.

On a minor methodological note, the SSW template actually includes several subvolumes, for use in skullstripping as well, and you can read more about the “SSW” templates here:

To the main point: I do think that it would be best to use the @SSwarper method for all brains in your study, and not mix-and-match. That way, everyone should have fairly consistent skullstripping+warping.


Thank you for the information. I have already processed 30+ participants through the non-linear warping route in so I may want to keep utilizing the 2009c template for consistency. Are there other ways I can try to fix the skull stripping?

Thank you,

Hi, Tamara-

I hear ya on not wanting to reprocess. My thought process is: it really shouldn’t matter about mixing different processing results, as long as all the brains are skull-stripped well. However, it might be possible that one method skullstrips one region with consistent differences than another, and then there are systematic alignment differences for some subjects, and that could affect statistics… it would be hard how real this fear could be in real data without a systematic study.

Some things to try then using 3dSkullStrip on those couple subjects would be some of the things listed in the help file of that program, which are included below in this message.

However, I note that: even though it might seem silly to reprocess 30 subjects just to fix skullstripping on 3, I still think that miiiight be worth it, because if all goes well with @SSwarper, then it was just computer time that got used up; and, if you have to do any reprocessing in the future on other steps, then you won’t have to regenerate the (slow) nonlinear warp. In contrast, you might have to spend more of your own valuable time trying out a couple different options in 3dSkullStrip, testing, trying new options, testing, etc. Perhaps if the skullstripping doesn’t look a lot better for those few subjects after one or two re-tried of 3dSkullStrip, then fully switching to @SSwarper might make sense.


Some notes from the 3dSkullStrip program help:

1- Preprocessing of volume to remove gross spatial image 
  non-uniformity artifacts and reposition the brain in
  a reasonable manner for convenience.
    ** Note that in many cases, using 3dUnifize before **
    ** using 3dSkullStrip will give better results.    **

Common examples of usage:
  o 3dSkullStrip -input VOL -prefix VOL_PREFIX
     Vanilla mode, should work for most datasets.
  o 3dSkullStrip -input VOL -prefix VOL_PREFIX -push_to_edge
     Adds an agressive push to brain edges. Use this option
     when the chunks of gray matter are not included. This option
     might cause the mask to leak into non-brain areas.
  o 3dSkullStrip -input VOL -surface_coil -prefix VOL_PREFIX -monkey
     Vanilla mode, for use with monkey data.
  o 3dSkullStrip -input VOL -prefix VOL_PREFIX -ld 30
     Use a denser mesh, in the cases where you have lots of 
     csf between gyri. Also helps when some of the brain is clipped
     close to regions of high curvature.

     I ran the program with the default parameters on 200+ datasets.
     The results were quite good in all but a couple of instances, here
     are some tips on fixing trouble spots:

     Clipping in frontal areas, close to the eye balls:
        + Try -push_to_edge option first.
          Can also try -no_avoid_eyes option.
     Clipping in general:
        + Try -push_to_edge option first.
          Can also use lower -shrink_fac, start with 0.5 then 0.4
     Problems down below:
        + Piece of cerebellum missing, reduce -shrink_fac_bot_lim 
          from default value.
        + Leakage in lower areas, increase -shrink_fac_bot_lim 
          from default value.
     Some lobules are not included:
        + Use a denser mesh. Start with -ld 30. If that still fails,
        try even higher density (like -ld 50) and increase iterations 
        (say to -niter 750). 
        Expect the program to take much longer in that case.
        + Instead of using denser meshes, you could try blurring the data 
        before skull stripping. Something like -blur_fwhm 2 did
        wonders for some of my data with the default options of 3dSkullStrip
        Blurring is a lot faster than increasing mesh density.
        + Use also a smaller -shrink_fac is you have lots of CSF between
     Massive chunks missing:
        + If brain has very large ventricles and lots of CSF between gyri,
        the ventricles will keep attracting the surface inwards. 
        This often happens with older brains. In such 
        cases, use the -visual option to see what is happening.
        For example, the options below did the trick in various
            -blur_fwhm 2 -use_skull  
        or for more stubborn cases increase csf avoidance with this cocktail
            -blur_fwhm 2 -use_skull -avoid_vent -avoid_vent -init_radius 75 
        + Too much neck in the volume might throw off the initialization
          step. You can fix this by clipping tissue below the brain with 
                 @clip_volume -below ZZZ -input INPUT  
          where ZZZ is a Z coordinate somewhere below the brain.

     Large regions outside brain included:
       + Usually because noise level is high. Try @NoisySkullStrip.

Great! I may switch to @SSwarper depending on what the skulls look like. Thank you for your help!


I ran @SSwarper on the two subjects with poor skull stripping… I ran the following code and the program seemed to run successfully:

I was reading online that the two JPEG files should be inspected to ensure that the skull-stripping and non-linear warping worked. For these, do I just ensure (1) there is no skull remaining (2) no brain regions are removed due to aggressive skull stripping (3) the yellow line follows the outer edges of the brain. Is there anything else I should keep an eye out for or any flags I should watch for? I just want to ensure I am checking these accurately. I have attached one of my outputs.

Thank you in advance for your help,

Hi, Tamara-

Yep, those visual QC steps all look good.

From the point of view of checking how the nonlinear alignment aspect worked, you would also want to check that the sulcal+gyral patterns between the olay and ulay line up, as well as things like tissue boundaries. (Note that in the medial-sagittal slices, like where the slice=1L, one can indeed expect to see “sheets” of outlines, like in the present olay, since one might have the edge of a hemisphere throughout a slice. That looks normal, too.) Most of those patterns look pretty well lined up. One thing to check-- how do the ventricles line up? Are the subject’s (ulay volume’s) ventricles fairly large? I can’t quite tell if the olay outline is of the CSF boundary, or just some contrast inside of it. That might be worth looking at in teh GUI with full ulay/olay.


Great, thank you! The subject’s ventricles is fairly large -this person does have quite a bit of atrophy. I will keep these tips in mind as I go through the remaining scans.

Thank you again for you assistance.