Do the masks contain any non-finite values? Imcalc samples data using
trilinear interpolation, which involves taking some weighted average of the 8
closest voxels. If any of these are not finite, then the resulting voxel
will be non-finite (even if the weight for the non-finite voxel is zero,
because 0*NaN gives NaN). In one dimension, the closest voxels to a position
"x" are determined by floor(x) and floor(x)+1. If x is an integer (as in
your case), then the neighbours are given by x and x+1. For this case, the
interpolated value is 1*f(x)+0*f(x+1). If f(x+1) is non-finite, then the
result is non-finite. The result is that the masked region may be shrunk on
one side (three sides actually), giving the impression of a translation.
I think this is the explanation, but I may be wrong.
Best regards,
-John
> I am struggling with an issue I would like to get input on: I want to
> mask one image (say, a t-map) with another one (say, a binary mask). If
> I check them using check_reg, they line up just fine. They also have the
> same dimensions.
>
> However, if I do i1.*i2 (and, possibly taking another mask in,
> i1.*i2.*i3), the results are very weird in that the resulting voxels are
> heavily shifted away from the origin, mainly to the right, while they
> should near the midline. There are no mat-files anywhere to be found
> (there were none to start with), and I have yet to find the logic of
> this behavior as to when it arises and when not.
>
> I would really appreciate your help since this starts to drive me nuts.
> Thanks a lot! in advance,
|