to_nii | R Documentation |
to_nii: give a mask and a dataframe (row per voxel: i j k value), write out a nifti file
to_nii(examplenii, d, fileout, valcol = 4, icol = "i", jcol = "j", kcol = "k")
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 |
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.