[MINC-users] mincaverage gives float numbers for integers

Andrew Janke a.janke at gmail.com
Thu Oct 14 23:04:16 EDT 2010


Hi Ji,

Sorry I seemed to have missed replying to this post but in case you
don't have an answer to this yet, here goes.

I am guessing that your original image will be either in short or byte
format (use 'mincinfo' to determine this). What this means is that the
entire image range of your file will be stored in byte or short
format, the actual range of the image will then be mapped onto this
range. So this will cause some of the issues that you are seeing.

to make it more interesting, register and Display both first map your
volume to byte (0-255) when reading them in so the values to read off
Display and register will only have byte precision. This is the more
likely cause of the discrepancy you are seeing. In order to get the
real values and not just the display/register value you should use a
C/L tool such as mincextract.

If you really do want to preserve absolute values, your best bet is to
convert the volume to float first and then back to short/byte when you
are done.

   mincreshape -float in.mnc out.mnc

Should take care of this for you. In the meantime the values you are
seeing may well still be fine if you are using them with mincstats if
you use the -mask_binvale option. This will assume that anything
between 0.5 and 1.5 is 1 for example.


Andrew

On Thu, Sep 16, 2010 at 09:49, Ji Hyum KO <kojinet at bic.mni.mcgill.ca> wrote:
> Hi,
>
> What I am trying to do is to combind masks (segmented) that are in five
> seperate volume.
> So, volume 1 has grey matter, volume 2 has white matter, volume 3 has
> striatum, etc...
>
> Each volume do not have overlapping voxels.
>
> In order to give different integer values, I multiplied the masks with 1, 2,
> 3, 4 or 5.
> Then, mincaverage all volume, then mincmath -mult -const 5...
>
> The resulted image has weird float values such as 2.0252...
>
> How can I make them clean integer values like 2.000000
>
> Best,
>
> Ji Hyun
> _______________________________________________
> 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