[Code 26] NIFTI_HEADER_UNREADABLE

Hi all,

I am using the web bids validator and BIDS 1.1.1. I am getting an error for all my files that the Nifti header is unreadable. I am not sure why this is the case, as I can read the header with fslhd. The only thing I can think of is that the files are referenced via symlinks, but the validator seems to be getting the filesize right. Or perhaps it might be that the Stanford imaging center adds some untoward info to the header via NIMS processing from dicom. Any thoughts?

Thank you,

Ian

Here is the error:
sub-01_task-loc_run-01_bold.nii.gz1001128.42 KB | application/gzip

Location:
fd-BIDS/sub-01/func/sub-01_task-loc_run-01_bold.nii.gz

Reason:
We were unable to parse header data from this NIfTI file. Please ensure it is not corrupted or mislabeled.

And the output of fslhd:
iballard@cnic2:~/fd$ fslhd fd-BIDS/sub-01/func/sub-01_task-loc_run-01_bold.nii.gz
filename fd-BIDS/sub-01/func/sub-01_task-loc_run-01_bold.nii.gz

sizeof_hdr 348
data_type FLOAT32
dim0 4
dim1 146
dim2 146
dim3 57
dim4 235
dim5 1
dim6 1
dim7 1
vox_units mm
time_units s
datatype 16
nbyper 4
bitpix 32
pixdim0 0.000000
pixdim1 1.595890
pixdim2 1.595890
pixdim3 1.600000
pixdim4 1.500000
pixdim5 1.000000
pixdim6 1.000000
pixdim7 1.000000
vox_offset 352
cal_max 9481.9531
cal_min 103.1346
scl_slope 1.000000
scl_inter 0.000000
phase_dim 2
freq_dim 1
slice_dim 3
slice_name sequential_increasing
slice_code 1
slice_start 0
slice_end 56
slice_duration 0.078947
time_offset 0.000000
intent Unknown
intent_code 0
intent_name
intent_p1 0.000000
intent_p2 0.000000
intent_p3 0.000000
qform_name Scanner Anat
qform_code 1
qto_xyz:1 -1.587715 0.016451 -0.160900 99.759605
qto_xyz:2 0.032654 -1.521940 -0.480295 99.038628
qto_xyz:3 -0.157989 -0.479891 1.517705 28.598841
qto_xyz:4 0.000000 0.000000 0.000000 1.000000
qform_xorient Right-to-Left
qform_yorient Anterior-to-Posterior
qform_zorient Inferior-to-Superior
sform_name Scanner Anat
sform_code 1
sto_xyz:1 -1.587715 0.016419 -0.160906 99.759605
sto_xyz:2 0.032687 -1.521940 -0.480293 99.038628
sto_xyz:3 -0.157984 -0.479893 1.517705 28.598841
sto_xyz:4 0.000000 0.000000 0.000000 1.000000
sform_xorient Right-to-Left
sform_yorient Anterior-to-Posterior
sform_zorient Inferior-to-Superior
file_type NIFTI-1+
file_code 1
descrip te=27.70;ti=0;fa=71;ec=0.3560;acq=[146,146];mt=0;rp=2.0;pe=0
aux_file

Couple of things I would try:

  1. The same data, but without symlinks
  2. Checking if .nii.gz are indeed compressed files or just .nii renamed as .nii.gz. You should be able to do this with type

Hi Chris,

Using the hard copies of the file rather than symlinks worked (incidentally, the files are really zipped, according to “file”).

Is there a way to force past this error to upload to OpenNeuro? On my server, the raw data are stored via a read-only mounted drive, and there is not enough available space on the server disk to copy them all over. I could rsync all of the data elsewhere just to upload them, but it’s a little inelegant.

Thanks,

Ian

This looks like a bug. We’ll try to fix it soon https://github.com/bids-standard/bids-validator/issues/643.

There is a small chance that the bug only happens in the web version of the validator. You can thus try uploading via the comman line client: https://github.com/OpenNeuroOrg/openneuro/tree/master/packages/openneuro-cli

1 Like