Description Usage Arguments Value Author(s) See Also Examples
MincVolumeIO objects are basically comprised of a 3D array, plus a number of properties which describe the volume.
Now, although one can often treat MincVolumeIO just as one would treat any 3D array, nonetheless, there are some computations
which strip off the class attributes, returning only the 3D array part. The mincIO.asVolume()
function serves to take a
3D array and convert it back into a MincVolumeIO object.
1 2 3 4 5 | ## S4 method for signature 'array,MincVolumeIO,missing'
mincIO.asVolume(array3D, likeVolObject, likeTemplate)
## S4 method for signature 'array,missing,character'
mincIO.asVolume(array3D, likeVolObject, likeTemplate)
|
array3D |
A 3D array to be converted into a MincVolumeIO object. |
likeVolObject |
A pre-existing instantiated MincVolumeIO object to serve as a template. |
likeTemplate |
A character string containing the name of the template volume. See |
An instantiated MincVolumeIO object wrapping the passed 3D array.
Jim Nikelski nikelski@bic.mni.mcgill.ca
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ## Not run:
\dontshow{
# clear debug flag and get full volume pathname
# ... dunno why zzz.R debug setting is not passed
R_DEBUG_rmincIO <- 0
volDir <- system.file("packageData/volumes", package="rmincIO")
}
# load the ICBM-152 volume
vIcbm <- "icbm_avg_152_t1_tal_lin.mnc"
vIcbm <- file.path(volDir, vIcbm)
vol <- mincIO.readVolume(vIcbm)
# make a mask array (not a volume object)
mask3D <- vol[,,]>100000
class(mask3D)
# apply the mask element-wise to the volume
maskedImage <- vol * mask3D
class(maskedImage)
# recast image data into a MincVolumeIO object
vol2 <-mincIO.asVolume(maskedImage, vol)
class(vol2)
# combining previous 2 lines into 1
vol2 <- mincIO.asVolume(vol * mask3D, vol)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.