[MINC-users] mnc2nii. int vs uint vs float
Thorarin Bjarnason
thor4ooo at gmail.com
Wed Sep 6 16:17:44 EDT 2006
Hello List,
I thought I would start another thread. Even though it is quite
possible that my ignorance of data types will soon become apparent.
;-)
I am trying to take my mnc files and create raw data consisting of
unsigned shorts. When I try to open the resulting raw data as unsigned
shorts; they do not look correct. If I open them as signed shorts, all
is fine.
Perhaps the following workflow will be more clear:
] cp InputFile.mnc InputFile2.mnc
] cp InputFile.mnc InputFile3.mnc
] mnc2nii -signed -short -dual InputFile.mnc
<various output>
datatype = '4'
datatype_name = 'INT16'
<various output>
] mnc2nii -unsigned -short -dual InputFile2.mnc
<various output>
datatype = '512'
datatype_name = 'UINT16'
<various output>
] mnc2nii -float -dual InputFile3.mnc
<various output>
datatype = '16'
datatype_name = 'FLOAT32'
<various output>
] diff InputFile3.img InputFile2.img
Binary files InputFile3.img and InputFile2.img differ
] diff InputFile3.img InputFile.img
Binary files InputFile3.img and InputFile.img differ
] diff InputFile2.img InputFile.img
]
In the case above, 'diff' found no difference between int16 and
uint16. Shouldn't there be a difference? Running 'mincheader' on the
input files provide a variable (in case it matters):
variables:
short image(zspace, yspace, xspace) ;
image:signtype = "signed__" ;
Can anyone reproduce this? Should diff find a difference between int16
and uint16? In other words, are my unsigned integers in fact signed
when using mnc2nii?
Have a nice day,
--
Thorarin Bjarnason, BEng, MASc
www.imaginginformatics.ca
More information about the MINC-users
mailing list