Hi,
Converting a floating point image to an integer image requires the
values to be scaled appropriately into the integer range. There is
the capability within the nifti standard to store a scaling parameter
but we do not write such images with FSL. Therefore you can either
scale up your values to the integer range (e.g. multiply by 10000 before
saving) or do this and set the scaling via some other software, e.g.
nifti_tool.
All the best,
Mark
On 10 Nov 2009, at 19:08, Miguel Burgaleta wrote:
>
> Hi again Mark,
> I applied fslmaths following your instructions but the output is a
> binary image. The input image is an FA image ranging from 0 to 1,
> float32. Any advice on this?
>
> Thanks,
> Miguel
>
>
>
> On Tue, Nov 10, 2009 at 5:15 PM, Miguel Burgaleta <[log in to unmask]
> > wrote:
> Thanks for the info, Mark.
> Best,
> Miguel
>
>
>
> On Tue, Nov 10, 2009 at 4:48 PM, Mark Jenkinson
> <[log in to unmask]> wrote:
> Hi,
>
> The acceptable arguments for the -datatype option in FLIRT
> are given in the help output. That is:
> -datatype {char,short,int,float,double}
> (force output data type)
> So short is a 16-bit integer, although it is signed, not unsigned.
> We cannot actually write unsigned 16 bit integers from FSL I'm afraid.
> However, if none of your values are greater than 32767 then it doesn't
> matter if you use signed or unsigned 16 bit.
>
> Also, I would not use FLIRT to do these conversions, but
> use FSLMATHS instead, with:
> fslmaths inputimage outputimage -odt short
> which again gives 16-bit signed integer.
>
> Note that the nifti datatype code 4 is actually a signed 16-bit
> integer, not an unsigned one. The code for an unsigned 16-bit
> integer is 512 (see $FSLDIR/src/niftiio/nifti1.h for the definitions).
>
> All the best,
> Mark
>
>
>
> On 10 Nov 2009, at 15:38, Miguel Burgaleta wrote:
>
> Hello FSL experts,
>
> I am using FLIRT and getting a float32 output that must be converted
> into uint16 in order to feed an in-house program. What is the safest
> way to do such a conversion with FSL? I tried forcing the output
> data type with the flag -datatype 4 in FLIRT but that didn't work
> (got "empty" images). Any suggestions?
>
> Thanks in advance,
> Miguel
>
>
|