Learn R Programming

voxel (version 1.3.5)

ts2matrix: Timeseries to Matrix

Description

This function is able to mask a 4-Dimensional image and create a matrix from it. Each column represents the same voxel in the xyz array while the rows represent the t-dimension.

Usage

ts2matrix(image, mask)

Arguments

image

Input image of type 'nifti'

mask

Input mask of type 'nifti'. Must be a binary mask

Examples

Run this code
# NOT RUN {

image <- oro.nifti::nifti(img = array(1:64, dim =c(4,4,4,5)))
mask <- oro.nifti::nifti(img = array(0:1, dim = c(4,4,4)))
matrix <- ts2matrix(image, mask)
# }

Run the code above in your browser using DataLab