Dear Krish,
> Dear Krish,
>
> > Using the Imcalc functions, is it possible to calculate an image
which
> > contains the maximum value of a set of target images?
> >
> > For example, suppose I have six con**.img files. Is it possible to
> > generate a "peak.img" file such that each voxel within peak.img
contains
> > the maximum value from the same voxel in each of the six con* files?
> >
> > For a two sample case, I tried the following:
> >
> > f='i1*(i1>=i2)+i2*(i2>=i1)';
> >
> > but that didn't work. I'm not much of a matlab expert, so apologies
if
> > there is a trivial solution.
>
> For the multiplication of vectors or matrices element by element
instead of
> the usual vector or matrix multiplication, you must use '.*' instead of
'*'.
>
> I guess, you will get the peak-image by using:
>
> f='i1.*(i1>=i2)+i2.*(i2>=i1)'
>
This may be me making a mistake but in the above formula, doesn't
something
weird happen if i1=i2? In this case doesn't f=i1*1+i2*1 i.e. f=i1+i2 ?
Don't you therefore need to change one of the ">=" expressions to ">"?
Please show me where I've gone wrong if this is wrong as I seek to learn
:-)
Mark
|