Learn R Programming

⚠️There's a newer version (0.8.5) of this package.Take me there.

neuroim2 (version 0.8.1)

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

225

Version

0.8.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Bradley Buchsbaum

Last Published

April 10th, 2025

Functions in neuroim2 (0.8.1)

BigNeuroVec

Create a Memory-Mapped Neuroimaging Vector
AxisSet5D-class

AxisSet5D Class
BinaryReader

Create Binary Reader Object
BinaryWriter-class

BinaryWriter Class
AxisSet1D-class

AxisSet1D
AxisSet2D-class

AxisSet2D
AxisSet4D-class

AxisSet4D Class
AxisSet3D-class

AxisSet3D Class
BinaryReader-class

BinaryReader Class
Compare-methods

Comparison Operations
BigNeuroVec-class

BigNeuroVec Class
DenseNeuroVol-class

DenseNeuroVol Class
FileBackedNeuroVec-class

FileBackedNeuroVec Class
DenseNeuroVec-class

DenseNeuroVec Class
MappedNeuroVec-class

MappedNeuroVec Class
LogicalNeuroVol-class

LogicalNeuroVol Class
FileSource-class

FileSource Class
ColumnReader-class

ColumnReader
ColumnReader

Create Column Reader Object
FileMetaInfo-class

FileMetaInfo Class
FileFormat-operations

File Format Operations for Neuroimaging Data
IndexLookupVol-class

IndexLookupVol Class
NeuroHyperVec

Constructor for NeuroHyperVec class
NeuroHyperVec-class

NeuroHyperVec Class
NeuroBucket-class

NeuroBucket
ClusteredNeuroVol-class

ClusteredNeuroVol Class
MetaInfo-class

MetaInfo Class
NamedAxis-class

NamedAxis
MappedNeuroVecSource-class

MappedNeuroVecSource Class
MetaInfo

Create Neuroimaging Metadata Object
BinaryWriter

Create Binary Writer Object
NIFTIMetaInfo

Create NIFTI Format Metadata Object
Kernel-class

Kernel
Kernel

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

NeuroSlice: 2D Neuroimaging Data Container
NeuroVecSeq

NeuroVecSeq: A Container for Sequential NeuroVec Objects
NeuroVecSource-class

NeuroVecSource Class
NeuroSpace-class

NeuroSpace Class
None

Pre-defined null axis
NeuroVolSource

Constructor for NeuroVolSource
NeuroVol

NeuroVol: 3D Neuroimaging Volume Class
NeuroVec-class

NeuroVec Class
OrientationList2D

Pre-defined 2D orientation configurations
NeuroVecSeq-class

