Hi John
You seem to be using bash syntax in a csh script. Setting variables
in csh is accomplished with e.g.
setenv foo bar
instead of (bash syntax)
foo=bar
I don't know if the `inverted ticks` syntax is legitimate in csh.
To fix your script, I think it might be sufficient to use /bin/bash in
the first line instead of /bin/csh. Then, instead of the "foreach"
you can use
for Subjects in AB ; do
# commands in loop
done
This much on scripts. Regarding your actual problem, to get the
volumes of each compartment, I would just use the hard segmentation
(_seg) output and run
fslstats file_seg -h 4
This should give you a single column of four numbers corresponding to
the volume in voxels of background, CSF, GM and WM.
Hope that helps
Rolf
On Sun, Aug 30, 2009 at 06:50:54PM +0100, John P. Hegarty II wrote:
> My name is John Hegarty, and I have been pleased to utilize FSL for a
> volumetric MRI study I am conducting. I am relatively new to FSL and
> unix coding alike. I am simply attempting to output the information
> from FAST to obtain a voxel number of CSF, GM, and WM. When I run the
> coding from the example script on the site I get an error message from
> each step of the script. I don't really care if I have to multiply the
> numbers by hand because the variables aren't working, but I want to be
> sure that the vol and mean values are correct and that I can utilize
> these for my analyses. I was wondering if there were a way for me to
> verify that I am getting the correct output from my files. I
> appreciate your help. I have attached my code and error messages below.
>
> Regards,
>
> John Hegarty
> [log in to unmask]
>
>
> #!/bin/csh
>
> foreach Subjects (AB)
>
> cd /applications/neuroimaging/olfact_mem/scans/delineate/nifti
>
> vol=`$FSLDIR/bin/fslstats COPY_${Subjects}_struc_Resize_brain_susan_pve_0
> -V | awk '{print $1}'`
> mean=`$FSLDIR/bin/fslstats COPY_$
> {Subjects}_struc_Resize_brain_susan_pve_0 -M`
> tissuevol=`echo "$mean * $vol" | bc -1`
> echo $tissuevol
>
> end
>
> vol=150122: Command not found.
> mean=0.773635: Command not found.
> mean: Undefined variable.
> tissuevol=: Command not found.
> tissuevol: Undefined variable.
>
>
> --
> John Hegarty
> [log in to unmask]
>
> Lifespan Human Senses Lab
> San Diego State University
> 619-594-3733
--
Rolf A Heckemann, PhD
Research Associate
Division of Neuroscience and Mental Health
MRC Clinical Sciences Centre
Imperial College London
Hammersmith Hospital Campus
Du Cane Road
London W12 0HS
United Kingdom
1251656345
|