Learn R Programming

neuroim2 (version 0.8.5)

Data Structures for Brain Imaging Data

Description

A collection of data structures and methods for handling volumetric brain imaging data, with a focus on functional magnetic resonance imaging (fMRI). Provides efficient representations for three-dimensional and four-dimensional neuroimaging data through sparse and dense array implementations, memory-mapped file access for large datasets, and spatial transformation capabilities. Implements methods for image resampling, spatial filtering, region of interest analysis, and connected component labeling. General introduction to fMRI analysis can be found in Poldrack et al. (2024, "Handbook of functional MRI data analysis", ).

Copy Link

Version

Install

install.packages('neuroim2')

Monthly Downloads

295

Version

0.8.5

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Bradley Buchsbaum

Last Published

January 14th, 2026

Functions in neuroim2 (0.8.5)

AxisSet5D-class

AxisSet5D Class
BigNeuroVec-class

BigNeuroVec Class
AxisSet4D-class

AxisSet4D Class
AxisSet3D-class

AxisSet3D Class
AxisSet1D-class

AxisSet1D
BinaryWriter-class

BinaryWriter Class
ClusteredNeuroVec

ClusteredNeuroVec: Cluster-aware 4D neuroimaging data
ClusteredNeuroVol-class

ClusteredNeuroVol Class
BinaryReader

Create Binary Reader Object
BigNeuroVec

Create a Memory-Mapped Neuroimaging Vector
BinaryReader-class

BinaryReader Class
DenseNeuroVol-class

DenseNeuroVol Class
FileBackedNeuroVec-class

FileBackedNeuroVec Class
FileFormat-class

FileFormat Class
FileFormat-operations

File Format Operations for Neuroimaging Data
AxisSet2D-class

AxisSet2D
FileBackedNeuroVec

Create a File-Backed Neuroimaging Vector
ClusteredNeuroVec-class

ClusteredNeuroVec Class
BinaryWriter

Create Binary Writer Object
Compare-methods

Comparison Operations
DenseNeuroVec-class

DenseNeuroVec Class
FileMetaInfo-class

FileMetaInfo Class
MetaInfo

Create Neuroimaging Metadata Object
IndexLookupVol-class

IndexLookupVol Class
FileSource-class

FileSource Class
NeuroHyperVec-class

NeuroHyperVec Class
NeuroHyperVec

Constructor for NeuroHyperVec class
NamedAxis-class

NamedAxis
NeuroBucket-class

NeuroBucket
NIFTIMetaInfo

Create NIFTI Format Metadata Object
ColumnReader-class

ColumnReader
LogicalNeuroVol-class

LogicalNeuroVol Class
Kernel-class

Kernel
ColumnReader

Create Column Reader Object
MappedNeuroVec-class

MappedNeuroVec Class
OrientationList3D

Pre-defined 3D orientation configurations
NeuroVecSeq-class

