Learn R Programming

neurobase (version 1.32.4)

getEmptyImageDimensions: Get Empty Image Dimensions

Description

Creates a list of indices of an image that has all irrelevant values

Usage

getEmptyImageDimensions(img, value = 0, threshold = 0, reorient = FALSE, ...)

get_empty_dim(img, value = 0, threshold = 0, reorient = FALSE, ...)

Value

List of length 3 of indices.

Arguments

img

nifti object or array

value

Value to check against. If zero, then getEmptyImageDimensions will include any dimension that has fewer than threshold zeroes. May be a vector of values, matched with match

threshold

Include dimension if fewer than threshold voxels are in the slice

reorient

Should image be reoriented if a filename?

...

additional arguments to pass to check_nifti

Examples

Run this code
arr = array(rbinom(1000, size = 1, prob = 0.2), dim = c(10,10,10))
arr[,,1] = 0
arr[2:3,,] = 0
getEmptyImageDimensions(arr)

Run the code above in your browser using DataLab