xyz2ijk: xyz2ijk

Description Usage Arguments Details Value See Also Examples

View source: R/niftiFMRI.R

Description

This function maps from some real world (x,y,z) positions in space into data coordinates (e.g. column i, row j, slice k). These original positions could relate to Talairach-Tournoux (T&T) space, MNI space, or patient-based scanner coordinates.

Usage

1
xyz2ijk(xyz=c(1,1,1),method=2,L)

Arguments

xyz

matrix. Each column of xyz should contain a voxel real world index coordinates (x,y,z) to be mapped to its (i,j,k) voxel index coordinates in the dataset

method

1 (qform.code=sform.code=0),2 (qform.code>0, rigid transformation) or 3 (sform.code>0, affine transformation).

L

header list of a NIFTI file

Details

See help page of function ijk2xyz().

Value

A list containing the matrix xyz of the positions of the points specified in ijk.

See Also

ijk2xyz Q2R R2Q

Examples

1
2
3
4
L <- f.read.header(system.file("example-nifti.hdr",
package="AnalyzeFMRI"))
xyz <- matrix(c(1,1,1,2,3,7),byrow=FALSE,nrow=3)
xyz2ijk(xyz=xyz,method=2,L)

Example output

Loading required package: R.matlab
R.matlab v3.6.2 (2018-09-26) successfully loaded. See ?R.matlab for help.

Attaching package:R.matlabThe following objects are masked frompackage:base:

    getOption, isOpen

Loading required package: fastICA
Loading required package: tcltk
Loading required package: tkrplot
Warning messages:
1: no DISPLAY variable so Tk is not available 
2: loading Rplot failed 
$ijk
         [,1]     [,2]
[1,] 26.66667 26.33333
[2,] 38.33333 39.00000
[3,] 18.33333 20.33333

AnalyzeFMRI documentation built on Oct. 5, 2021, 5:06 p.m.