R: Normalization of Principal Diffusion Directions
niinorm
R Documentation
Normalization of Principal Diffusion Directions
Description
niinorm normalizes Principal Diffusion Directions (PDDs) in NIfTI files.
The unnormalized PDD values produced by gqi.odfvmf retain information about the estimated von Mises-Fisher parameters at each voxel, which are useful in probabilistic tractography.
On the other hand, normalized PDD values are useful for visualization and seed mask creation, namely using the ‘FSL/fslview’ tool.
directory where loading files are located (default: tempdir().)
filename
name of the NIfTI file with PDD values to be normalized (default: ‘"data_V1")’.)
savedir
directory for saving processed results (default: tempdir().)
Value
niinorm accepts NIfTI files with incorporated PDD values as produced by gqi.odfvmf,
and outputs NIfTI files with normalized PDD values in the unit sphere.
The output NIfTI filenames receive the suffix 'n', e.g., ‘data_V1n’ and ‘data_V2n’.
Author(s)
Adelino Ferreira da Silva, Universidade Nova de Lisboa,
Faculdade de Ciencias e Tecnologia, Portugal, afs at fct.unl.pt
See Also
gqi.odfvmf
Examples
## Not run:
## Example using the PDD files in gdimap
## normalize vector data generated by vMF functions
## before visualization with FSL/fslview
fi1 <- "data_V1.nii.gz"
p <- system.file(file.path("extdata", fi1), package = "gdimap")
p1 <- strsplit(p,fi1)[[1]][1]
niinorm(srcdir=p1, filename=fi1, savedir=tempdir())
fi2 <- "data_V2.nii.gz"
niinorm(srcdir=p1, filename=fi2, savedir=tempdir())
## try fslview if installed
fo1 <- file.path(tempdir(),"data_V1n.nii.gz")
fo2 <- file.path(tempdir(),"data_V2n.nii.gz")
fo3 <- file.path(p1, "data_gfa.nii.gz")
if(Sys.which("fslview") != "") system(paste("fslview", fo3, fo2, fo1, "&"))
## End(Not run)