Skip to content

Miscellany

Sriranga Kashyap edited this page Feb 14, 2024 · 9 revisions

R

convert array datatypes in R

ar_d <- as.integer(ar, c(365,6,4))

ar_d <- array(ar_d,c(365,6,4))

give devtool arguments in R

> devtools::install_github("ANTsX/ANTsRCore",args="COPY_SCRIPT_FILES_TO_BIN_DIR")

compile faster

> Sys.setenv(MAKEFLAGS="-j12")

> readRenviron(~/.Renviron)

Set libpaths

> R_LIBS_SITE="/home/sriranga/R" R -q -e 'print(.libPaths())'

AFNI stuff

Make Plumb datasets Oblique again - to move between AFNI, FSL etc.

3drefit -atrcopy untouched_dataset.nii.gz IJK_TO_DICOM_REAL afnied_dataset.nii.gz

Generate 3dAllineate-able identity matrix

echo '1dApar2mat 0 | tail -3' > identity.aff12.1D

When doing some reslicing of TFL maps - first rescale refvolt and then do this

3dWarp -overwrite -verb -prefix output.nii -card2oblique mp2rage.nii -gridset mp2rage.nii tfl.nii

fslmerge analogue

3dTcat -verb -prefix merged_part-mag_bold.nii.gz func_run-1_part-mag_bold.nii.gz func_run-2_part-mag_bold.nii.gz