[Neuroimaging] [Nibabel] Public dataset generates unexpected

Eleftherios Garyfallidis elef at indiana.edu
Sun Sep 10 13:31:37 EDT 2017


Hello Matthew and all,

I downloaded a dataset from NITRC  by Boekel et al.
https://www.nitrc.org/projects/dwi_test-retest/

and I used nibabel to get the affine and voxel size. The authors claimed
that the voxel size is 2x2x2mm^3 however the affine tells a different story.

import nibabel as nib

img = nib.load('pp26_dwi_run01_A.nii.gz')

print(img.affine)
[[  -1.999    0.047    0.077  108.292]
 [   0.042    1.984   -0.471  -94.461]
 [   0.047    0.251    3.703 -116.857]
 [   0.       0.       0.       1.   ]]

nib.affines.voxel_sizes(img.affine)
*array([ 2.   ,  2.   ,  3.733])*

The zoom function gives a different answer in agreement with the authors'
claim.

img.header.get_zooms()[:3]
*(2.0, 2.0, 2.0)*

Could it be that the authors damaged the header during preprocessing?
I am assuming here that nibabel is bringing the correct information i.e.
whatever is in the Nifti1 image.

If you agree that this is an issue with the data itself. It would be nice
to contact the authors.

Best regards,
Eleftherios
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/neuroimaging/attachments/20170910/89b32dcd/attachment.html>


More information about the Neuroimaging mailing list