Description Usage Arguments Details Value Methods Author(s) See Also Examples
Given a specific x,y,z location in voxel space, return the value at that location across all frames and all volumes.
1 2 3 | mincIO.readByVoxel(filenames, voxelCoords)
## S4 method for signature 'character'
mincIO.readByVoxel(filenames, voxelCoords)
|
filenames |
One or more minc2 filenames. All of these files should be in the same space, using the same sampling. |
voxelCoords |
Voxel coordinate to be sampled. This xyz coordinate triplet should be 1-relative. |
Here we define that class which does IO at the smallest possible level of granularity: the voxel. As is the case with the SliceIO class, the VoxelIO class tries to make it possible to process a great number of volumes (3D and 4D), without blowing out our memory. So, it a nutshell, this class reads the real value for a specific voxel. Furthermore, the user can specify multiple 4D volumes, thus allowing us to obtain the value of a specific voxel across all frames, over all volumes.
This function was inspired by a similar function by Jason Lerch, buried in the very bowels of the original RMINC package.
An instantiated MincVoxelIO
object. The dimensionality of the matrix
embedded within the data part of the object should be [nFiles x nFrames] in size.
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 16 17 18 19 20 21 22 23 | ## 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")
}
# read voxel value at center of Anterior Commissure across 5 volumes
# into a voxel array. Start with the 3D case.
v305 <- file.path(volDir, "average305_PET_t1_tal_lin.mnc")
worldCoords <- c(0,0,0)
voxCoords <- rmincUtil.convertWorldToVoxel(v305, worldCoords)
voxelArray <- mincIO.readByVoxel(c(v305, v305, v305, v305, v305), voxCoords)
print(voxelArray)
# 4D case with 34 frames
v4d <- file.path(volDir, "functional_4D.mnc")
worldCoords <- c(0,0,0)
voxCoords <- rmincUtil.convertWorldToVoxel(v4d, worldCoords)
voxelArray <- mincIO.readByVoxel(c(v4d, v4d, v4d, v4d, v4d), voxCoords)
print(voxelArray)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.