questions > dcm2nii: data type
Showing 1-2 of 2 posts
Display:
Results per page:
Jan 17, 2017  05:01 PM | Kamy Wakim - University of Rochester
dcm2nii: data type
Hi,

I recently acquired .nii files from an old dataset.  I also obtained new data on the same scanner using the same scanner sequence.  I converted my dicoms to .nii files using dcm2nii from November 2014, but I'm not sure how the old data was converted to nii.  When I ran fslinfo to verify that the old subjects and the new subjects could be combined into one new dataset, I noticed a disparity between the two groups: the old subjects have a "data type" of INT16 and the new subjects are FLOAT32.

I have an attached an image of the fslinfo output for subjects from a subject from each group.  Could this difference be due to conversion using a different version of dcm2nii?

Thanks for all your help,
Kamy
Jan 17, 2017  06:01 PM | Chris Rorden
RE: dcm2nii: data type
I suspect your scanner or sequence was upgraded. Classically, reconstruction was 12 bits (0..+4095), but recent upgrades have moved to 16 and 20 bit precision. My software always tries to uses the most compact popular format possible. So if your raw data was in the range -32768..+32768 it will be stored as signed 16-bit integers. If your data is in the range 0..65535 it will be saved as either unsigned 16-bit integers or 32-bit floats (depending on your ini files setting "UINT16toFLOAT32=0", "UINT16toFLOAT32=1": the former is more compact and the latter is better supported). If your data range exceeds 65535 the image will be stored as 32-bit float.

You can always upsample 16-bit data to 32-bits (though they take twice as much disk space). For example, my script
 https://github.com/rordenlab/spmScripts/blob/master/nii_change_datatype.m

I would also suggest upgrading to dcm2niix (which comes with MRIcroGL). While I hope my older software is robust and mature, I have moved my development efforts to the newer software. The scanner manufacturers are re-interpretting the DICOM standard, so be vigilant that newer updates may break my tools.