subset_4d-methods: Subset a 4D image

subset_4d-methodsR Documentation

Subset a 4D image

Description

Subsets an antsImage or nifti object from 4D

Usage

subset_4d(img, ind, ...)

## S4 method for signature 'character'
subset_4d(img, ind, ...)

## S4 method for signature 'nifti'
subset_4d(img, ind, ...)

## S4 method for signature 'antsImage'
subset_4d(img, ind, ...)

.subset_4d(img, ind)

Arguments

img

character path of image or an object of class nifti, or antsImage

ind

subset indexers for the 4th dimension (usually time)

...

Arguments passed to copyNIfTIHeader or antsCopyImageInfo

Value

An antsImage or nifti depending on input

Author(s)

John Muschelli muschellij2@gmail.com

Examples

library(oro.nifti)
n = 20
x = nifti(array(rnorm(n^3*10), dim = c(n, n, n, 10)))
ind = 2:3
subset_4d(x, ind)
subset_4d(x, ind = 1) 

muschellij2/extrantsr documentation built on June 3, 2024, 7:04 p.m.