View source: R/antsImageWrite.R
antsImageWrite | R Documentation |
Write an image object of S4 class antsImage
to a file.
antsImageWrite(image, filename, as.tensor = FALSE)
image |
Image object of S4 class |
filename |
Name of the file to write the image to. |
as.tensor |
flag indicating to write as symmetric tensor if image has 6 components |
0 – Success
1 – Failure
Shrinidhi KL
antsImageRead
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 char"),
tempfile(fileext = ".jpg")
)
antsImageWrite(
antsImageClone(fi, "float"),
tempfile(fileext = ".tif")
)
antsImageWrite(fi, tempfile(fileext = ".mrc"))
antsImageWrite(fi, tempfile(fileext = ".hd5"))
components(fi) <- 0L
antsImageWrite(fi, tempfile(fileext = ".nii.gz"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.