datatype | R Documentation |
Tries to figure out the correct datatype for image. Useful for image masks - makes them binary if
datatyper(
img,
type_string = NULL,
datatype = NULL,
bitpix = NULL,
trybyte = TRUE,
warn = TRUE
)
img |
nifti object (or character of filename) |
type_string |
(NULL) character of datatype and bitpix. Supercedes
both datatype and bitpix. If specified
|
datatype |
(NULL) character of datatype see
|
bitpix |
(NULL) character of bitpix see
|
trybyte |
(logical) Should you try to make a byte (UINT8) if image in c(0, 1)? |
warn |
Should a warning be issued if defaulting to FLOAT32? |
object of type nifti
img = nifti(array(rnorm(10^3, sd = 1000), dim = rep(10, 3)))
rimg = round(img)
newnii(datatyper(rimg))
rimg = datatyper(rimg, type_string= "FLOAT32")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.