Mark,
I probably mis-remembered the kernel size at which I started getting the
problem (it happened several months ago). Your explanation makes sense.
Thanks,
Matt.
-----Original Message-----
From: FSL - FMRIB's Software Library [mailto:[log in to unmask]] On Behalf
Of Mark Jenkinson
Sent: Tuesday, April 29, 2008 9:14 AM
To: [log in to unmask]
Subject: Re: [FSL] creating ROI using fslmaths
Hi,
The first problem is easy, and there are two things you need to change.
One is that the coordinates that need to be used for the -roi command
must be voxel coordinates (from 0 to n-1), not mm coordinates, which
is why it doesn't like the -7, which is effectively including a voxel
outside
of the image. We will put this in the help message in the next release.
The other problem is that you need to specify four pairs of numbers
always. That is - from the help message -
-roi <xmin> <xsize> <ymin> <ysize> <zmin> <zsize> <tmin> <tsize>
where you still need to include tmin and tsize, even for a 3D volume.
So you must put in the 0 1 at the end like I did.
I have finally managed to replicate your other problem.
I do not get it with a 9mm kernel but only above 10 mm.
The non-zero values outside of the sphere are caused by small
inaccuracies in the FFT which is used internally to perform
convolutions with large kernels. We switch from a direct
image-based calculation to an fft-based calculation when the
kernel exceeds a given size, in order to get the fastest performance.
However, when I get this the non-zero values are all less than
1e-10 whereas the main sphere has values of 1e-4 or better.
Hence there is quite a large difference and they are not visible
to my eye when looking at the image initially. If you use -bin
in the command then they are immediately obvious because
you threshold at exactly zero, and this is the problem. If you
put in "-thr 1e-8" before the "-bin" then I think these problems
will go away. Let me know if your non-zero values are
substantially larger than this though, or if your computation
time is excessive. On my laptop it takes 30 seconds for the
image-based version (size 10) and 74 seconds for the fft-based
one (size 11).
All the best,
Mark
On 29 Apr 2008, at 04:56, Gerhard Jocham wrote:
> Dear Mark and Matt,
>
> thank you very much for your reply. The command I initially used was
>
> fslmaths /daten/share/opt/fsl/fsl-4.0.1/data/ standard/
> MNI152_T1_2mm_brain_mask.nii.gz -roi 17 1 5 1 -7 1 point_mask -odt
> float
>
> The resulting mask was zero:
> fslstats point_mask -R
> 0.0000 0.0000
>
> I also tried the command you just recommended:
>
> fslmaths /daten/share/opt/fsl/fsl-4.0.1/data/standard/
> MNI152_T1_2mm_brain_mask.nii.gz -mul 0 -add 1 -roi 17 1 5 1 -7 1
> point_mask -odt float
>
> However, the result was the same as above.
> So, I manually drew a point mask in fslview, to which I then applied
> the
> following command:
>
> fslmaths point_mask.nii.gz -kernel sphere 9 -fmean bin sphere9mm -
> odt float
>
> The result was:
> fslstats sphere9mm -R
> 0.0000 1.0000
> however, what I obtained was the weird arrangement of blobs of ones
> and
> zeros throughout the brain.
> Also, the filesize is by far larger than with the 5 mm sphere (for a
> 5 mm
> sphere, the file size was 28 K, whereas for a 6 mm spere it exceeded
> 1 MB).
>
> Next, I tried the command as you suggested:
>
> fslmaths point_mask.nii.gz -kernel sphere 9 -fmean sphere9mm -odt
> float
>
> fslstats sphere9mm -R
> 0.000000 0.000326
>
> The mask now has 0.00033 intensity while it is still surrounded by
> blobs
> of varying intensity.
>
> This is what happened to me here. I am looking forward to your
> opinion on
> this,
>
> Thank you and best regards,
>
> Gerhard
>
|