AFNI Message Board

Dear AFNI users-

We are very pleased to announce that the new AFNI Message Board framework is up! Please join us at:

https://discuss.afni.nimh.nih.gov

Existing user accounts have been migrated, so returning users can login by requesting a password reset. New users can create accounts, as well, through a standard account creation process. Please note that these setup emails might initially go to spam folders (esp. for NIH users!), so please check those locations in the beginning.

The current Message Board discussion threads have been migrated to the new framework. The current Message Board will remain visible, but read-only, for a little while.

Sincerely, AFNI HQ

History of AFNI updates  

|
March 26, 2013 06:31AM
giuseppe pagnoni Wrote:
-------------------------------------------------------
> I have noticed that when copying NIFTI data (from
> a Philips scanner) with 3dcopy, an automatic
> conversion from INT16 to FLOAT32 seems to be
> taking place [...]
> But why is that
> happening? Is there a way to keep the original
> format? If the data are originally INT16, it
> seems to me that you waste a lot of disk space and
> computing time by doubling the size of the data
> right away.

In my understanding int16 was used in AFNI in the old days, when disk space was expensive. Nowadays disk space is quite cheap, so it's not too much of an issue.

When using int16, data is stored together with a min value p and max value q; each value v is then stored as an int16 i with v=p + s*i, where s=(q-p)/(2^16-1) is the step size. When having a few outliers (extreme values) q-p is large so the step size s is large too. This reduces the resolution for the rest of the data (which is usually the data of interest). In addition, every processing step usually involves some averaging of existing values that have to be converted back to an int16, which again impoverishes the data (even if during computations the data is stored internally as float32).

Float32 does not have this disadvantage as it holds an exponent, allowing for a large range of data and yet good numerical precision.
Therefore float32 is currently considered as the preferred option by most.

Also note that you can enable compression which reduces file sizes considerably, and this compression works transparently in the AFNI programs. One way is to specify an extension for the output file (e.g. -prefix output.nii.gz to store in nifti and gzip the output). Another approach is to set the environmental variable AFNI_COMPRESSOR to BZIP2 or GZIP so that AFNI compresses the data automatically.
Subject Author Posted

automatic conversion to float32 from nifti int16

giuseppe pagnoni March 26, 2013 05:48AM

Re: automatic conversion to float32 from nifti int16

nick March 26, 2013 06:31AM

Re: automatic conversion to float32 from nifti int16

giuseppe pagnoni March 26, 2013 07:00AM

Re: automatic conversion to float32 from nifti int16

Daniel Glen March 26, 2013 09:08AM

Re: automatic conversion to float32 from nifti int16

giuseppe pagnoni March 26, 2013 09:52AM

Re: automatic conversion to float32 from nifti int16

rick reynolds March 26, 2013 10:15AM

Re: automatic conversion to float32 from nifti int16

giuseppe pagnoni March 26, 2013 12:57PM

Re: automatic conversion to float32 from nifti int16

rick reynolds March 26, 2013 01:15PM

Re: automatic conversion to float32 from nifti int16

giuseppe pagnoni March 26, 2013 01:58PM

Re: automatic conversion to float32 from nifti int16

rick reynolds March 26, 2013 02:00PM