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
|