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
>
>
>
>
--
____________________________________________________
PD Dr. med. Marko Wilke
Facharzt für Kinder- und Jugendmedizin
Leiter, Experimentelle Pädiatrische Neurobildgebung
Universitäts-Kinderklinik
Abt. III (Neuropädiatrie)
Marko Wilke, MD, PhD
Pediatrician
Head, Experimental Pediatric Neuroimaging
University Children's Hospital
Dept. III (Pediatric Neurology)
Hoppe-Seyler-Str. 1
D - 72076 Tübingen, Germany
Tel. +49 7071 29-83416
Fax +49 7071 29-5473
[log in to unmask]
http://www.medizin.uni-tuebingen.de/kinder/epn/
____________________________________________________
|