MRI Preprocessing
January 15, 2026 ยท View on GitHub
Tools
preprocessMpragepreprocessFunctionalsliceMotion4d
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:
| prefix | desc |
|---|---|
A | Auto Correlation removal (optional) |
b | Bandpass filtering (optional, simultaneous with regression, for rest) |
g | Global signal regression (optional, label optional, part of r) |
r | Nuisance regression (optional) |
n | Intensity normalization |
f | High-pass filtering (optional, simultaneous with regression, for task) |
a | ICA-AROMA (optional, requires warp) |
s | Smoothing |
w | Co-registration and warping to standard space (spatial normalization, optional) |
u | Field map unwarping (optional; Susceptibility Distortion Correction) |
d | Intensity/wavelet despiking (optional) |
k | Skull stripping and intensity thresholding |
mt | 4D slice-time motion correction (sliceMotion4d) |
m | Motion correction |
t | Slice timing correction |
p | Physio/retroicor (optional) |
0 | truncate (optional, if scanner output includes disacq) |
_ | fslorient |
Depends
see bibtex or plain text citations and preprocessFunctional -check_dependencies
- ROBEX
- ANTs
- FSL
- ICA-AROMA
- v4
aroma: https://github.com/rtrhd/ICA-AROMA - orig repackages as
ica_aroma: https://github.com/WillForan/ICA-AROMA/tree/maartenmennes-setup.py
- v4
- AFNI
- MNI2009c
- Brain Wavelet ToolboX
- NiPy(4dslicewarp)
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.
- the easiest solution is to disable internal parallelization:
ROI_TempCorr.R ... -njobs 1. - 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.