Dear FSL experts,
I would like to compare five images of significant clusters (generated from TBSS and randomise) to 31 white matter masks in order to find the number of voxels within a cluster that belong to a particular WM region.
The cluster images are:
temp_FAt3_1_tfce_thr0point95.nii.gz
temp_FAt3_2_tfce_thr0point95.nii.gz
temp_FAt3_3_tfce_thr0point95.nii.gz
temp_FAt3_4_tfce_thr0point95.nii.gz
temp_FAt3_5_tfce_thr0point95.nii.gz
The white matter maps are named:
AntCoronaRadiataLeft.nii.gz, etc...
I need to compare each of the 5 cluster images to the 31 WM masks. I thought it could be done by making a list of all the WM masks and then using the following script... but it doesn't work:
foreach n (`cat mask`)
set base = `echo $n | sed 's/.\{7\}$//'`
fslmaths xxxx_thr0point95.nii.gz -mas $n xxxx_thr0point95_$base
end
I get the following error message:
bash: syntax error near unexpected token `('
And then I realised:
bash: foreach: command not found
Is this because I use the Bourne shell and not the C shell? And can anyone please help me to rewrite it using #!/bin/bash and I suspect the command "for file in *.txt ; do" ? Any help would be greatly appreciated.
Kind regards,
Meghan Mcilwain
|