readDWIdata: Read Diffusion Weighted Data

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

View source: R/io.r

Description

The functions create a "dtiData" object from Diffusion Weighted Data from medicial imaging files in a list of directories or from an imagefile, where the diffusion weighted data is given as 2-byte integer.

Usage

1
2
3
4
5
6
7
8
dtiData(gradient, imagefile, ddim, bvalue = NULL, xind = NULL, yind = NULL, zind = NULL, 
        level = 0, mins0value = 1, maxvalue = 32000, voxelext = c(1, 1, 1), 
        orientation = c(0L, 2L, 5L), rotation = diag(3))
readDWIdata(gradient, dirlist, format = c("DICOM", "NIFTI", "ANALYZE", "AFNI"), 
        nslice = NULL, order = NULL, bvalue = NULL,
        xind = NULL, yind = NULL, zind = NULL, level = 0, mins0value = 1, 
        maxvalue = 32000, voxelext = NULL, orientation = c(0L, 2L, 5L), 
        rotation = NULL, pattern = NULL, SPM2=TRUE, verbose = FALSE)

Arguments

gradient

matrix of diffusion gradients (including zero gradients for S0 images)

imagefile

name of data image file (binary 2Byte integers)

ddim

dimension of image cube (3D)

dirlist

list of directories containing the data files or name of a single data file (e.g. 4D NIFTI)

format

string specifying the medical imaging format, one of ”DICOM”, ”NIFTI”, ”ANALYZE”, or ”AFNI”

nslice

number of slices (usually z-direction)

order

vector, specifying a different order of the data files, i.e. other than alphabetic order in the directories given by dirlist. If not given, 1:n is used for n data files (no order change).

bvalue

vector of b-values (default 0 for S0 and 1 for Si)

xind

subindex for x-direction

yind

subindex for y-direction

zind

subindex for z-direction

level

determine mins0value as quantile of positive S0-values

mins0value

set voxel in S0-images with values less than level “inactive”

maxvalue

set voxel with values larger than maxvalue inactive

voxelext

voxel extensions in coordinate directions

orientation

orientations of data as coded in AFNI

rotation

optional rotation matrix for the coordinate system.

pattern

pattern for file matching in the directories dirlist.

SPM2

Enable some non-standard NIfTI files produced by SPM to be readable.

verbose

some progress reports if TRUE

Details

The function dtiData creates an object of class "dtiData" from an image file, where the diffusion weighted data is given as 2-byte integer. This image file has to be prepared by the user. Use writeBin to write out first all S0 images and than all Si images. The gradient should be created according to this order. Run the demo in order to have an example, how to do this!

The function readDWIdata reads the data files given in the directories in dirlist in alphabetic order. The order can be changed using the order argument: If filelist is the vector of files in alphabetic order, they are read in the order filelist[order]. If order is not given order <- 1:n is used (no change!). The medical imaging format is given by format and can be one of ”DICOM”, ”NIFTI”, ”ANALYZE”, or ”AFNI”. The number of slices of the three dimensional data cube is given by nslice. The diffusion gradients are provided as matrix gradient.

xind, yind, and zind define a region of interest as indices. If not given 1:dim[i] is used. level determine mins0value as quantile of positive S0-values. mins0value sets voxel in S0-images with values less than level “inactive”. maxvalue sets voxel with values larger than maxvalue inactive.

voxelext defines the voxel extension, overwrites the values found in the imaging files. orientation codes the data orientation in AFNI notation.

Value

An object of class "dtiData".

Author(s)

Karsten Tabelow [email protected]
J\"org Polzehl [email protected]

References

https://afni.nimh.nih.gov/pub/dist/src/README.attributes

See Also

dti.smooth, dtiTensor-methods, dtiData

Examples

1
  ## Not run: demo(dti_art)

Example output

Loading required package: awsMethods

Use the function setCores() to change the number of CPU cores.

Loading required package: adimpro
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
sh: 1: cannot create /dev/null: Permission denied
Reading RAW images requires to install dcraw, see 

    http://cybercom.net/~dcoffin/dcraw/ for LINUX and http://www.insflug.org/raw/ 
    for MAC OS and Windows 

Loading required package: rgl
Warning messages:
1: In fun(libname, pkgname) : could not determine path to Imagemagick 

    please set the correct path manually using 

    'Sys.setenv(ImageMagick='path2imagemagick')'
2: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
3: 'rgl_init' failed, running with rgl.useNULL = TRUE 
4: .onUnload failed in unloadNamespace() for 'rgl', details:
  call: fun(...)
  error: object 'rgl_quit' not found 

dti documentation built on May 29, 2017, 3:50 p.m.