Hi Moran
To extract an ROI, use fslroi instead of fslmaths. The -roi option to
fslmaths does not extract -- it sets voxels outside the ROI to zero.
BTW, you can read all your variables with one fslstats call if you're
using bash:
read V1a V2a V3a <<< $(fslstats Sig1 -C)
Hope this helps
Rolf
On 27 June 2012 11:53, Moran Artzi <[log in to unmask]> wrote:
> Dear experts,
>
> I have several VOIs (with different size and shapes). From each VOI I want to define a region with fixed number of voxels (the same number for all VOIs, regardless to there size), in the area of the VOI center of gravity.
>
> Using FSL command line I tried the following option:
>
> V1a=`fslstats Sig1.nii.gz -C | cut -d " " -f 1`
> V2a=`fslstats Sig1.nii.gz -C | cut -d " " -f 2`
> V3a=`fslstats Sig1.nii.gz -C | cut -d " " -f 3`
> V1b=`echo "$V1a - 1" | bc -l`
> V2b=`echo "$V2a - 1" | bc -l`
> V3b=`echo "$V3a - 1" | bc -l`
> fslmaths Sig1.nii.gz -roi $V1b 3 $V2b 3 $V3b 3 0 1 cog-Sig1.nii.gz
>
> This results with the desired center of gravity sub-VOIS
> However, each one had different voxel size.
>
> How can I fix the number of the voxels?
> Thanks a lot
>
> Moran
--
Rolf A Heckemann, MD PhD
Médecin chercheur, Fondation Neurodis
CERMEP - Imagerie du Vivant
Hôpital Neurologique Pierre Wertheimer
59 Boulevard Pinel
69003 Lyon
France
2nd affiliation: Honorary Fellow, Imperial College London
|