[MINC-users] multi-input output type/range

Alex Zijdenbos zijdenbos at gmail.com
Tue Nov 20 09:03:13 EST 2012


On Tue, Nov 20, 2012 at 1:39 AM, Andrew Janke <a.janke at gmail.com> wrote:
>> What would be happening is something like this:
>>
>> minccalc -expression "abs(A[0] - 2) < 0.5 ? A[1] : 0" <cls.mnc>
>> <in.mnc> <masked.mnc>
>>
>> where <cls.mnc> happened to be "unsigned byte 0 4"; now resulting in
>> <masked.mnc> quantized to 5 values.
>
> Hrm, well the range bit could probably be changed but again it's hard
> to think of a way where we can handle all possibilities.

Agreed - but I think it is not so difficult to think of a way that
handles a lot more possibilities than the current implementation :)

> So what's the default? the full range of the type?  I can see this
> breaking when I use minccalc on label volumes with restricted ranges
> that I depend upon.

The way I have implemented in scripts, is to look through the input
volumes, find the "largest" data type among them; then find the
largest range among the volumes that have that data type, and pass the
result  along to the output file via -<datatype> -range <min> <max>.
(for float/double no need for -range of course). Works well in all
cases I have so far come across. Also handles the non-commutative
nature of mincmath/calc.

> I am curious to know what happens (But haven't checked) if in the
> above case you add a -byte option. Does this reset the range?

Yup - you'd have to specify -range as well to control that again.

-- A


More information about the MINC-users mailing list