NeuroVecSeq Class
[[,NeuroVecSeq,numeric-method

Extract Element from NeuroVecSeq
Kernel

Create a Kernel object from a function of distance from kernel center
NeuroSlice

NeuroSlice: 2D Neuroimaging Data Container
MappedNeuroVecSource-class

MappedNeuroVecSource Class
NeuroSpace-class

NeuroSpace Class
OrientationList2D

Pre-defined 2D orientation configurations
NeuroObj-class

NeuroObj Class
NeuroVecSource-class

NeuroVecSource Class
NeuroSlice-class

NeuroSlice Class
NeuroVecSeq

NeuroVecSeq: A Container for Sequential NeuroVec Objects
MetaInfo-class

MetaInfo Class
ROIVol-class

ROIVol
None

Pre-defined null axis
NullAxis

Pre-defined null axis set
SparseNeuroVec-class

SparseNeuroVec Class
ROIVolWindow-class

ROIVolWindow
ROIVol

Create ROI Volume Object
ROICoords

Create ROI Coordinates Object
ROIVec-class

ROIVec
NeuroVol

NeuroVol: 3D Neuroimaging Volume Class
add_dim

Add a Dimension to an Object
NeuroVolSource

Constructor for NeuroVolSource
TimeAxis

Time axis set
TIME

Time axis
NeuroVecSource

NeuroVecSource
anatomical_axes

Pre-defined anatomical axes
as.array

Generic as.array Method
as.dense,ClusteredNeuroVol-method

Coerce SparseNeuroVol to DenseNeuroVol
NeuroVol-class

NeuroVol Class
SparseNeuroVol,numeric

Convert SparseNeuroVol to numeric
annotate_orientation

Add L/R and A/P/S/I annotations (optional)
as.mask

Convert to a LogicalNeuroVol
as.matrix,ClusteredNeuroVec-method

convert a NeuroVec to a matrix
as,DenseNeuroVol,array

Convert DenseNeuroVol to array
Summary-methods

Summary Methods for Neuroimaging Objects
as-ClusteredNeuroVol-DenseNeuroVol

Convert ClusteredNeuroVol to DenseNeuroVol
bilateral_filter

Apply a bilateral filter to a volumetric image
axes

Extract Image Axes
as.sparse

Convert to from dense to sparse representation
as.vector,SparseNeuroVol-method

Convert SparseNeuroVol to a base vector
as

conversion from NeuroVol to LogicalNeuroVol
as_nifti_header

Construct a Minimal NIfTI-1 Header from a NeuroVol
as.matrix

Generic as.matrix Method
as.numeric,SparseNeuroVol-method

Convert SparseNeuroVol to numeric
as_mmap

Convert a NeuroVec to a memory-mapped representation
coord_to_index

convert n-dimensional real world coordinates to 1D indices
coord_to_grid

convert n-dimensional real world coordinates to grid coordinates
concat

Concatenate two objects in the time dimension
clustered_searchlight

Create a clustered searchlight iterator
dim,ClusteredNeuroVec-method

Get Dimensions of FileMetaInfo Object
NiftiExtensionList-class

NiftiExtensionList Class
NeuroVec-class

NeuroVec Class
NeuroSpace

NeuroSpace: Spatial Reference System for Neuroimaging Data
NiftiExtensionCodes

Known NIfTI Extension Codes
data_file

Generic function to get the name of the data file, given a file name and a FileFormat instance.
data_file_matches

Generic function to test whether a file name conforms to the given a FileFormat instance. Will test for match to data file only
ROI-class

ROI
NiftiExtension

Create a NIfTI Extension
NiftiExtension-class

NiftiExtension Class
ROICoords-class

ROICoords
SparseNeuroVol,array

Convert SparseNeuroVol to array
extension

Get Extension by Code
dim_of

Get the length of a given dimension of an object
ROIVec

Create an instance of class ROIVec
ROIVecWindow-class

ROIVecWindow
SparseNeuroVecSource-class

SparseNeuroVecSource Class
[[,SparseNeuroVec,numeric-method

[[
as.array,ClusteredNeuroVol-method

Convert ClusteredNeuroVol to a base array
extensions

Get Extensions from an Object
as.mask,NeuroVol,missing-method

Convert NeuroVol to a mask
SparseNeuroVol-class

SparseNeuroVol Class
as.dense

Convert to dense representation
as.list,FileBackedNeuroVec-method

Convert FileBackedNeuroVec to List
as.logical,NeuroVol-method

as.logical
cgb_make_graph

Build a correlation-guided bilateral (CGB) graph
conn_comp

Connected components
cgb_filter

Correlation-guided bilateral filtering (convenience wrapper)
as.sparse,DenseNeuroVec,LogicalNeuroVol-method

Convert DenseNeuroVec to sparse representation using mask
as.array,SparseNeuroVol-method

Convert SparseNeuroVol to a base array
as.raster

Generic Method for Converting Objects to Raster Format
bilateral_filter_4d

Apply a 4D bilateral filter to a NeuroVec
guided_filter

Edge-Preserving Guided Filter for Volumetric Images
centroid

return the centroid of an object
centroids

Return a matrix of centroids of an object
[,DenseNeuroVol,numeric,missing,ANY-method

Extract or replace parts of an object
data_reader,NIFTIMetaInfo-method

Create Data Reader for AFNI Format
conn_comp_3D

Extract Connected Components from a 3D Binary Mask
data_reader

Create a Data Reader
bounds

Extract Spatial Bounds of an Image
ecode_name

Get Extension Code Name
ndim

Extract the number of dimensions of an object
ndim,AxisSet-method

Get number of dimensions in axis set
embed_kernel

Generic function to position kernel in a position in image space
createNIfTIHeader

Create an Empty NIfTI-1 Header List
cgb_smooth_loro

Leave-one-run-out smoothing helper
downsample

Downsample an Image
cgb_smooth

Apply a precomputed CGB graph to volumetric data
cuboid_roi

Create A Cuboid Region of Interest
close,BinaryReader-method

Close a BinaryReader or BinaryWriter
indices

Extract indices
grid_to_coord

Generic function to convert N-dimensional grid coordinates to real world coordinates
inverse_trans

Extract inverse image coordinate transformation
get_afni_attribute

Get AFNI Attribute from Extension
drop

Generic Drop Method
coords

Extract coordinates from an object
cluster_searchlight_series

Cluster-centroid searchlight over cluster time-series
coords,IndexLookupVol-method

Extract Coordinates from an IndexLookupVol Object
extractor3d

Array-like access for 3-dimensional data structures
num_clusters

Number of Clusters
numericOrMatrix-class

numericOrMatrix Union
has_extensions

Check if Extensions are Present
drop_dim

Drop a Dimension from an Object
gaussian_blur

Gaussian Blur for Volumetric Images
findAnatomy3D

Find 3D anatomical orientation from axis abbreviations
index_to_grid

Convert 1d indices to n-dimensional grid coordinates
indices,IndexLookupVol-method

Get Indices from an IndexLookupVol Object
meta_info

Lightweight metadata for neuroimaging files
length,ClusteredNeuroVec-method

Get length of NeuroVec object
linear_access,DenseNeuroVol,numeric-method

Linear Access Method for FileBackedNeuroVec
matrixToQuatern

Convert a Transformation Matrix to a Quaternion Representation
extractor4d

Array-like access for 4-dimensional data structures
drop,NeuroVec-method

Drop a dimension
laplace_enhance

Laplacian Enhancement Filter for Volumetric Images
grid_to_grid

Generic function to convert voxel coordinates in the reference space (LPI) to native array space.
labels,ClusteredNeuroVec-method

Get Labels from ClusteredNeuroVec
mapToColors

Map intensity values to colors
list_afni_attributes

List AFNI Attributes in Extension
linear_access

Extract values from an array-like object using linear indexing.
parse_extension

Parse NIfTI Extension Data
plot_montage

Plot a montage of axial (or any-plane) slices using facetting
load_data,MappedNeuroVecSource-method

Load image data from a NeuroVecSource object
neuro-downsample

Downsampling Methods for Neuroimaging Objects
grid_to_index

Generic function to convert N-dimensional grid coordinates to 1D indices
load_data

Read data from a data source.
header_file

Generic function to get the name of the header file, given a file name and a FileFormat instance.
header_file_matches

Generic function to test whether a file name conforms to the given FileFormat instance. Will test for match to header file only
image

Generic Image Method for Creating Visual Representations
index_to_coord

convert 1d indices to n-dimensional real world coordinates
file_matches

Generic function to test whether a file name conforms to the given FileFormat instance. Will test for match to either header file or data file
partition

Partition an image into a set of disjoint clusters
make_time_weights

Build smooth time weights from motion/outlier metrics
mask

Extract Mask from Neuroimaging Object
matricized_access

Extract values from a 4D tensor using a matrix of time-space indices.
mapf

Apply a function to an object.
neuro-ops

Arithmetic and Comparison Operations for Neuroimaging Objects
resampled_searchlight

Create a resampled searchlight iterator
read_elements

Read a sequence of elements from an input source
lookup,IndexLookupVol,numeric-method

Lookup Values in an IndexLookupVol Object
plot_ortho

Orthogonal three-plane view with optional crosshairs
read_header

read header information of an image file
neuroim2-package

neuroim2: neuroimaging data structures for analysis
map_values

Map Values from One Set to Another Using a User-supplied Lookup Table
neuro-resample

Resampling Methods for Neuroimaging Objects
split_blocks

Cut a vector-valued object into a list of sub-blocks
spherical_roi_set

Create Multiple Spherical Regions of Interest
sub_vector

Generic function to extract a sub-vector from a NeuroVec object.
searchlight

Create an exhaustive searchlight iterator
perm_mat,AxisSet2D-method

Get permutation matrix from axis set
read_vec

read_vec
read_vol

Load an image volume from a file
perm_mat,AxisSet3D-method

Get permutation matrix from axis set
origin

Extract Image Origin
searchlight_coords

Create an exhaustive searchlight iterator for voxel coordinates using spherical_roi
space

Extract Geometric Properties of an Image
spacing

Extract Voxel Dimensions of an Image
theme_neuro

A minimal, publication-friendly theme for image slices
perm_mat

Extract permutation matrix associated with an image
read_meta_info

Generic function to read image meta info given a file
write_vol

Write a 3d image volume to disk
write_vec

Write a 4d image vector to disk
searchlight-methods

Searchlight Analysis Methods
read_image

read_image
scale_series

Generic functions to scale (center and/or normalize by standard deviation) each series of a 4D image That is, if the 4th dimension is 'time' each series is a 1D time series.
plot,NeuroSlice-method

Plot a NeuroSlice
simulate_fmri

Simulate fMRI Data
show,NamedAxis-method

Show method for NamedAxis objects
values

Extract Data Values of an Object
trans

Extract image coordinate transformation
split_scale

Center and/or Scale Row-subsets of a Matrix or Matrix-like Object
split_reduce

Summarize Subsets of an Object by Splitting by Row and Applying a Summary Function
resolve_cmap

Neuroimaging color palettes and helpers
parse_afni_extension

Parse AFNI Extension
patch_set,NeuroVol,numeric,missing-method

Create a patch set from a NeuroVol object
quaternToMatrix

Convert Quaternion Parameters to a Transformation Matrix
patch_set

Generate a set of coordinate "patches" of fixed size from an image object.
lookup

Index Lookup operation
[,AbstractSparseNeuroVec,numeric,numeric,ANY-method

Extractor Method for AbstractSparseNeuroVec
which_dim

Find Dimensions of a Given Axis
write_elements

Write a sequence of elements from an input source
[[,NeuroVec,numeric-method

[[
read_vol_list

read_vol_list
random_searchlight

Create a spherical random searchlight iterator
reorient

Remap the grid-to-world coordinates mapping of an image.
plot_overlay

Composite an overlay map on a structural background
searchlight_shape_functions

Convenience shape generators for resampled_searchlight()
series,NeuroHyperVec,ANY-method

Series method for NeuroHyperVec
prepare_confounds

Prepare weighted nuisance projectors for each run
read_elements,BinaryReader,numeric-method

Read Elements from Binary Reader
read_columns

Read a set of column vector from an input source (e.g. ColumnReader)
scale

Generic Scale Method
scale_fill_neuro

A ggplot2 fill scale with neuroimaging-friendly defaults
vectors

Extract an ordered list of 1D vectors.
strip_extension

Generic function to strip extension from file name, given a FileFormat instance.
resample_to

Resample an image with readable method names
square_roi

Create a square region of interest
series_roi

Extract time series from specific voxel coordinates and return as ROI object
series

Extract one or more series from object
resample

Resample an Image to Match the Space of Another Image
vec_from_vols

Create NeuroVec from list of NeuroVol objects
spatial-filter

Spatial Filtering Methods for Neuroimaging Data
voxels

extract voxel coordinates
vols

Extract an ordered series of 3D volumes.
spherical_roi

Create a Spherical Region of Interest
slice

Extract image slice
split_clusters

Cut an object into a list of spatial or spatiotemporal clusters
split_fill

Fill Disjoint Sets of Values with the Output of a Function
slices

Extract an ordered series of 2D slices from a 3D or 4D object
ArrayLike3D-class

ArrayLike3D Class
AFNIMetaInfo

Create AFNI Format Metadata Object
Arith,NeuroVec,NeuroVol-method

Arithmetic Operations for NeuroVec and NeuroVol
ArrayLike5D-class

ArrayLike5D Class
AxisSet-class

AxisSet
Arith,ROIVol,ROIVol-method

This function performs arithmetic operations on two ROIVol objects.
Arith-methods

Arithmetic Operations
Arith,NeuroVol,NeuroVec-method

Arithmetic Operations for NeuroVol and NeuroVec
ArrayLike4D-class

ArrayLike4D Class
AbstractSparseNeuroVec-class

AbstractSparseNeuroVec Class