MetaInfo: Create Neuroimaging Metadata Object

View source: R/meta_info.R

MetaInfoR Documentation

Create Neuroimaging Metadata Object

Description

Creates a MetaInfo object containing essential metadata for neuroimaging data, including dimensions, spacing, orientation, and data type information.

Usage

MetaInfo(
  Dim,
  spacing,
  origin = rep(0, length(spacing)),
  data_type = "FLOAT",
  label = "",
  spatial_axes = OrientationList3D$AXIAL_LPI,
  additional_axes = NullAxis
)

Arguments

Dim

Integer vector. Image dimensions (e.g., c(64, 64, 32) for 3D).

spacing

Numeric vector. Voxel dimensions in mm.

origin

Numeric vector. Coordinate origin. Default is zero vector.

data_type

Character. Data type (e.g., "FLOAT", "SHORT"). Default is "FLOAT".

label

Character. Image label(s). Default is "".

spatial_axes

Object. Spatial orientation. Default is OrientationList3D$AXIAL_LPI.

additional_axes

Object. Non-spatial axes. Default is NullAxis.

Details

Create MetaInfo Object

The MetaInfo object is fundamental for:

  • Spatial interpretation of image data

  • Data type handling and conversion

  • Memory allocation and mapping

  • File I/O operations

Input validation ensures:

  • Dimensions are positive integers

  • Spacing values are positive

  • Origin coordinates are finite

  • Data type is supported

Value

A MetaInfo object

See Also

NIFTIMetaInfo, AFNIMetaInfo

Examples

# Create metadata for 3D structural MRI
meta <- MetaInfo(
  Dim = c(256, 256, 180),
  spacing = c(1, 1, 1),
  data_type = "FLOAT",
  label = "T1w"
)

# Get image dimensions
dim(meta)

# Get transformation matrix
trans(meta)


bbuchsbaum/neuroim2 documentation built on Jan. 2, 2025, 3:38 p.m.