Reads in a specific slice from a NIFTI .img or .nii image format file into an array.
f.read.nifti.slice(file, slice, tpt)
The .img file to be read from
The number of the slice (assumed to be the 3rd dimension)
The number of the scan that the slice is to be taken from
An array containing the slice
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.
f.read.nifti.slice.at.all.timepoints
,
f.read.nifti.ts
,
f.read.nifti.volume
# NOT RUN {
a<-f.read.nifti.slice(system.file("example-nifti.img", package="AnalyzeFMRI"),10,1)
dim(a)
# }
Run the code above in your browser using DataLab