# NOT RUN {
# get filename for example NII file included in nifti.io package
nii.eg <- system.file("extdata", "egBrain.nii", package="nifti.io")
# get the number of voxels in the 3-dimensional volume of the specified image
image.size <- info.nii(nii.file = nii.eg, field = "dimensions")
# get the size in mm of the volume
image.spacing <- info.nii(nii.file = nii.eg, field = "spacing")
# get the number of volumes
image.volumes <- info.nii(nii.file = nii.eg, field = "volumes")
# get list containing orientation parameters
image.orientation <- info.nii(nii.file = nii.eg, field = "orientation")
# get entire header from NII file
image.hdr <- info.nii(nii.file = nii.eg, field = "hdr")
# get a specific element in the header
image.hdr.datatype <- info.nii(nii.file = nii.eg, field = "datatype")
# }
Run the code above in your browser using DataLab