Learn R Programming

neurobase (version 1.32.4)

replace_dropped_dimensions: Remake Dropped Dimensions

Description

This function is the reverse of dropEmptyImageDimensions. If dropEmptyImageDimensions was run, and the output is a list, usually if keep_ind = TRUE, this function reverses that.

Usage

replace_dropped_dimensions(img, inds, orig.dim)

Value

Object of class nifti

Arguments

img

Object of class nifti where image dimensions were dropped.

inds

List of length 3 of indices from dropEmptyImageDimensions or getEmptyImageDimensions

orig.dim

Original dimension of pre-dropped image. Output image will have dimensions same as this value

Examples

Run this code
if (FALSE) {
# nim is an object of class nifti
dd = dropEmptyImageDimensions(nim, keep_ind = TRUE)
remake = replace_dropped_dimensions(img = dd$outimg, 
inds = dd$inds,
orig.dim = dd$orig.dim)
all.equal(nim, remake)
}

Run the code above in your browser using DataLab