Q: Howdy all,

if I try to use nii2mnc I get this interesting error message:

nii2mnc test_image_00001.hdr

  • ERROR: nifti_convert_nhdr2nim: bad dim[0]
  • ERROR (nifti_image_read): cannot create nifti image from header ‘test_image_00001.hdr’

Segmentation fault ____ The same test image works fine on another computer: nii2mnc test_image_00001.hdr
orient = 0
nifti_image
nifti_type = ‘ANALYZE-7.5’
header_filename = ‘test_image_00001.hdr\\’

 image_filename = ‘test_image_00001.img’
image_offset = ‘0’
ndim = ‘4’
nx = ‘163’
ny = ‘186’
nz = ‘72’
nt = ‘1’
dx = ‘-1.06677’
dy = ‘1.06677’
dz = ‘1.87482’
dt = ‘1’
datatype = ‘16’
datatype_name = ‘FLOAT32’
nvox = ‘2182896’
nbyper = ‘4’
byteorder = ‘MSB_FIRST’
cal_min = ‘0’
cal_max = ‘1’
descrip = ‘MINC file’
num_ext = ‘0’

Unknown XYZ units 0 xspace start: 86.9418 step: −1.0668 cosines: 1.0000 0.0000 0.0000
yspace start: −99.2096 step: 1.0668 cosines: 0.0000 1.0000 0.0000
zspace start: −67.4934 step: 1.8748 cosines: 0.0000 0.0000 1.0000
(where: nii2mnc -v
program: 2.0.15
libminc: 2.0.15
netcdf : 3.5.0 of Aug 8 2003 13:03:52 $
HDF5 : 1.6.2 )
(installed from source on Debian Sarge)
____

My current version: nii2mnc -v
program: 2.0.15
libminc: 2.0.15
netcdf : “3.6.2” of May 10 2008 09:14:53 $
HDF5 : 1.6.6
(installed using mincbundle on a recent Ubuntu Intrepid install with all the recommended upgrades). (I also have an unusual situation, as it turns out that most of the binaries are located in /bin and the libraries in /usr/lib by default - no idea why!)

Hope somebody can point to a solution… Thanks!
http://www.bic.mni.mcgill.ca/pipermail/minc-users/2009-April/002441.html

A: HI, Maybe have a look at the value of dim[0]. I’ve seen images where dim[0] is incorrectly set to 0 instead of 3 or 4.