Description Usage Arguments Value Note See Also Examples
View source: R/dropEmptyImageDimensions.R
Drops dimensions of an image that has all irrelevant values
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | dropEmptyImageDimensions(
  img,
  value = 0,
  threshold = 0,
  other.imgs = NULL,
  keep_ind = FALSE,
  reorient = FALSE
)
drop_empty_dim(
  img,
  value = 0,
  threshold = 0,
  other.imgs = NULL,
  keep_ind = FALSE,
  reorient = FALSE
)
 | 
| img | nifti object | 
| value | Value to check against.  If zero, then 
 | 
| threshold | Drop dimension if fewer than  | 
| other.imgs | List of other nifti objects or filenames 
to apply the same dropping as  | 
| keep_ind | keep indices in output.  Will return list, even if 
 | 
| reorient | Should image be reoriented if a filename? | 
List of output image indices, and other images
if other.imgs not specified or keep_ind = TRUE. 
Otherwise object of class nifti
drop_empty_dim is a shorthand for dropEmptyImageDimensions
with all the same arguments.  Also, NA are set to zero.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | set.seed(5)
dims = rep(10, 3)
arr = array(rnorm(prod(dims)), dim = dims)
arr[,,10] = 0
nim = oro.nifti::nifti(arr)
dnim = dropEmptyImageDimensions(nim, keep_ind = TRUE)
new_nim = dnim$outimg
names(dnim)
dnim = dropEmptyImageDimensions(nim, keep_ind = TRUE, other.imgs = nim)
dims = rep(10, 4)
arr = array(rnorm(prod(dims)), dim = dims)
nim = oro.nifti::nifti(arr)
testthat::expect_error(
{dnim = dropEmptyImageDimensions(nim, keep_ind = TRUE)}
)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.