[MINC-users] mnc2nii

Marc BOUFFARD bouffard at bic.mni.mcgill.ca
Tue Nov 20 14:26:49 EST 2007


Hello,

when using mnc2nii, version:

program: 1.4
libminc: 1.4
netcdf : 3.6.1 of Jul  5 2006 14:12:05 $

mnc2nii -short -unsigned -nii file.mnc

sometimes, randomly as far as I can tell, it produces a segmentation fault
see below:


*************first output***********************************************
<nifti_image
  nifti_type = 'NIFTI-1+'
  header_filename = 'file_name.nii'
  image_filename = 'file_name.nii'
  image_offset = '0'
  ndim = '3'
  nx = '91'
  ny = '109'
  nz = '91'
  dx = '2'
  dy = '2'
  dz = '2'
  datatype = '512'
  datatype_name = 'UINT16'
  nvox = '902629'
  nbyper = '2'
  byteorder = 'LSB_FIRST'
  scl_slope = '2.06785e-05'
  scl_inter = '0.677592'
  xyz_units = '2'
  xyz_units_name = 'mm'
  time_units = '8'
  time_units_name = 's'
  descrip = 'mnc2nii mask_2mm_roy_barbara_mri.mnc'
  sform_code = '3'
  sform_code_name = 'Talairach'
  sto_xyz_matrix = '2 0 0 -90 0 2 0 -126 0 0 2 -72 0 0 0 1'
  sto_ijk matrix = '0.5 0 0 45 0 0.5 0 63 0 0 0.5 36 0 0 0 1'
  sform_i_orientation = 'Left-to-Right'
  sform_j_orientation = 'Posterior-to-Anterior'
  sform_k_orientation = 'Inferior-to-Superior'
/>
MINC type 3 signed 1
0: 91 0 1
1: 109 1 1
2: 91 2 1
bytes per voxel 2
# of voxels 902629
Segmentation fault
*********************************************************

This does not create a corresponding .nii file.  Now if the name of the
file is change to say file_.nii and mnc2nii is rerun with the name change
it works:

**************second output******************************
<nifti_image
  nifti_type = 'NIFTI-1+'
  header_filename = 'file_.nii'
  image_filename = 'file_.nii'
  image_offset = '0'
  ndim = '3'
  nx = '91'
  ny = '109'
  nz = '91'
  dx = '2'
  dy = '2'
  dz = '2'
  datatype = '512'
  datatype_name = 'UINT16'
  nvox = '902629'
  nbyper = '2'
  byteorder = 'LSB_FIRST'
  scl_slope = '2.06785e-05'
  scl_inter = '0.677592'
  xyz_units = '2'
  xyz_units_name = 'mm'
  time_units = '8'
  time_units_name = 's'
  descrip = 'mnc2nii mask_2mm_roy_barb_mri.mnc'
  sform_code = '3'
  sform_code_name = 'Talairach'
  sto_xyz_matrix = '2 0 0 -90 0 2 0 -126 0 0 2 -72 0 0 0 1'
  sto_ijk matrix = '0.5 0 0 45 0 0.5 0 63 0 0 0.5 36 0 0 0 1'
  sform_i_orientation = 'Left-to-Right'
  sform_j_orientation = 'Posterior-to-Anterior'
  sform_k_orientation = 'Inferior-to-Superior'
/>
MINC type 3 signed 1
0: 91 0 1
1: 109 1 1
2: 91 2 1
bytes per voxel 2
# of voxels 902629
0 0 0 => -90.000000 -126.000000 -72.000000
10 0 0 => -70.000000 -126.000000 -72.000000
0 10 0 => -90.000000 -106.000000 -72.000000
0 0 10 => -90.000000 -126.000000 -52.000000
10 10 10 => -70.000000 -106.000000 -52.000000
*******************************************************************

Sometimes it takes another name change before it finally creates the .nii.
When the .nii file is created it looks valid though (using MRIcro).  This
seems to be random so out of 20 files converted there may be somehting
like 5 that don't get created and have to be renamed before re-running
mnc2nii.  Why is this occuring?

Marc


More information about the MINC-users mailing list