[MINC-users] mnc2nii. int vs uint vs float

Soren Christensen sorench at gmail.com
Wed Sep 6 17:48:16 EDT 2006


Hi Thorain,
 I think that will depend on the values in your image. If you are within the
posetive range only of your signed integer datatype then the binary coding
does not differ from that of unsigned coding in the mentioned range.  This
will often be the case in images from the scanner. So in other words maybe
the reason is a limited range of your image?

Best regards
Soren



On 9/6/06, Thorarin Bjarnason <thor4ooo at gmail.com> wrote:
>
> 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
> _______________________________________________
> MINC-users at bic.mni.mcgill.ca
> http://www.bic.mni.mcgill.ca/mailman/listinfo/minc-users
>


More information about the MINC-users mailing list