rmincUtil.convertWorldToVoxel: Convert World to Voxel Coordinates

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/rmincUtil.R

Description

Converts 3 dimensional xyz (world) coordinates into 1-relative ijk (voxel) coordinates.

Usage

1
    rmincUtil.convertWorldToVoxel(filename, worldCoords)

Arguments

filename

The name of a minc2 volume to be used to do the conversion to voxel space.

worldCoords

A 3 item vector of world coordinates in xyz order.

Details

Conversion requires access to a minc2 volume in order to enable the world to voxel mapping.

Value

A 3-item vector of 1-relative voxel coordinates.

Note

TODO: I really should be able to pass a MincInfo object and do the conversion within R code, without having to jump into the minc2 API.

Author(s)

Jim Nikelski nikelski@bic.mni.mcgill.ca

See Also

rmincUtil.convertVoxelToWorld

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# set the xyz voxel coordinates
xyzCoords <- c(0, 0, 0)

# create a full pathname to the sample volumes
v305PET <- file.path(volDir, "average305_PET_t1_tal_lin.mnc")
print(v305PET)

# convert and show it
ijkCoords <- rmincUtil.convertWorldToVoxel(v305PET, xyzCoords)
print(ijkCoords)

## End(Not run)

jnikelski/rmincIO documentation built on May 19, 2019, 2:58 p.m.