The argument X
should be a list of pixel images
(objects of class "im"
). If the images do not have
identical pixel grids, they will be converted to a common
grid using harmonise.im
.
At each pixel location, the values of the images in X
at that pixel will be extracted as a vector; the function
FUN
will be applied to this vector; and the return value of
FUN
will become the pixel value of the resulting image.
For example im.apply(X, mean)
will return a pixel image
in which the value of each pixel is the average of the corresponding
pixel values in the images in X
.
If the result of FUN
is a vector, then the result of
im.apply
will be a list of images. For example im.apply(X, range)
will
return a list of two images containing the pixelwise minimum
and pixelwise maximum, respectively, of the input images in X
.
The argument fun.handles.na
specifies what to do
when some of the pixel values are NA
.
If fun.handles.na=FALSE
(the default),
the function FUN
is never applied to data that include
NA
values; the result is defined to be NA
whenever
the data contain NA
.
If fun.handles.na=TRUE
, the function FUN
will be applied to
all pixel data, including those which contain NA
values.