R/im3d.R
Make 2D (orthogonal) projection of 3D image data
projection(a, projdim = "z", projfun = c("integrate", "mean", "sum"), na.rm = T, mask = NULL, ...)
a | Array of image data (im3d format) |
---|---|
projdim | The image dimension down which to project |
projfun | The function that collapses each vector of image data down to a single pixel. Can be a character vector naming a function or a function. See details. |
na.rm | Logical indicating whether to ignore |
mask | A mask with the same extent as the image. |
... | Additional arguments for projfun |
Note that projfun
must have an argument na.rm
like the
S3 Summary groupGeneric
functions such as sum, min
etc.
Note also that the BoundingBox of a 2d projection is not well-defined for the axis along which the projection was made. Presently both the evaluation location and the BoundingBox extremes are set to 0 after a projection is made but FIXME this is not completely satisfactory. Perhaps defining this to be NA or the midpoint of the orginal axis would be better justified.
groupGeneric
, clampmax
Other im3d: as.im3d
,
boundingbox
, im3d-coords
,
im3d-io
, im3d
,
imexpand.grid
, imslice
,
is.im3d
, mask
,
origin
, threshold
,
unmask
, voxdims
# NOT RUN { LHMask=read.im3d(system.file('tests/testthat/testdata/nrrd/LHMask.nrrd',package='nat')) d=unmask(rnorm(sum(LHMask),mean=5,sd=5),LHMask) op=par(mfrow=c(1,2)) rval=image(projection(d,projfun=max)) image(projection(d,projfun=clampmax(0,10)),zlim=rval$zlim) par(op) # }# NOT RUN { LHMask=read.im3d(system.file('tests/testthat/testdata/nrrd/LHMask.nrrd',package='nat')) image(projection(LHMask),asp=TRUE) # }