NeuroVecSeq Class
[[,NeuroVecSeq,numeric-method

Extract Element from NeuroVecSeq
[[,SparseNeuroVec,numeric-method

[[
ROICoords-class

ROICoords
NeuroSpace

NeuroSpace: Spatial Reference System for Neuroimaging Data
ROI-class

ROI
SparseNeuroVecSource-class

SparseNeuroVecSource Class
as-ClusteredNeuroVol-DenseNeuroVol

Convert ClusteredNeuroVol to DenseNeuroVol
FileBackedNeuroVec

Create a File-Backed Neuroimaging Vector
SparseNeuroVol-class

SparseNeuroVol Class
TIME

Time axis
as,DenseNeuroVol,array

Convert DenseNeuroVol to array
OrientationList3D

Pre-defined 3D orientation configurations
ROIVec

Create an instance of class ROIVec
add_dim

Add a Dimension to an Object
ROIVol

Create ROI Volume Object
ROIVol-class

ROIVol
ROIVecWindow-class

ROIVecWindow
SparseNeuroVol,array

Convert SparseNeuroVol to array
anatomical_axes

Pre-defined anatomical axes
TimeAxis

Time axis set
as.sparse

Convert to from dense to sparse representation
NullAxis

Pre-defined null axis set
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
close,BinaryReader-method

Close a BinaryReader or BinaryWriter
coords

Extract coordinates from an object
createNIfTIHeader

Create an Empty NIfTI-1 Header List
bootstrap_searchlight

Create a bootstrap spherical searchlight iterator
coord_to_index

convert n-dimensional real world coordinates to 1D indices
as.sparse,DenseNeuroVec,LogicalNeuroVol-method

Convert DenseNeuroVec to sparse representation using mask
centroids

Return a matrix of centroids of an object
centroid

return the centroid of an object
dim_of

Get the length of a given dimension of an object
as.raster

Generic Method for Converting Objects to Raster Format
drop,NeuroVec-method

Drop a dimension
bounds

Extract Spatial Bounds of an Image
NeuroVecSource

NeuroVecSource
NeuroSlice-class

NeuroSlice Class
NeuroVol-class

NeuroVol Class
NeuroObj-class

NeuroObj Class
FileFormat-class

FileFormat Class
clustered_searchlight

Create a clustered searchlight iterator
ROICoords

Create ROI Coordinates Object
ROIVec-class

ROIVec
SparseNeuroVol,numeric

Convert SparseNeuroVol to numeric
guided_filter

Edge-Preserving Guided Filter for Volumetric Images
conn_comp_3D

Extract Connected Components from a 3D Binary Mask
ROIVolWindow-class

ROIVolWindow
coord_to_grid

convert n-dimensional real world coordinates to grid coordinates
grid_to_grid

Generic function to convert voxel coordinates in the reference space (LPI) to native array space.
[

Extract or replace parts of an object
embed_kernel

Generic function to position kernel in a position in image space
SparseNeuroVec-class

SparseNeuroVec Class
as

conversion from NeuroVol to LogicalNeuroVol
grid_to_index

Generic function to convert N-dimensional grid coordinates to 1D indices
as.logical,NeuroVol-method

as.logical
as.dense,ClusteredNeuroVol-method

Coerce ROIVol to DenseNeuroVol using as.dense method
cuboid_roi

Create A Cuboid Region of Interest
data_file

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

Create a Data Reader
coords,IndexLookupVol-method

Extract Coordinates from an IndexLookupVol Object
dim,FileMetaInfo-method

Get Dimensions of FileMetaInfo Object
concat

Concatenate two objects in the time dimension
as.mask,NeuroVol,missing-method

Convert NeuroVol to a mask
conn_comp

Connected components
header_file

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

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

Convert 1d indices to n-dimensional grid coordinates
lookup

Index Lookup operation
linear_access,FileBackedNeuroVec,numeric-method

Linear Access Method for FileBackedNeuroVec
length,NeuroVec-method

Get length of NeuroVec object
gaussian_blur

Gaussian Blur for Volumetric Images
grid_to_coord

Generic function to convert N-dimensional grid coordinates to real world coordinates
Summary,SparseNeuroVec-method

Summary method for Neuroimaging objects
extractor3d

Array-like access for 3-dimensional data structures
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
extractor4d

Array-like access for 4-dimensional data structures
inverse_trans

Extract inverse image coordinate transformation
laplace_enhance

Laplacian Enhancement Filter for Volumetric Images
findAnatomy3D

Find 3D anatomical orientation from axis abbreviations
ndim

Extract the number of dimensions of an object
mapf

Apply a function to an object.
lookup,IndexLookupVol,numeric-method

Lookup Values in an IndexLookupVol Object
load_data

Read data from a data source.
perm_mat

Extract permutation matrix associated with an image
plot,NeuroSlice-method

Plot a NeuroSlice
neuro-ops

Arithmetic and Comparison Operations for Neuroimaging Objects
map_values

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

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

Resampling Methods for Neuroimaging Objects
slices

Extract an ordered series of 2D slices from a 3D or 4D object
searchlight

Create an exhaustive searchlight iterator
neuroim2-package

neuroim2: neuroimaging data structures for analysis
searchlight-methods

Searchlight Analysis Methods
indices,IndexLookupVol-method

Get Indices from an IndexLookupVol Object
matrixToQuatern

Convert a Transformation Matrix to a Quaternion Representation
ndim,AxisSet-method

Get number of dimensions in axis set
indices

Extract indices
quaternToMatrix

Convert Quaternion Parameters to a Transformation Matrix
patch_set,NeuroVol,numeric,missing-method

Create a patch set from a NeuroVol object
patch_set

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

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

Create a spherical random searchlight iterator
space

Extract Geometric Properties of an Image
origin

Extract Image Origin
as.matrix,MappedNeuroVec-method

convert a NeuroVec to a matrix
axes

Extract Image Axes
bilateral_filter

Apply a bilateral filter to a volumetric image
as.mask

Convert to a LogicalNeuroVol
as.list,FileBackedNeuroVec-method

Convert FileBackedNeuroVec to List
as.dense

Convert to dense representation
partition

Partition an image into a set of disjoint clusters
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
resample

Resample an Image to Match the Space of Another Image
strip_extension

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

Number of Clusters
numericOrMatrix-class

numericOrMatrix Union
split_scale

Center and/or Scale Row-subsets of a Matrix or Matrix-like Object
show,NamedAxis-method

Show method for NamedAxis objects
slice

Extract image slice
square_roi

Create a square region of interest
read_elements

Read a sequence of elements from an input source
vols

Extract an ordered series of 3D volumes.
[,AbstractSparseNeuroVec,numeric,numeric,ANY-method

Extractor Method for AbstractSparseNeuroVec
vectors

Extract an ordered list of 1D vectors.
series_roi

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

Extract one or more series from object
trans

Extract image coordinate transformation
values

Extract Data Values of an Object
read_meta_info

Generic function to read image meta info given a file
read_vec

read_vec
read_vol

Load an image volume from a file
image

Generic Image Method for Creating Visual Representations
data_reader,NIFTIMetaInfo-method

Create Data Reader for AFNI Format
perm_mat,AxisSet2D-method

Get permutation matrix from axis set
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
linear_access

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

Generic Drop Method
load_data,MappedNeuroVecSource-method

Load image data from a NeuroVecSource object
drop_dim

Drop a Dimension from an Object
read_columns

Read a set of column vector from an input source (e.g. ColumnReader)
perm_mat,AxisSet3D-method

Get permutation matrix from axis set
read_vol_list

read_vol_list
read_elements,BinaryReader,numeric-method

Read Elements from Binary Reader
spherical_roi_set

Create Multiple Spherical Regions of Interest
split_fill

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

Generic Scale Method
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.
spherical_roi

Create a Spherical Region of Interest
split_reduce

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

Create an exhaustive searchlight iterator for voxel coordinates using spherical_roi
spatial-filter

Spatial Filtering Methods for Neuroimaging Data
spacing

Extract Voxel Dimensions of an Image
read_header

read header information of an image file
which_dim

Find Dimensions of a Given Axis
voxels

extract voxel coordinates
[[,NeuroVec,numeric-method

[[
series,NeuroHyperVec,ANY-method

Series method for NeuroHyperVec
sub_vector

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

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

Write a 3d image volume to disk
write_vec

Write a 4d image vector to disk
write_elements

Write a sequence of elements from an input source
split_clusters

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

Create AFNI Format Metadata Object
ArrayLike5D-class

ArrayLike5D Class
AxisSet-class

AxisSet
AbstractSparseNeuroVec-class

AbstractSparseNeuroVec Class
Arith-methods

Arithmetic Operations
Arith,NeuroVec,NeuroVol-method

Arithmetic Operations for NeuroVec and NeuroVol
Arith,NeuroVol,NeuroVec-method

Arithmetic Operations for NeuroVol and NeuroVec
ArrayLike4D-class

ArrayLike4D Class
ArrayLike3D-class

ArrayLike3D Class
Arith,ROIVol,ROIVol-method

This function performs arithmetic operations on two ROIVol objects.