antsImageRead: Image Read

Description Usage Arguments Value Author(s) Examples

Description

Read an image file into an S4 object of class 'antsImage'.

Usage

1
antsImageRead( filename ,  dimension = 3 , pixeltype = "float" )

Arguments

filename

Name of the file to read the image from.

pixeltype

C++ datatype to be used to represent the pixels read. This datatype need not be the same as the datatype used in the file. Allowed values: "double", "float" , "unsigned int" , "unsigned char".

dimension

Number of dimensions of the image read. This need not be the same as the dimensions of the image in the file. Allowed values: 2, 3, 4.

Value

S4 object of Class 'antsImage' – Success
1 – Failure

Author(s)

Shrinidhi KL

Examples

1
2
3
4
5
6
7
## Not run: 
# read an image from a file named 'imagefile.nii' into an image of pixeltype 'double' and dimensions '4'
img <- antsImageRead( "imagefile.nii" , dimension = 3  )
img <- antsImageRead( "imagefile.nii" , dimension = 2  )
img <- antsImageRead( "imagefile.nii" , dimension = 4 , pixeltype =  "double" )

## End(Not run)

stnava/itkImageR documentation built on May 30, 2019, 7:21 p.m.