write_vol-methods: Write a 3d image volume to disk

write_volR Documentation

Write a 3d image volume to disk

Description

Write a 3d image volume to disk

Usage

write_vol(x, file_name, format, data_type)

## S4 method for signature 'NeuroVol,character,missing,missing'
write_vol(x, file_name)

## S4 method for signature 'ClusteredNeuroVol,character,missing,missing'
write_vol(x, file_name)

## S4 method for signature 'NeuroVol,character,character,missing'
write_vol(x, file_name, format)

## S4 method for signature 'ROIVol,character,character,missing'
write_vol(x, file_name, format)

## S4 method for signature 'NeuroVol,character,missing,character'
write_vol(x, file_name, data_type)

Arguments

x

an image object, typically a NeuroVol instance.

file_name

output file name

format

file format string. Since "NIFTI" is the only currently supported format, this parameter can be safely ignored and omitted.

data_type

output data type, If specified should be a character vector of: "BINARY", "UBYTE", "SHORT", "INT", "FLOAT", "DOUBLE". Otherwise output format will be inferred from R the datatype of the image.

Details

The output format will be inferred from file extension.

The output format will be inferred from file extension. write_vol(x, "out.nii") outputs a NIFTI file. write_vol(x, "out.nii.gz") outputs a gzipped NIFTI file.

No other file output formats are currently supported.

Examples


bvol <- NeuroVol(array(0, c(10,10,10)), NeuroSpace(c(10,10,10), c(1,1,1)))
## Not run: 
write_vol(bvol, "out.nii")
write_vol(bvol, "out.nii.gz")

## End(Not run)

bbuchsbaum/neuroim2 documentation built on June 4, 2024, 11:23 p.m.