denseImage: Dense images

denseImageR Documentation

Dense images

Description

A dense image is an array carrying image geometry alongside it. It is an S7 class whose parent is the array S3 class, which means every storage mode works (double, integer, logical and complex all occur in practice, masks being logical). The data are still a plain R array, so no copy is needed to pass them to compiled code, and the geometry is validated whenever it is set rather than only on construction.

Usage

denseImage(
  .data,
  voxelSize = NULL,
  worldTransform = NULL,
  spatial = NULL,
  spaceUnit = NULL,
  timeUnit = NULL,
  template = NULL
)

isDenseImage(x)

asDense(x, ...)

Arguments

.data

An array, or any atomic vector, which is treated as one-dimensional.

voxelSize

Voxel size, one per spatial dimension.

worldTransform

A 4x4 affine transform mapping voxel to world coordinates. Decomposed into rotation/translation and voxel size on assignment; see geometry.

spatial

The number of leading dimensions that index location rather than the value held at each location. Defaults to three, or the dimensionality if that is smaller.

spaceUnit, timeUnit

Units of measurement.

template

An image to take unspecified geometry from.

x

An image.

...

Further arguments to denseImage().

Details

Properties are stored as ordinary attributes, so compiled code reads them without needing to know anything about S7.

Value

An object of S7 class denseImage representing a dense image, with properties corresponding to the arguments listed above.

Note

S7 qualifies a class name with its package, so the class attribute is "imply::denseImage" and inherits(x, "denseImage") is FALSE. Use isDenseImage() rather than testing the class directly.


imply documentation built on Sept. 15, 2026, 5:09 p.m.