f.read.nifti.slice: read one slice from a .img or .nii file in NIFTI format

Description Usage Arguments Details Value See Also Examples

View source: R/niftiFMRI.R

Description

Reads in a specific slice from a NIFTI .img or .nii image format file into an array.

Usage

1
f.read.nifti.slice(file, slice, tpt)

Arguments

file

The .img file to be read from

slice

The number of the slice (assumed to be the 3rd dimension)

tpt

The number of the scan that the slice is to be taken from

Details

The entire dataset is assumed to be 4D and a slice is extracted that is referenced by specifying the last two dimensions of the dataset i.e.slice and tpt.

Value

An array containing the slice

See Also

f.read.nifti.slice.at.all.timepoints, f.read.nifti.ts, f.read.nifti.volume

Examples

1
2
a<-f.read.nifti.slice(system.file("example-nifti.img", package="AnalyzeFMRI"),10,1)
dim(a)

Example output

Loading required package: R.matlab
R.matlab v3.6.2 (2018-09-26) successfully loaded. See ?R.matlab for help.

Attaching package: 'R.matlab'

The following objects are masked from 'package:base':

    getOption, isOpen

Loading required package: fastICA
Loading required package: tcltk
Loading required package: tkrplot
Warning messages:
1: no DISPLAY variable so Tk is not available 
2: loading Rplot failed 
[1] 53 63

AnalyzeFMRI documentation built on Oct. 5, 2021, 5:06 p.m.