Learn R Programming

ANTsR (version 0.3.1)

antsImageWrite: Image Write

Description

Write an image object of S4 class antsImage to a file.

Usage

antsImageWrite(image, filename)

Arguments

image

Image object of S4 class antsImage to be written.

filename

Name of the file to write the image to.

Value

0 -- Success 1 -- Failure

See Also

antsImageRead

Examples

Run this code
# NOT RUN {
fn <- getANTsRData( "r16" )
fi <- antsImageRead( fn )
antsImageWrite( fi , tempfile( fileext = ".nii.gz" ) )
antsImageWrite( fi , tempfile( fileext = ".mha" ) )
antsImageWrite( fi , tempfile( fileext = ".nrrd" ) )
antsImageWrite( antsImageClone( fi, "unsigned int" ) ,
  tempfile( fileext = ".jpg" )  )
antsImageWrite( antsImageClone( fi, "float" ) ,
  tempfile( fileext = ".tif" )  )
antsImageWrite( fi, tempfile( fileext = ".mrc" )  )
antsImageWrite( fi, tempfile( fileext = ".hd5" )  )
# }

Run the code above in your browser using DataLab