[MINC-users] mincaverage gives float numbers for integers

Alex Zijdenbos alex at bic.mni.mcgill.ca
Thu Oct 14 23:31:45 EDT 2010


[ I had sent this reply a while ago but I don't think it made it
through to the list ]

On Thu, Sep 23, 2010 at 6:41 AM, Alex Zijdenbos <zijdenbos at gmail.com> wrote:
> Hello Ji Hyun,
>
> I am not sure if you got an answer already, but here is one: the
> floating point values you are seeing are due to the value scaling that
> MINC inherently does (in order to map the voxel value to the 'real'
> value), which sometimes cause trouble with discrete (label) volumes
> like the ones you have. You can usually fix this by removing the value
> mapping using something like
>
>   mincreshape -valid_range 0 255 -image_range 0 255 <in.mnc> <out.mnc>
>
> which will set the value mapping to the identity.
>
> As a second suggestion, you can do what you are trying to do with a
> single minccalc cal, for instance like so: create a file containing
> this expression:
>
> result=0;
> for { i in [0:len(A)) } {
>   if (A[i] > 0.5) { result = i+1 }
> };
> result
>
> and then call
>
>   minccalc -expfile <file_with_above_expression> <vol1.mnc>
> <vol2.mnc> ... <out.mnc>
>
> Hope this helps,
>
> -- A
>
> On Wed, Sep 15, 2010 at 6:49 PM, 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