White matter mask and CSV mask

HI All,

I first use FSL fast segmentation to get grey/white/csv,and use 3dresample and 3dcalc to get WM and CSV mask. Later, I take these two mask as concomitant variable in GLM.But WM mask is not good enough, it covers thalamus.Meanwhile, CSV mask cover some area around the brain. I want to exclude thalamus part in WM and area around the brain in CSV.

I want to konw if AFNI have exisiting WM mask and CSV mask? If so, how can I get them?If not, how can I get a better mask?

Here is my script:
3dcopy anne_anat_de_al+orig. anne_anat_de_al.nii.gz
fast -o anne_de_al_seg anne_anat_de_al.nii.gz

3dresample -master anne_EO_de+orig -prefix Mask_csv_resam -inset anne_de_al_seg_pve_0.nii.gz
3dresample -master anne_EO_de+orig -prefix Mask_white_resam -inset anne_de_al_seg_pve_2.nii.gz

3dcalc -a ‘Mask_white_resam+orig’ -expr ‘ispositive(a-0.9)’ -prefix white_mask;
3dcalc -a ‘Mask_csv_resam+orig’ -expr ‘ispositive(a-0.9)’ -prefix csv_mask;

3dcalc -a white_mask+orig -b a+i -c a-i -d a+j -e a-j -f a+k -g a-k -expr ‘a*(1-amongst(0,b,c,d,e,f,g))’ -prefix white_mask_ero
3dcalc -a csv_mask+orig -b a+i -c a-i -d a+j -e a-j -f a+k -g a-k -expr ‘a*(1-amongst(0,b,c,d,e,f,g))’ -prefix csv_mask_ero
3dmaskave -quiet -mask white_mask_ero+orig anne_EO_de+orig > white_ero.1D;
3dmaskave -quiet -mask csv_mask+orig anne_EO_de+orig > csv.1D;

My CSV mask and WM mask result are In attachmenth.

Thank for your help.

You can try using FreeSurfer to get its segmentation. AFNI provides 3dSeg and 3dkmeans that may give you the segmentation you want too. The ANTS package has the Atropos segmentation program too.