Print

Print


Hi,

I don't think there's a solution to this kind of precision issue in general - it can always happen that your threshold is not quite right, and using the "exact" value is also very susceptible to round-off errors and so shouldn't be done.  The best solution is probably to use a completely different method: the -x option in fslstats.  This is designed to give you the coordinates (voxel convention) of the point with the maximum value in the image.  If there are several points with equal, maximum values then it will arbitrarily choose one.

Hopefully that will allow you to do what you want.

All the best,
	Mark



On 21 Jan 2013, at 13:33, H van Steenbergen <[log in to unmask]> wrote:

> Dear Mark,
> 
> I tried the -R option, but this procedure still produces the same problem.
> 
> The problem appears to be related to the decimal accuracy of the fslmaths -thr method. Fslstats returns a number with 6 decimal places. If I feed a number with 5 decimal places (truncating, not rounding, the 6th decimal number) into fslmaths, the method works. Obviously, this is a workaround that will only work if all other voxels have values that differ at least 0.00001, so perhaps a bug fix is needed in future versions of fslmaths?
> 
> This is the workaround method I have used to truncate the values to 5 decimal places accuray.
> 
> fslmaths zstat_std_masked_maxes_z -thr `fslstats zstat_std_masked_maxes_z -R | awk '{printf("%30.7f",$2)}' | awk '{print substr($0,22,7)}'` -bin zstat_std_masked_maxpnt
> 
> Best, Henk
>