Description Usage Arguments Details Value Author(s) Examples
View source: R/write.nii.voxel.R
Write NII Voxel
1 | write.nii.voxel(nii.file, coords, value)
|
nii.file |
Full directory listing to a NIfTI file. File must not be gzipped. |
coords |
A numeric vector conatining x,y,z,t coordinates indicating the location to write values |
value |
A numeric value to write |
NIfTI files need to be unzipped before using this function or any other portions of the nifti.io package. This is necessary given the inconsistent way in which gzipped files are indexed (Some information on this is given in the documentation for the readBin function).
Output directly to NIFTI file.
Timothy R. Koscik <timothy-koscik@uiowa.edu>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## Not run:
reference.image = "~/reference_image.nii"
pixdim = info.nii(nii.file = reference.image, field="pixdim")
orientation = info.nii(nii.file = reference.image, field="orientation")
init.nii(file.name = "~/example_image.nii",
dims = c(100,100,100),
pixdim = pixdim,
orient = orientation)
coordinates <- c(50,50,50)
new.value <- rnorm(1)
write.nii.volume(nii.file = "~/example_image.nii",
coords = coordinates,
value = new.value)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.