Learn R Programming

MRIaggr (version 1.1.5)

writeMRIaggr: Write an image file

Description

Write an image file from a MRIaggr object.

Usage

"writeMRIaggr"(object, param, num = NULL, norm_mu = FALSE, norm_sigma = FALSE, range.coords = NULL, default_value = NA, filename, format, gzipped = TRUE, verbose = optionsMRIaggr("verbose"), size = "NA_integer_")

Arguments

object
an object of class MRIaggr. REQUIRED.
param
the contrast parameters to extract. character vector or NULL. REQUIRED.
num
the slices to extract. numeric vector or NULL.
norm_mu
the type of centering to apply on the parameter values. character. See the details section.
norm_sigma
the type of scaling to apply on the parameter values. character. See the details section.
default_value
the element used to fill the missing observations. numeric.
range.coords
the maximum coordinate in each dimension to be considered. numeric vector of length 3.
filename
the name of the image file. character. REQUIRED.
format
the format of the image file. Can be "raw.gz", "analyze", "nifti" or "dicom". REQUIRED.
size
the number of bytes per element in the byte stream. integer. See the documentation of the writeBin function for more details.
gzipped
is a character string that enables exportation of compressed (.gz) files.
verbose
is a logical variable that allows text-based feedback during execution of the function.

Value

None.

Details

This function requires to have installed the oro.nifti package to work if argument format is set to "analyze" or "nifti".

Examples

Run this code
data("MRIaggr.Pat1_red", package = "MRIaggr")

## Not run: 
# writeMRIaggr(MRIaggr.Pat1_red, param = "DWI_t0", filename = "Pat1_DWIred", format = "nifti")
# DWIred <- readMRI("Pat1_DWIred", format = "nifti")
# image(DWIred[,,1])
# ## End(Not run)

Run the code above in your browser using DataLab