quantile_img: Create Quantile Image

View source: R/quantile_img.R

quantile_imgR Documentation

Create Quantile Image

Description

Creates output image of the quantiles that each voxel is in, after applying the mask

Usage

quantile_img(img, mask = NULL, ...)

Arguments

img

Character vector, or object of class nifti

mask

Mask to determine cumulative distribution function (cdf) from

...

Additional arguments to pass to ecdf

Value

Object of class nifti

Examples

set.seed(5)
dims = rep(10, 3)
arr = array(rnorm(prod(dims)), dim = dims)
nim = oro.nifti::nifti(arr)
qimg = quantile_img(nim)
qarr = quantile_img(arr)
testthat::expect_equal(qarr, array(qimg, dim = dim(qarr)))
qimg = quantile_img(nim, mask = nim > 0)


neurobase documentation built on May 29, 2024, 2:17 a.m.