MRI Preprocessing

January 15, 2026 ยท View on GitHub

DOI 10.5281/zenodo.8320244

Tools

  • preprocessMprage
  • preprocessFunctional
    • sliceMotion4d
  • ROI_TempCorr.R

Output scheme

preprocessFunctional prepends each processing step as a prefix to each input, creating files like brnaswutm_func.nii.gz. In reverse order (order of name), the posible steps are:

prefixdesc
AAuto Correlation removal (optional)
bBandpass filtering (optional, simultaneous with regression, for rest)
gGlobal signal regression (optional, label optional, part of r)
rNuisance regression (optional)
nIntensity normalization
fHigh-pass filtering (optional, simultaneous with regression, for task)
aICA-AROMA (optional, requires warp)
sSmoothing
wCo-registration and warping to standard space (spatial normalization, optional)
uField map unwarping (optional; Susceptibility Distortion Correction)
dIntensity/wavelet despiking (optional)
kSkull stripping and intensity thresholding
mt4D slice-time motion correction (sliceMotion4d)
mMotion correction
tSlice timing correction
pPhysio/retroicor (optional)
0truncate (optional, if scanner output includes disacq)
_fslorient

Depends

see bibtex or plain text citations and preprocessFunctional -check_dependencies

Testing

Limited testing using bats in test/. see make test (Makefile)

See also

Usage Notes

ROI Temp Corr

Running ROI_TempCorr.R is internally parallelized (default njobs=4). If you are also forking in e.g. a bash for loop like ROI_TempCorr.R ... & (and maybe paired with lncdtool's waitforjobs, some care will need to be taken to not hit a R parallel package socket port conflict.

  1. the easiest solution is to disable internal parallelization: ROI_TempCorr.R ... -njobs 1.
  2. Alternatively, you can manually set the port for each ROI_TempCorr.R. Consider
ROI_TempCorr.R ... -port "$((11290 + $(pgrep -caf ROI_TempCorr) ))"

FYI OSS

The code is "for your information." There are no plans (or avaiable resources) to support external usage.