can I mute this warning: AFNI converts NIFTI_datatype=2 ....

Dear AFNI Gurus-

Sometimes I see this warning message when a dset is read into AFNI – here, into 3dinfo (and this dataset came from some other software output):


** AFNI converts NIFTI_datatype=2 (UINT8) in file /home/sweethome/some/path/some_dset.nii.gz to FLOAT32
     Warnings of this type will be muted for this session.
     Set AFNI_NIFTI_TYPE_WARN to YES to see them all, NO to see none.

How much should I care or be concerned about the above warning?

It clogged my happy data viewing, so I ran “3dinfo -DAFNI_NIFTI_TYPE_WARN=NO …” to get rid of it temporarily. Can I feel secure enough that I am not missing anything vital to put:


AFNI_NIFTI_TYPE_WARN = NO

into my ~/.afnirc file?

thanks,
pt

Esteemed ptaylor,

Based on my reading of thd_niftiread.c, that warning should appear only in cases of data formats that are not used directly in AFNI, such as the upscaling of unsigned 16-bit to floating point format, and in the case of NIFTI data with a scale factor. In neither case typically,this should not be an important issue. The first case results in a dataset that’s double the expected size in memory, but disk space with compression is likely to be similar. The second case indicates a difference in the voxel data to reflect the scaling from the scl_slope and scl_intercept in the NIFTI header; in which case, the data is also converted to floating point format. That up-conversion can potentially occur for 8-bit byte or 16-bit integer data, even if otherwise a known AFNI format. I haven’t seen this problem myself, but it is potentially there. You can happily put the blindfold over your eyes for most purposes with that environment variable.

EDIT: sorry, hadn’t seen Daniel’s respose…

You can ignore it. It is just a message saying that AFNI will treat the type as float instead of UINT8.

In this case, it seems like there is some scalar or offset being applied to the data values, and so we do not handle it as a straight byte.

You could check these values via something like:

nifti_tool -disp_hdr -field scl_slope -field scl_inter -infiles *.nii*
  • rick

Dear AFNI Gurus-

Great, thanks, I will promptly update my ~/.afnirc to ignore this.

… but before I do, running the recommended nifti_tool command to check on things got me this:


$ nifti_tool -disp_hdr -field scl_slope -field scl_inter -infiles FILE.nii

N-1 header file 'FILE.nii', num_fields = 2
  name                offset  nvals  values
  ------------------- ------  -----  ------
  scl_slope            112      1    0.012101
  scl_inter            116      1    -0.0

… so indeed there is a “slope” being applied, at least.

thanks,
pt