Skip to content

Detect bogus BrainVoyager NIfTI headers #36

@neurolabusc

Description

@neurolabusc

The NIfTI specification defines cal_min and cal_max as follows:

float cal_max;       /*!< Max display intensity */  /* float cal_max;       */
float cal_min;       /*!< Min display intensity */  /* float cal_min;       */

It is standard convention to set both to zero if they are to be ignored. Unfortunately, BrainVoyager seems to set these to 0 and 255 respectively when creating NIfTI data.

The BIDS format BrainVoyager Getting Started Guide (GSG) files exhibit this, e.g. GSGData.zip. Consider the fMRI image that has a mean intensity of 4022 (with a range of 0..49183). Here the cal_min and cal_max of 0..255 is inappropriate, with even dark air voxels having values ~700.

$ fslinfo sub-01_ses-04_task-blocked_run-1_bold.nii.gz   
data_type	FLOAT32
dim1		100
dim2		100
dim3		64
dim4		291
datatype	16
pixdim1		2.000000
pixdim2		2.000000
pixdim3		2.000000
pixdim4		2.000000
cal_max		255.000000
cal_min		0.000000
file_type	NIFTI-1+
$ fslstats sub-01_ses-04_task-blocked_run-1_bold.nii.gz -m -R
4021.941837 0.000000 49183.000000 

It would be great if BrainVoyager could fix this, but bvlabel could also provide a mechanism for detecting and fixing existing bogus values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions