Description Usage Arguments Details Value Methods Author(s) See Also Examples
Move a 2D slice, as held within a MincSlice object, into a MincVolumeIO object.
1 2 | ## S4 method for signature 'MincSlice,MincVolumeIO'
mincIO.putSlice(mincSlice, mincVolume, sliceNo)
|
mincSlice |
The name of the MincSlice object. |
mincVolume |
The name of the MincVolumeIO object, to which the slice is to be written. |
sliceNo |
A slice number, within the MincVolumeIO object, to which the slice is to be written. This is not a required argument; by default, the slice number recorded within the MincSlice object is used. Thus, only use this argument if you wish to write the slice back to a different slice from which it was originally retrieved. |
... |
Other yet to be defined parameters. |
The primary purpose of this method is to permit the re-insertion of newly modified slices into a
MincVolumeIO volume, prior to writing the volume out. Now of course, the other major use-case would
consist of creating a new, empty volume with mincIO.makeNewVolume
, and then inserting newly created
slices into this volume. Note that as it's currently not possible to create an empty slice
(well, not easily, at least), one could simply create an empty volume and then mincIO.getSliceX/Y/Z
any slice, which would then serve as the template empty slice. Clearly, in this case, the sliceNo
argument would need to be specified in order to write the modified template slices to different positions
within the volume.
A newly updated MincVolumeIO object.
Only one method/signature.
Jim Nikelski nikelski@bic.mni.mcgill.ca
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | ## 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")
}
# modify a slice and then put it back
v305PET <- file.path(volDir, "average305_PET_t1_tal_lin.mnc")
vol <- mincIO.readVolume(v305PET) # read the 3D volume
sx <- mincIO.getSliceX(vol, 60) # extract an axial slice
sx[10,20] <- 0 # modify the slice
updatedVol <- mincIO.putSlice(sx, vol) # put the slice back into the volume
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.