Hello Marko,
thanks a lot for your advice. Indeed, I didn't know that there's also
interpolation when displaying. I set interpolation method to NN for the
slover function, that I am using for overlays. Looks perfect now.
Best regards,
Jens
Am 16.04.2012 17:16, schrieb Marko Wilke:
> Hello Jens,
>
> what you see may not be what you got :) Or, in other words, the
> trouble with values ~=1 may be in the interpolation of values when
> creating the overlay (which of course means the trouble is not in
> ImCalc, but in how you look at the data afterwards). Try loading the
> mask image in spm and then change the interpolation (lower right) to
> NN; this usually makes all values below 1 suddenly go away. Another
> way to check is to load the image into a 3D array and check if there
> are any values between 0 and 1, using something like
>
> data = spm_read_vols(spm_vol(spm_select));
> junk = ((data>0) & (data<1));
> sum(junk(:))
>
> Also, you can make sure to obtain a binary mask if you do enter
> (i1.*(i2>0.5)) > 0 which should also work. I do not know how you
> created the overlay as I usually do those in MRIcron (which allows to
> set limits), so I cannot comment on that.
>
> Hope this helps,
> Marko
>
> Jens Kronschnabel wrote:
>> Dear SPM users,
>>
>> Using imcalc, I am trying to mask an image (i1.*(i2>0.5), where i1 =
>> image containing ones (dont ask why), i2 = mask). It basically works,
>> but at the borders of the mask, the ones of i1 are no ones anymore, but
>> smaller values (I assume due to some interpolation steps by imcalc; I
>> have used nearest neighbor interpolation and have also tried the other
>> ones). I would like to get rid of these interpolated (?) values <1 and
>> rather have the entire ROI purely red (see attached file). Can anyone
>> help? Workarounds are also fine (e.g. using some display function in SPM
>> for i1 and then apply a mask, but I don't have the i1 data in a SPM.mat
>> file (i1 itself is the result of an imcalc operation)).
>>
>> Thanks very much for help
>> Jens
>>
>>
>>
>>
>
--
Jens Kronschnabel, Ph.D. student
Department of Child and Adolescent Psychiatry, University of Zurich
Neumünsterallee 9, CH-8032 Zürich, Switzerland
+41 43 556 4081
[log in to unmask]
--
|