to_nii: to_nii: give a mask and a dataframe (row per voxel: i j k...

View source: R/to_nii.R

to_niiR Documentation

to_nii: give a mask and a dataframe (row per voxel: i j k value), write out a nifti file

Description

to_nii: give a mask and a dataframe (row per voxel: i j k value), write out a nifti file

Usage

to_nii(examplenii, d, fileout, valcol = 4, icol = "i", jcol = "j", kcol = "k")

Arguments

examplenii

an oro.nifti object with the header (orientation, pixdim, etc) representing voxel data

d

voxelwise dataframe: row with i j k and voxel value

valcol

column in d to use as voxel value

icol, jcol, kcol

columns to use for indexing

Examples

## Not run: 
 mask.file <- '/Volumes/Phillips/mMR_PETDA/scripts_BTC/HarOx-sub-2mm.striatumplusthalamus.nii.gz'
 mask <- readNIfTI(mask.file) # 96x114x96: 5370 nonzero
 d<-data.frame(i=1:60,j=1:60,k=1:60,v=100)
 to_nii(mask.file,d,'test')

## End(Not run)

LabNeuroCogDevel/LNCDR documentation built on Oct. 13, 2023, 4:31 a.m.