[MINC-users] multiply with 0 not equal to 0?
Andrew Janke
a.janke at gmail.com
Wed Mar 12 16:52:03 EDT 2008
Hi Mishkin,
On Thu, Mar 13, 2008 at 7:35 AM, Mishkin Derakhshan <mishkind at gmail.com> wrote:
> Hi,
>
> I have a binary mask that I multiply with a volume and I am expecting
> that in the resultant image, everywhere that the mask was 0, the
> resulting image should be zero as well. Instead, it is some number
> close to zero but not necessarily 0.
>
> I am not sure if this is a problem with how register/display display
> the values or with the data itself.
I would take a bet that you are being bitten by a combination of both.
Certainly register always rescales all values between 0 and 255
internally.
> I used this command
> mincmath -mult mask.mnc volume.mnc out.mnc
>
> (minccalc -expression "A[0]*A[1]" mask.mnc volume.mnc out.mnc doesn't
> seem to work either).
>
> The mask is a unisgned byte, real range 0 to 1, voxel range 0 to 255.
> The volume is a signed short. real range -91.323 to 1364.351, voxel
> range 0 to 4095.
My first suggestion would be to use mincextract to determine the real
values that are being produced in the resulting file and then if this
is wrong start investigating further. ie: to get the value at voxel
coord 0,0,0 (which i presume will/should be a "0") do this:
$ mincextract -start 0,0,0 -count 1,1,1 out.mnc
Then if this is working you can either rescale your output volume to
force it to lie between 0 and 255 as a byte (so that register will
display the result "correctly" or simply ignore the value from
register! :)
--
Andrew Janke (a.janke at gmail.com || http://a.janke.googlepages.com/)
Canberra->Australia +61 (402) 700 883
More information about the MINC-users
mailing list