-- Load a preset or add steps to generate a script --
heuristic.py, the dcm2niix conversion script, and a BIDS folder structure preview — all in one place.Installing Neuroimaging Tools on Windows
Complete step-by-step guide — WSL 2, FSL, FreeSurfer, ANTs, AFNI, MRtrix3, dcm2niix, HeuDiConv, Python packages, and X server for GUI tools like FSLeyes.
# Install WSL 2 with Ubuntu (one command does everything) wsl --install # If Ubuntu did not install automatically, install it explicitly: wsl --install -d Ubuntu-22.04 # Set WSL 2 as the default version wsl --set-default-version 2 # Check WSL version after restart wsl --list --verbose
Restart your PC when prompted. After restart, Ubuntu opens automatically and asks you to create a Linux username and password — these do not need to match your Windows credentials. After setup, open Ubuntu from the Start Menu for all subsequent steps. Everything from Step 2 onwards runs inside Ubuntu, not PowerShell.
# Update all packages
sudo apt update && sudo apt upgrade -y
# Install all libraries that neuroimaging tools need
sudo apt install -y \
wget curl git unzip vim htop tree \
python3 python3-pip python3-venv python3-dev \
build-essential gfortran gcc g++ cmake \
libgl1-mesa-glx libgl1-mesa-dri \
libglu1-mesa libglu1-mesa-dev \
libxt6 libxext6 libxrender1 libxi6 \
libxmu6 libxmuu1 \
libgomp1 libquadmath0 libgfortran5 \
libopenblas-dev liblapack-dev \
dc bc tcsh csh \
libeigen3-dev zlib1g-dev libfftw3-dev libpng-dev \
nodejs npm \
ffmpeg imagemagick
echo "Dependencies installed successfully"
# Download and install VcXsrv on Windows (not in WSL): # https://sourceforge.net/projects/vcxsrv/ # Install it with all default options # After installing, launch XLaunch from the Start Menu: # - Display settings: Multiple windows # - Client startup: Start no client # - Extra settings: tick "Disable access control" ← important # - Click Finish # VcXsrv must be running before you launch any GUI tool from WSL
# Add DISPLAY variable so WSL apps know where to send the GUI
# This tells WSL to send the display to Windows via VcXsrv
echo 'export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '"'"'{print $2}'"'"'):0.0' >> ~/.bashrc
echo 'export LIBGL_ALWAYS_INDIRECT=1' >> ~/.bashrc
source ~/.bashrc
# Test X server connection (install xeyes first)
sudo apt install -y x11-apps
xeyes # a small window with eyes should appear on Windows
# If xeyes opens, your X server is working correctly
Windows 11 users: WSLg is built into Windows 11 and handles GUI apps automatically — you do not need VcXsrv. Just run sudo apt install -y x11-apps && xeyes to verify it works. If it does, skip the VcXsrv steps above.
# Download the FSL installer
wget https://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py
# Run installer — it downloads FSL (~2.5 GB) and installs to /usr/local/fsl
# When asked for install directory, press Enter to accept default
sudo python3 fslinstaller.py -d /usr/local/fsl
# Add FSL to your shell environment
echo 'export FSLDIR=/usr/local/fsl' >> ~/.bashrc
echo '. ${FSLDIR}/etc/fslconf/fsl.sh' >> ~/.bashrc
echo 'export PATH=${FSLDIR}/bin:${PATH}' >> ~/.bashrc
source ~/.bashrc
# Verify installation
bet --help | head -3
flirt -version
echo "FSLDIR: $FSLDIR"
# FSLeyes is the FSL image viewer — requires X server running (Step 3) # Install FSLeyes separately (not included in FSL installer by default) pip install fsleyes # Launch FSLeyes fsleyes & # Or open a NIfTI file directly fsleyes /path/to/your/image.nii.gz & # If FSLeyes crashes with OpenGL error, try: LIBGL_ALWAYS_SOFTWARE=1 fsleyes &
FSLeyes requires VcXsrv to be running on Windows 10. On Windows 11 with WSLg it opens automatically. The LIBGL_ALWAYS_SOFTWARE=1 flag forces software rendering if your graphics card causes issues in WSL.
# Download FreeSurfer 7.4.1 for Ubuntu 22.04 wget https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer_ubuntu22-7.4.1_amd64.deb # Install sudo dpkg -i freesurfer_ubuntu22-7.4.1_amd64.deb sudo apt install -f -y # resolve any missing dependencies # Add to shell environment echo 'export FREESURFER_HOME=/usr/local/freesurfer/7.4.1' >> ~/.bashrc echo 'source $FREESURFER_HOME/SetUpFreeSurfer.sh' >> ~/.bashrc source ~/.bashrc # Verify freesurfer --version recon-all --version
# Get your free license from: # https://surfer.nmr.mgh.harvard.edu/registration.html # Fill in the form and the license.txt file is emailed to you # Once you have license.txt, copy it to FreeSurfer home: cp /mnt/c/Users/YourName/Downloads/license.txt \ $FREESURFER_HOME/license.txt # Verify license is in place ls -la $FREESURFER_HOME/license.txt # Test with a quick command (no license needed for this) mri_info --version
The FreeSurfer GUI (Freeview) also requires VcXsrv. Launch it with freeview & after starting XLaunch.
# Download pre-built ANTs 2.5.3 for Ubuntu 22.04
wget https://github.com/ANTsX/ANTs/releases/download/v2.5.3/ants-2.5.3-ubuntu-22.04-X64-gcc.zip
# Extract and move to /opt
unzip ants-2.5.3-ubuntu-22.04-X64-gcc.zip
sudo mv ants-2.5.3 /opt/ants
# Add to shell environment
echo 'export ANTSPATH=/opt/ants/bin' >> ~/.bashrc
echo 'export PATH=${ANTSPATH}:${PATH}' >> ~/.bashrc
source ~/.bashrc
# Verify
antsRegistration --version
N4BiasFieldCorrection --version
antsRegistrationSyN.sh --help | head -3
# Install AFNI dependencies
sudo apt install -y \
libxp6 libglu1-mesa libmotif-dev r-base \
python3-matplotlib python3-numpy \
libgsl-dev libopenmpi-dev
# Download and run official AFNI installer
curl -O https://afni.nimh.nih.gov/pub/dist/bin/misc/@update.afni.binaries
tcsh @update.afni.binaries -package linux_ubuntu_16_64 -do_extras
# Add to shell environment
echo 'export PATH=$HOME/abin:$PATH' >> ~/.bashrc
source ~/.bashrc
# Verify
afni --version
3dInfo --version
# Launch AFNI GUI (requires VcXsrv running on Windows 10)
afni &
# Option A — apt package (easiest, Ubuntu 22.04+)
sudo apt install -y mrtrix3
# Option B — pip
pip install mrtrix3
# Option C — build from source (always latest version)
sudo apt install -y \
libeigen3-dev zlib1g-dev libfftw3-dev \
libpng-dev libgl1-mesa-dev libglu1-mesa-dev \
libqt5opengl5-dev qtbase5-dev
git clone https://github.com/MRtrix3/mrtrix3.git ~/mrtrix3
cd ~/mrtrix3
./configure
./build # takes 10–20 minutes
echo 'export PATH=~/mrtrix3/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
# Verify
mrconvert --version
mrinfo --version
# Launch MRview GUI (requires X server)
mrview &
# dcm2niix — install latest binary (newer than apt version) wget https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_lnx.zip unzip dcm2niix_lnx.zip sudo mv dcm2niix /usr/local/bin/ dcm2niix --version # HeuDiConv — BIDS converter that uses heuristic.py pip install heudiconv heudiconv --version # BIDS validator — checks BIDS compliance after conversion sudo npm install -g bids-validator bids-validator --version
# Create a virtual environment (keeps packages isolated)
python3 -m venv ~/neuro-env
source ~/neuro-env/bin/activate
# Upgrade pip first
pip install --upgrade pip setuptools wheel
# Install all neuroimaging Python packages
pip install \
nibabel \
nilearn \
nipype \
dipy \
pandas numpy scipy matplotlib seaborn \
scikit-learn scikit-image \
jupyter jupyterlab ipywidgets \
fmriprep mriqc \
pydeface templateflow \
antspyx
# Auto-activate the environment in every new terminal
echo 'source ~/neuro-env/bin/activate' >> ~/.bashrc
# Verify key packages
python3 -c "import nibabel; print('nibabel', nibabel.__version__)"
python3 -c "import nilearn; print('nilearn', nilearn.__version__)"
python3 -c "import dipy; print('dipy', dipy.__version__)"
# Download Docker Desktop for Windows: # https://www.docker.com/products/docker-desktop # Install it — it detects WSL 2 automatically # Enable "Use WSL 2 based engine" in Docker Desktop settings # After install, verify Docker works inside WSL: docker --version docker run hello-world
# Pull fMRIPrep and MRIQC images
docker pull nipreps/fmriprep:latest
docker pull nipreps/mriqc:latest
# Run MRIQC on a BIDS dataset
docker run --rm -it \
-v /mnt/c/Users/YourName/data/bids:/data:ro \
-v /mnt/c/Users/YourName/data/mriqc:/out \
nipreps/mriqc:latest \
/data /out participant \
--participant-label 00001
# Run fMRIPrep
docker run --rm -it \
-v /mnt/c/Users/YourName/data/bids:/data:ro \
-v /mnt/c/Users/YourName/data/derivatives:/out \
-v /mnt/c/Users/YourName/freesurfer_license.txt:/opt/freesurfer/license.txt:ro \
nipreps/fmriprep:latest \
/data /out participant \
--participant-label 00001 \
--fs-license-file /opt/freesurfer/license.txt
sudo apt install -y parallel
# Verify
parallel --version
# Example: run BET on all subjects in parallel with 4 jobs at once
SUBJECTS=(sub-001 sub-002 sub-003 sub-004 sub-005)
printf '%s\n' "${SUBJECTS[@]}" | \
parallel -j 4 \
"bet /data/bids/{}/anat/{}_T1w.nii.gz \
/data/derivatives/{}/{}_brain.nii.gz \
-f 0.4 -B -m"
echo "=== Checking all neuroimaging tools ===" echo -n "FSL: "; bet --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "FSLeyes: "; fsleyes --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "FreeSurfer: "; recon-all --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "ANTs: "; antsRegistration --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "AFNI: "; afni --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "MRtrix3: "; mrconvert --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "dcm2niix: "; dcm2niix --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "HeuDiConv: "; heudiconv --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "BIDS-val: "; bids-validator --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "Python: "; python3 --version echo -n "nibabel: "; python3 -c "import nibabel; print(nibabel.__version__)" || echo "NOT FOUND" echo -n "nilearn: "; python3 -c "import nilearn; print(nilearn.__version__)" || echo "NOT FOUND" echo -n "DIPY: "; python3 -c "import dipy; print(dipy.__version__)" || echo "NOT FOUND" echo -n "Docker: "; docker --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "Parallel: "; parallel --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "DISPLAY: "; echo $DISPLAY echo "=== Done ==="
echo $DISPLAY — should show an IP address like 172.x.x.x:0.0. On Windows 11 use WSLg instead.LIBGL_ALWAYS_SOFTWARE=1 fsleyes & to force software rendering. Add to ~/.bashrc to make permanent./data/bids which requires root. Always use your full Windows path: /mnt/c/Users/YourName/...source ~/.bashrc or close and reopen Ubuntu. The PATH changes only take effect in new terminals.ls $FREESURFER_HOME/license.txt — the file must exist. Register free at surfer.nmr.mgh.harvard.edu/registration.htmlC:\Users\YourName\.wslconfig with:[wsl2]memory=16GBprocessors=8C:\Users\Name\Desktop is accessible in WSL at /mnt/c/Users/Name/DesktopInstalling Neuroimaging Tools on Linux
Complete native installation guide for Ubuntu 20.04 / 22.04 / 24.04 and Debian-based HPC clusters. Covers FSL, FreeSurfer, ANTs, AFNI, MRtrix3, dcm2niix, HeuDiConv, Python stack, Docker, and SLURM.
sudo apt update && sudo apt upgrade -y
sudo apt install -y \
wget curl git unzip vim htop tree \
python3 python3-pip python3-venv python3-dev \
build-essential gfortran gcc g++ cmake ninja-build \
libgl1-mesa-glx libgl1-mesa-dri mesa-utils \
libglu1-mesa libglu1-mesa-dev \
libxt6 libxext6 libxrender1 libxi6 libxmu6 \
libgomp1 libquadmath0 libgfortran5 \
libopenblas-dev liblapack-dev \
libgsl-dev libgslcblas0 \
libeigen3-dev zlib1g-dev libfftw3-dev libpng-dev \
libjpeg-dev libtiff-dev \
dc bc tcsh csh \
nodejs npm \
ffmpeg imagemagick parallel \
singularity-container 2>/dev/null || true
echo "All system dependencies installed"
# Download the official FSL installer
wget https://fsl.fmrib.ox.ac.uk/fsldownloads/fslinstaller.py
# Run installer — installs to /usr/local/fsl by default (~2.5 GB download)
# Press Enter to accept the default directory when prompted
sudo python3 fslinstaller.py -d /usr/local/fsl
# Add FSL to your shell environment
echo 'export FSLDIR=/usr/local/fsl' >> ~/.bashrc
echo '. ${FSLDIR}/etc/fslconf/fsl.sh' >> ~/.bashrc
echo 'export PATH=${FSLDIR}/bin:${PATH}' >> ~/.bashrc
source ~/.bashrc
# Verify
bet --help | head -2
flirt -version
echo "FSLDIR: $FSLDIR"
# FSLeyes is the FSL image viewer — install via pip pip install fsleyes # Launch FSLeyes fsleyes & # Open a specific image fsleyes /path/to/image.nii.gz & # If you get an OpenGL error on a headless server, use: LIBGL_ALWAYS_SOFTWARE=1 fsleyes & # On a remote server via SSH, enable X forwarding: # Connect with: ssh -Y username@server # Then launch: fsleyes &
# Download the .deb package for Ubuntu 22.04 (~1.5 GB) wget https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer_ubuntu22-7.4.1_amd64.deb # Install the package sudo dpkg -i freesurfer_ubuntu22-7.4.1_amd64.deb # Fix any missing dependencies sudo apt install -f -y # Add to shell environment echo 'export FREESURFER_HOME=/usr/local/freesurfer/7.4.1' >> ~/.bashrc echo 'source $FREESURFER_HOME/SetUpFreeSurfer.sh' >> ~/.bashrc source ~/.bashrc # Verify freesurfer --version recon-all --version
# Use the Ubuntu 20.04 build instead wget https://surfer.nmr.mgh.harvard.edu/pub/dist/freesurfer/7.4.1/freesurfer_ubuntu20-7.4.1_amd64.deb sudo dpkg -i freesurfer_ubuntu20-7.4.1_amd64.deb sudo apt install -f -y
# Register free at: # https://surfer.nmr.mgh.harvard.edu/registration.html # The license.txt file will be emailed to you # Copy the license file to FreeSurfer home cp ~/Downloads/license.txt $FREESURFER_HOME/license.txt # Or create it manually from the email content: # cat > $FREESURFER_HOME/license.txt << 'EOF' # your.email@university.ac.uk # 12345 # *AbCdEfGhIjKl # EOF # Verify the license works mri_info $FREESURFER_HOME/subjects/bert/mri/T1.mgz
Freeview (FreeSurfer GUI) requires a display. On a remote server connect with ssh -Y user@server then run freeview &
# Download pre-built ANTs 2.5.3 for Ubuntu 22.04
wget https://github.com/ANTsX/ANTs/releases/download/v2.5.3/ants-2.5.3-ubuntu-22.04-X64-gcc.zip
# Extract and install
unzip ants-2.5.3-ubuntu-22.04-X64-gcc.zip
sudo mv ants-2.5.3 /opt/ants
# Add to shell environment
echo 'export ANTSPATH=/opt/ants/bin' >> ~/.bashrc
echo 'export PATH=${ANTSPATH}:${PATH}' >> ~/.bashrc
source ~/.bashrc
# Verify
antsRegistration --version
N4BiasFieldCorrection --version
antsRegistrationSyN.sh --help | head -3
sudo apt install -y cmake git g++ zlib1g-dev
git clone https://github.com/ANTsX/ANTs.git ~/ANTs-src
mkdir ~/ANTs-build && cd ~/ANTs-build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTING=OFF \
../ANTs-src
make -j$(nproc) # uses all CPU cores — takes 60–120 minutes
sudo make install
echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
# Install AFNI system dependencies
sudo apt install -y \
tcsh xfonts-base python3-qt5 \
libmotif-dev motif-clients \
xterm libxp6 \
r-base r-base-dev \
libglu1-mesa-dev \
libgsl-dev
# Download and run official AFNI installer
curl -O https://afni.nimh.nih.gov/pub/dist/bin/misc/@update.afni.binaries
tcsh @update.afni.binaries -package linux_ubuntu_16_64 -do_extras
# Add to shell environment
echo 'export PATH=$HOME/abin:$PATH' >> ~/.bashrc
source ~/.bashrc
# Run AFNI's own system check
afni_system_check.py -check_all
# Verify
afni --version
3dDeconvolve --help | head -3
# Launch AFNI GUI (requires display)
afni &
sudo apt install -y mrtrix3 mrconvert --version
# Install build dependencies
sudo apt install -y \
libeigen3-dev zlib1g-dev libfftw3-dev libpng-dev \
libgl1-mesa-dev libglu1-mesa-dev \
qtbase5-dev libqt5opengl5-dev \
python3-numpy
# Clone and build MRtrix3
git clone https://github.com/MRtrix3/mrtrix3.git ~/mrtrix3
cd ~/mrtrix3
./configure
./build # takes 10–20 minutes on a modern machine
# Add to shell environment
echo 'export PATH=~/mrtrix3/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
# Verify
mrconvert --version
mrinfo --version
tckgen --help | head -3
# Launch MRview GUI (requires display)
mrview &
# dcm2niix — latest binary (newer than apt version, better scanner support) wget https://github.com/rordenlab/dcm2niix/releases/latest/download/dcm2niix_lnx.zip unzip dcm2niix_lnx.zip sudo mv dcm2niix /usr/local/bin/ dcm2niix --version # HeuDiConv — automated BIDS conversion with heuristic files pip install heudiconv heudiconv --version # BIDS validator — check dataset compliance sudo npm install -g bids-validator bids-validator --version # Test dcm2niix on a folder # dcm2niix -z y -f "%p_%s" -b y -o /output /path/to/dicoms
# Create a virtual environment
python3 -m venv ~/neuro-env
source ~/neuro-env/bin/activate
# Upgrade pip
pip install --upgrade pip setuptools wheel
# Core neuroimaging packages
pip install \
nibabel \
nilearn \
nipype \
dipy \
antspyx
# Scientific Python stack
pip install \
pandas numpy scipy matplotlib seaborn \
scikit-learn scikit-image \
statsmodels pingouin
# Jupyter
pip install \
jupyter jupyterlab ipywidgets \
nbconvert
# BIDS apps and tools
pip install \
fmriprep mriqc \
pydeface templateflow \
pybids
# Auto-activate environment in every new terminal
echo 'source ~/neuro-env/bin/activate' >> ~/.bashrc
# Verify
python3 -c "import nibabel; print('nibabel', nibabel.__version__)"
python3 -c "import nilearn; print('nilearn', nilearn.__version__)"
python3 -c "import dipy; print('dipy', dipy.__version__)"
python3 -c "import nipype; print('nipype', nipype.__version__)"
# Install Docker Engine on Ubuntu
sudo apt install -y ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) \
signed-by=/etc/apt/keyrings/docker.gpg] \
https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
# Add your user to docker group (avoids needing sudo for docker)
sudo usermod -aG docker $USER
newgrp docker
# Verify
docker --version
docker run hello-world
# Pull BIDS App images
docker pull nipreps/fmriprep:latest
docker pull nipreps/mriqc:latest
# Run MRIQC
docker run --rm -it \
-v /data/bids:/data:ro \
-v /data/derivatives/mriqc:/out \
nipreps/mriqc:latest \
/data /out participant \
--participant-label 001 002 003 \
--nprocs 8 --mem_gb 32
# Run fMRIPrep
docker run --rm -it \
-v /data/bids:/data:ro \
-v /data/derivatives/fmriprep:/out \
-v /opt/freesurfer/license.txt:/opt/freesurfer/license.txt:ro \
nipreps/fmriprep:latest \
/data /out participant \
--participant-label 001 \
--fs-license-file /opt/freesurfer/license.txt \
--nprocs 8 --mem-mb 24000 \
--output-spaces MNI152NLin2009cAsym:res-2
sudo add-apt-repository -y ppa:apptainer/ppa sudo apt update sudo apt install -y apptainer # Verify apptainer --version # Pull fMRIPrep image (converts Docker → Singularity .sif file) # Run this on your HPC — takes ~20 minutes, creates a .sif file apptainer pull fmriprep.sif docker://nipreps/fmriprep:latest apptainer pull mriqc.sif docker://nipreps/mriqc:latest
#!/bin/bash
#SBATCH --job-name=fmriprep
#SBATCH --ntasks=1 --cpus-per-task=8
#SBATCH --mem=32G --time=12:00:00
#SBATCH --partition=standard
apptainer run --cleanenv fmriprep.sif \
/data/bids /data/derivatives/fmriprep participant \
--participant-label $SUBJ \
--fs-license-file /data/license.txt \
--nprocs 8 --mem-mb 30000 \
--output-spaces MNI152NLin2009cAsym:res-2
sudo apt install -y parallel
# Run BET on all subjects simultaneously (4 at a time)
SUBJECTS=($(ls -d /data/bids/sub-* | xargs -n1 basename))
printf '%s\n' "${SUBJECTS[@]}" | \
parallel -j 4 --eta \
"bet /data/bids/{}/anat/{}_T1w.nii.gz \
/data/derivatives/{}/{}_brain.nii.gz \
-f 0.4 -B -m && echo Done: {}"
# Submit a job sbatch pipeline.sh # Submit with specific variables sbatch --export=SUBJ=sub-001 pipeline.sh # Check job status squeue -u $USER squeue -j# Check completed job stats (memory, CPU, time used) sacct -j --format=JobID,Elapsed,MaxRSS,CPUTime,State # Cancel a job scancel # Cancel all your jobs scancel -u $USER # Check available partitions and nodes sinfo sinfo -N --long # View job output in real time tail -f slurm_${SLURM_JOB_ID}.out
# Connect to your remote server with X11 forwarding enabled ssh -Y username@your.hpc.server.ac.uk # The -Y flag enables trusted X11 forwarding # Once connected, run any GUI tool normally: fsleyes & mrview & afni & freeview &
# Install X2Go server on the remote machine (much faster than SSH -Y) sudo apt install -y x2goserver x2goserver-xsession # On your local machine install X2Go client: # https://wiki.x2go.org/doku.php/doc:installation:x2goclient # Then connect to your server — you get a full desktop over the network # Alternative: install a VNC server for full desktop access sudo apt install -y tigervnc-standalone-server vncserver :1 -geometry 1920x1080 -depth 24 # Then connect via VNC viewer from your local machine
echo "=== Checking all neuroimaging tools ===" echo -n "FSL: "; bet --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "FSLeyes: "; fsleyes --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "FreeSurfer: "; recon-all --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "ANTs: "; antsRegistration --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "AFNI: "; afni --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "MRtrix3: "; mrconvert --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "dcm2niix: "; dcm2niix --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "HeuDiConv: "; heudiconv --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "BIDS-val: "; bids-validator --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "Docker: "; docker --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "Apptainer: "; apptainer --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "GNU Parallel: "; parallel --version 2>&1 | head -1 || echo "NOT FOUND" echo -n "Python: "; python3 --version echo -n "nibabel: "; python3 -c "import nibabel; print(nibabel.__version__)" 2>/dev/null || echo "NOT FOUND" echo -n "nilearn: "; python3 -c "import nilearn; print(nilearn.__version__)" 2>/dev/null || echo "NOT FOUND" echo -n "DIPY: "; python3 -c "import dipy; print(dipy.__version__)" 2>/dev/null || echo "NOT FOUND" echo -n "nipype: "; python3 -c "import nipype; print(nipype.__version__)" 2>/dev/null || echo "NOT FOUND" echo "=== Done ==="
LIBGL_ALWAYS_SOFTWARE=1 fsleyes &. On a headless server ensure DISPLAY is set: export DISPLAY=:0ssh -Yecho $FREESURFER_HOME is set and ls $FREESURFER_HOME/license.txt exists. Source the setup script: source $FREESURFER_HOME/SetUpFreeSurfer.shsource ~/.bashrc or open a new terminal. The PATH exports only take effect in new shells.sudo apt install -f -y immediately after the failed dpkg command to auto-resolve missing dependencies.sudo usermod -aG docker $USER then log out and back in, or run newgrp docker in the current terminal.--mem in your #SBATCH header. Check actual usage with sacct -j <jobID> --format=MaxRSS after the job completes.sudo apt install -y qtbase5-dev libqt5opengl5-dev libeigen3-dev then re-run ./configure && ./build-- Select tool groups and click "Generate Selected", or click ▶ next to any group to generate just that one --
Enter your BIDS directory path and SpinLab will generate a script to analyse the dataset structure, check compliance, and produce a summary report.
-- Enter a BIDS path and click Generate --
The generated script scans your BIDS directory and produces: subject count and list, modalities present per subject, missing files detection, total storage size, and a participants.tsv summary. Run the script in your terminal to get an instant dataset overview before starting preprocessing.
-- Set parameters above to see recommendation --
MRISpin SpinLab is a browser-based neuroimaging pipeline platform. It generates real, complete, runnable bash and Python scripts for the full neuroimaging analysis workflow, and includes SpinAI intelligence features — including Pipeline DNA fingerprinting, live Methods section generation, an Error Decoder, and a Study Replication Assistant. SpinLab is not a processing engine — it generates the scripts that you run on your own machine, server, or HPC cluster.
SUBJ, BIDS_DIR, OUT_DIR)bash spinlab_pipeline.shheuristic.py, dcm2niix.sh, heudiconv.shheuristic.py at /data/bids/code/heuristic.py, run heudiconv.shA full-page code editor with line numbers, syntax-aware quick actions, and a 30+ snippet library. Load snippets, write freely, find & replace paths, and download the finished script.
Search works across snippet titles and keyword tags — typing warp finds FNIRT and ANTs, typing brain finds BET. Filter pills (FSL / FS / ANTs / MRtrix / PY / BIDS / HPC) restrict the list to one tool family. Clicking a snippet on the default boilerplate loads silently; if you have written something real it asks for confirmation first.
for SUBJ in... loop that auto-discovers all sub-* folders. Appends a template loop if nothing is selected.#SBATCH header. Skips if one already exists.set -euo pipefail and a trap that prints the failing line number.tee.# for bash/python).The Pipeline Builder generates complete, runnable bash/Python pipeline scripts from real tool commands. Every step contains the actual flags and correct output paths — not placeholder calls. The generated script updates live on the right as you change any parameter.
Four fields at the top of the left panel apply to every step in the pipeline:
$SUBJ throughout. In loop/SLURM mode this is overridden automatically.$OUT_DIR.$NTHREADS to recon-all, fMRIPrep, ANTs etc./data/raw/{subject}) → set Series pattern to match your folder structure$T1 which dcm2niix sets automatically.$T1 pointing to the converted T1w NIfTI. BET reads $T1 automatically. You do not need to manually connect steps.$T1 (T1w NIfTI path for BET/registration)$T1_BRAIN (overrides input for next step)$T1_BRAIN and $T1_MASK$T1_BRAIN, sets $AFF_MAT and $T1_MNI_LIN$AFF_MAT, sets $WARPFIELD$GM_PROB and $WM_PROB$FS_SUBJ_DIR$DWI_EDDY and $DWI_BVEC_ROT$DWI_PREPROC and $DWI_MASK$FOD_WM$TT5 and $GMWMI$TRACKS and $SIFT2_WEIGHTS$SUBJ from Global Config. Run as bash pipeline.sh. Use this to test before scaling up.sub-* folders in BIDS_DIR and loops. Run as bash pipeline.sh. Sequential — one subject at a time.parallel -j 4. Best for multi-core workstations.#SBATCH directives. Extra fields appear for partition, memory, walltime, email. Submit with sbatch pipeline.sh.The Study Setup Wizard is the fastest way to get a correctly-configured pipeline. Answer 4 questions and the Pipeline Builder opens pre-loaded with the right steps and parameters for your study type, field strength, and analysis goals.
Three files plus a BIDS Tree preview:
create_key(), infotodict(), and series→key mapping. Save at /data/bids/code/heuristic.py.{subject} placeholder and your BIDS output directorydcm2niix -h or DICOM tag (0008,103E).Click any protocol card to open a preview with three tabs: Full Script (complete code with line numbers), Details (inputs/outputs, requirements, DOI references), and Pipeline Steps (step-by-step data flow). Use Deploy to Pipeline Builder to load all steps with correct parameters.
A spreadsheet-style QC table. Each row is a subject, each column is a QC metric. Enter measured values and cells colour automatically — green (pass), amber (warning), red (fail) — based on published thresholds. Choose the modality (Structural / fMRI / DWI) to switch metric sets.
Export CSV produces a publication-ready table with all subjects, metrics, and pass/fail status. Methods Text generates a complete paragraph for your paper's Methods section — thresholds used, subjects assessed, subjects excluded with reasons, and final N. Ready to paste directly into your manuscript.
Search by command name, flag name, or description keyword. Filter pills restrict to one tool. Each card shows a full explanation, a key flags table, a real working example with a Copy button, and the official documentation link. The match count updates live as you type.
heuristic.py, save to /data/bids/code/heudiconv.sh → run it — converts all subjects and validatesNo. All panels work without signing in. An account lets you save scripts to the database so they persist across sessions and devices.
Sign in → write or edit a script → click Save → enter a name. Saved scripts appear in the Account panel. Click Load to restore to the editor. Registration may be disabled by the site admin — if so the Register tab is hidden.
No. SpinLab generates scripts. You download the script and run it on your own machine, server, or HPC cluster where the neuroimaging tools are installed. No data is uploaded to SpinLab at any point.
No. All panels — Pipeline Builder, Heuristic Builder, Protocol Library, QC Tracker, Command Hub — are fully functional without signing in. An account only lets you save scripts to the database so they persist across sessions and devices.
Make sure dcm2niix is step 1 and BET is step 2. The dcm2niix step sets $T1 at the end of its code block — BET reads $T1 automatically from the same script scope. If you add BET before dcm2niix, $T1 is not yet set. Order matters.
The default placeholder paths like /data/bids and /data/derivatives require root access on most systems. Replace them with your actual paths in the Pipeline Builder Global Config bar before downloading — for example /home/yourname/project/bids on Linux or /mnt/c/Users/yourname/project/bids on WSL.
The -d path must point to the files inside your DICOM folder, not the folder itself. Make sure the path ends with /* — for example /data/raw/{subject}/DICOM/*. SpinLab's Heuristic Builder generates this correctly automatically.
dcm2niix names output files from the DICOM protocol name stored in the scanner header (e.g. WIP_3DT1_301_phMag.nii.gz), not the BIDS convention. You need to rename it to sub-001_T1w.nii.gz before BET can find it. The best solution is to use the Heuristic Builder instead — it runs HeuDiConv which renames files to BIDS convention automatically.
Scripts are tested against FSL 6.0.7, FreeSurfer 7.4.1, ANTs 2.5.3, MRtrix3 3.0.4, fMRIPrep 23+, HeuDiConv 1.3+. Earlier versions generally work but specific flags may differ. See the Install Guides for recommended versions.
Yes — through WSL 2 (Windows Subsystem for Linux). Install WSL 2 with Ubuntu, then install the neuroimaging tools inside WSL exactly as you would on Linux. Your Windows files are accessible inside WSL at /mnt/c/Users/yourname/. See the Install on Windows guide for step-by-step instructions including how to set up the X server for GUI tools like FSLeyes.
The Environment Checker generates a bash script that verifies which neuroimaging tools are installed on your system — and which versions. Run it in any terminal (local, WSL, or HPC) to get a complete readiness report before starting your analysis. Each tool shows ✓ with version or ✗ if not found. A summary at the bottom shows total installed vs missing.
bash spinlab_env_check.sh — works in any bash terminal: local Linux, WSL, macOS, or HPC login node.Enter your BIDS directory path and the Browser generates a bash analyser script that scans your dataset and produces a complete report: subject count, modality coverage per subject, missing file detection, total storage size, participants.tsv summary, and bids-validator output. Run it before preprocessing to confirm your dataset is ready.
Required root files (dataset_description.json, participants.tsv, README, .bidsignore), subject folder detection (sub-* count), modality coverage (anat/, func/, dwi/, fmap/, perf/) with per-subject breakdown, subjects missing anatomical data, NIfTI and JSON sidecar counts, total dataset size, and bids-validator output if installed.
Input your study parameters and the calculator estimates compute and storage requirements across all standard pipeline types. Results update live as you change any input.
Every pipeline you build in the Pipeline Builder can be converted to a unique DNA fingerprint — a short code like SL-BET-FLIT-FNIT-E7A3C2F1 that encodes every step, every parameter, and every configuration value. Click the DNA button in the Pipeline Builder toolbar.
Share the DNA code in your paper's Methods section. Anyone who enters it into SpinLab gets your exact pipeline automatically loaded — same steps, same parameters, same order. A full reproducibility URL is also generated that can be shared directly. This is the neuroimaging equivalent of a git commit hash.
Every parameter in the Pipeline Builder has a small ? button. Clicking it opens the SpinAI panel with a contextual explanation of what the parameter does, whether your current value is appropriate for your pipeline, when to go higher or lower, and a specific literature citation. SpinAI is aware of your other pipeline steps and adapts its recommendation accordingly.
No API key required — a built-in knowledge base covers 60+ parameters across all Pipeline Builder steps: BET (f threshold, gradient, robust mode), FLIRT (DOF, cost function, interpolation, reference), FNIRT (config), FAST (tissue classes, type), FreeSurfer (SUBJECTS_DIR, recon-all flags), dcm2niix (filename pattern, merge, BIDS sidecars), Eddy/DWI (acqp, index, repol), MRtrix3 (algorithm, streamlines, ACT, backtrack), SLURM (partition, memory, walltime, array), fMRIPrep (output spaces, FD threshold, license), ASL (PLD, tau, sequence type), tedana, MELODIC, Randomise, TBSS, and all QC metrics. If an API key is configured in the Admin panel, SpinAI upgrades to a full AI-powered response automatically.
Below the Generated Script in the Pipeline Builder, the Live Methods Section panel updates in real time as you add and configure steps. It generates a complete academic Methods paragraph in past tense, third person, with tool citations and specific parameter values — ready to paste directly into a manuscript. When you change a parameter, the text updates within a second.
Paste any neuroimaging error message into the Error Decoder panel. SpinLab checks it against a built-in database of 40+ known neuroimaging errors — dcm2niix folder invalid, FNIRT convergence failure, matrix file not found, out-of-memory kills, bvec/bval mismatches, FreeSurfer licence missing, HeuDiConv path issues, and more.
For each match, three ranked causes are shown with probability percentages, a diagnostic command to confirm the cause, and the exact fix. For errors not in the database, SpinAI analyses the error message live.
Paste the Methods or Preprocessing section from any neuroimaging paper and SpinLab reads it, extracts every processing step and parameter mentioned, and deploys the pipeline to the Pipeline Builder with one click — with parameter values pre-filled from the paper.
A Reproducibility Gap Report is generated showing every parameter the paper did not specify — what was assumed and why. This makes invisible gaps in published methods visible, directly addressing the neuroimaging reproducibility crisis.
Load your current pipeline alongside any built-in preset. SpinLab shows a three-column table: your pipeline | the preset | scientific impact. For every step that differs, SpinAI explains in one sentence what the difference means for your analysis results, citing the relevant paper where applicable. Colour-coded: green = added, red = removed, amber = changed parameter.
Enter your QC metrics — cortical thickness, WM FA, tSNR, framewise displacement, mean diffusivity, etc. — and SpinLab checks them against normative ranges derived from large datasets including HCP (n=1,200), UK Biobank (n=40,000), ABIDE (n=1,112), Cam-CAN (n=652), and 50+ published studies.
Each metric shows ✅ Normal / ⚠️ Outside range / 🚨 Abnormal with the exact normal range, and an explanation of what might be causing any abnormal value and what to check.
A fully browser-based neuroimaging viewer powered by Niivue (WebGL2). Supports NIfTI, NRRD, MIF, MGZ, GIfTI, FreeSurfer surfaces, and tractography files. All files are read locally — nothing is uploaded to any server.
Access via NIfTI Viewer in the left navigation. Load files using the Layers panel on the left or drag-and-drop directly onto the canvas — file type is auto-detected from the extension.
The Layers panel replaces separate Volume/Overlay/Mesh/Tract loaders. Every loaded file appears as a layer in a dynamic list. Each layer shows its type icon, a colormap gradient swatch, and two buttons:
First volume loaded becomes the base. Every subsequent volume is automatically set to Red-Yellow colormap at 70% opacity as an overlay. Surfaces and tractography files are added via separate loaders below the volume loaders.
Clicking a layer in the list opens its individual controls:
Load many NIfTIs at once for rapid quality control. Click QC Contact Sheet (multi-file) and select any number of files. A full-screen grid opens showing one slice thumbnail per file rendered live. Controls at the top let you switch axis (Axial/Coronal/Sagittal) and slice position (10%–90%). Click any thumbnail to open that file in the main viewer. Use this instead of opening files one by one during subject-level QC.
Appears automatically when a 4D NIfTI is loaded. Controls include: volume index slider, play/pause, and speed buttons (0.5× / 1× / 2× / 4×) and a loop toggle. Clicking any voxel plots its intensity across all time points as a live chart — use this to spot motion spikes, signal dropout, or confirm a clean BOLD signal.
Shows voxel intensity distribution for the base volume (zeros excluded). The green highlighted region shows the current display range. Bars outside the range are dark. Updates when the intensity range changes. Use to set thresholds for statistical maps and check for bias field inhomogeneity.
Click anywhere on the image to record MNI coordinates, voxel index, and intensity. Click Pin current location to save with a custom label. Each annotation shows a ⊕ jump button — clicking it moves the crosshair to that exact coordinate. Export all annotations as CSV. Useful for QC findings, lesion marking, and methods documentation.
Full NIfTI header in human-readable form: dimensions, voxel size, TR, data type, spatial/temporal units, sform/qform codes (decoded), slice order, cal range, scl_slope/intercept, intent code, description, global/robust min/max. The copy icon in the header title copies the entire header as clean JSON — paste directly into lab notes or a methods section.
Click the ⌨ keyboard icon in the viewer title bar for a full shortcut reference. Key bindings include: scroll slices, pan (middle-drag), zoom (pinch/+−), adjust contrast (right-drag), cycle views (V), toggle axis (A/C/S), prev/next slice (←/→), adjust opacity ([/]), and reset zoom (R).
The Script Library is a curated collection of community pipeline scripts covering 8 neuroimaging categories. Scripts can be previewed, searched by keyword, and sent directly to the Script Editor with one click.
Click Contribute a Script in the library toolbar to open the submission guidelines. Scripts are reviewed by the MRISpin team before being added to the public library. Include: title, description, category, and the full script code.
A subject-level database for managing your study cohort. Replaces the spreadsheet most researchers use to track who has been scanned, who is excluded, and basic demographics. Data is saved in your browser and persists across sessions.
Shows live counts at the top: total subjects, included, excluded, male/female split, and mean age. Filters (All / Included / Excluded) and search apply instantly across all fields.
Validates a BIDS dataset entirely in the browser — no upload, no terminal, no internet required beyond loading the page. Click "Select BIDS Dataset Folder" and choose your dataset root. The validator scans all file paths and reports errors, warnings, and informational notes.
Errors (red), Warnings (yellow), and Info (grey) are shown with the rule code, description, and file path. The score card shows total error and warning counts. Export the full report as a text file for documentation or sharing with collaborators.
Generates a formatted bibliography for the neuroimaging tools used in your study. Select the tools from the list, choose your citation format, and copy the ready-to-paste bibliography and acknowledgement sentence for your manuscript.
FSL core, BET, FLIRT, FNIRT, FAST, FEAT, MELODIC, randomise, TBSS, eddy, FreeSurfer, recon-all, ANTs/SyN, N4BiasFieldCorrection, fMRIPrep, MRIQC, dcm2niix, HeuDiConv, BIDS standard, MRtrix3, Nilearn, Nipype, AFNI, SPM, tedana, Niivue.
Click From Pipeline to automatically select citations based on the steps currently in your Pipeline Builder. This matches pipeline step types to their corresponding tools and pre-selects them in the list.
A ready-to-paste sentence is generated below the bibliography: "Data were processed using the following neuroimaging tools: [list]. We thank the developers of these open-source software packages." Copy it directly into your Methods or Acknowledgements section.
A visual GUI for building FSL GLM design matrices without needing a desktop FSL installation or the FSL GUI. Define conditions (EVs), onset timings, contrasts, and nuisance regressors — then download the files needed for FEAT or film_gls.
Add conditions using the + Add button. For each condition set a name and colour, then enter onset timings in the text area — one row per block, format: onset_seconds duration_seconds. The design matrix preview updates live.
Add contrasts and set weights for each condition. For a simple A > B contrast: A=1, B=-1. For a main effect: set the target condition to 1 and all others to 0. Contrast names are included in the exported .con file.
Tick boxes for: 6 motion parameters (standard), CSF signal, WM signal, global signal. These are added as additional columns in the design matrix with zero values — replace with your actual regressor timeseries before running FEAT.
The Pipeline Builder can export your pipeline as a Snakemake workflow or a Nextflow DSL2 pipeline in addition to the standard bash script. The same steps and parameters are used — just a different execution format suited for reproducible, HPC-scale pipelines.
Click the Snakemake button in the Pipeline Builder toolbar. Downloads a Snakefile with one rule per pipeline step. Includes a SUBJECTS list from your subject list, BIDS_DIR and OUT_DIR from global config, and THREADS from your settings. Each rule has a touch output so Snakemake can track completion and re-run only failed steps.
Click the Nextflow button. Downloads a pipeline.nf DSL2 file with one process per step, a Channel from your subject list, and a workflow block chaining all processes in order. Parameters (bids_dir, out_dir, threads, subjects) are exposed as params.* and can be overridden at runtime with --param value.
snakemake --cores 8 --snakefile Snakefilenextflow run pipeline.nf --subjects sub-001,sub-002snakemake -n --snakefile Snakefile — shows what would run without executingEnter your MRI acquisition parameters and SpinLab checks them against published recommendations for that modality and field strength. Each parameter is scored as pass, warning, or fail with an explanation. The overall protocol score (0–100) summarises how well the protocol matches best-practice guidelines.
Recommended ranges change with field strength. Select 1.5T, 3T, or 7T and all thresholds update accordingly — for example, TE at 7T is shorter due to faster T2* decay, and flip angles are lower due to SAR constraints.
Always checks whether voxels are isotropic regardless of modality. Anisotropic voxels (e.g. 3×3×4mm) complicate registration and resampling and are flagged with a warning.
Click Group View in the QC Tracker toolbar to open a dot plot showing every subject's value for a chosen metric. Each dot represents one subject. Outliers more than 2 standard deviations from the mean are highlighted in red — these are candidates for exclusion or closer manual inspection.
Click Profile in the NIfTI Viewer tools section to enter profile mode. Then click and drag a line across any slice. SpinLab samples 80 voxels along that line and plots their intensity values as a chart. Useful for checking bias field (should be smooth and gradual), signal dropout, or intensity uniformity across a region.
Draw a horizontal line from left to right across an axial slice — a flat profile suggests good uniformity. A slow ramp indicates bias field. A sudden drop suggests signal dropout or susceptibility artefact. Draw across the brain edge to check skull-stripping accuracy.
Load any DICOM file and inspect every tag it contains — scanner model, sequence, TE, TR, flip angle, slice thickness, dimensions, patient parameters, and more. Everything is read locally in the browser. No file is uploaded anywhere.
When a file loads, a summary card immediately shows the most important acquisition parameters: modality, field strength, TR, TE, TI, flip angle, matrix size, pixel spacing, slice thickness, protocol name, sequence name, manufacturer, model, and software version.
All DICOM tags are listed in a searchable table with tag address, name, VR (value representation), and value. Known neuroimaging tags are highlighted. Use the category filter buttons to show only Patient, Study, Series, Image, Acquisition, or MRI-specific tags.
Load multiple DICOM files at once. Use the ← → buttons to step through files without re-opening the dialog. Useful for checking whether tags are consistent across a series.
Calculates statistical power and required sample size for neuroimaging study designs. All calculations run in the browser — no server, no data sent anywhere. Results update live as you adjust any slider.
Enter an expected dropout percentage. The calculator automatically inflates the required sample size: enrolled n = required n ÷ (1 − dropout rate). For a study needing 30 subjects with 15% expected dropout, you would need to enrol 36.
A live chart shows power across the full range of sample sizes, with a yellow 80% reference line. Below the chart, a ready-to-paste methods paragraph is generated describing the power analysis — copy it directly into your ethics application or manuscript methods section.
Each test type shows neuroimaging-specific effect size benchmarks. For example: hippocampal volume differences in Alzheimer's disease are typically d ≈ 0.8; brain-behaviour correlations are typically r ≈ 0.2–0.4; cortical thickness group differences are typically d ≈ 0.4.
/data/bids → /scratch/project/bids across all 40 lines at once.Sources & References
All commands, code snippets and documentation in MRISpin SpinLab are derived from the original open-source tools and publications listed below. We acknowledge all authors and respect their licensing terms.
Brain extraction (BET), linear/non-linear registration (FLIRT/FNIRT), GLM analysis (FEAT), ICA (MELODIC), DWI correction (eddy), tractography (FDT), permutation testing (randomise).
Cortical surface reconstruction (recon-all), subcortical segmentation, parcellation statistics (asegstats2table, aparcstats2table), mri_convert.
SyN non-linear registration, cortical thickness (antsCorticalThickness.sh), N4 bias field correction, antsApplyTransforms.
3dDeconvolve GLM, afni_proc.py preprocessing pipeline, align_epi_anat.py, 3dBlurToFWHM, motion censoring.
DWI preprocessing (dwidenoise, dwifslpreproc), CSD fibre orientation distribution, iFOD2 tractography, SIFT2 filtering, structural connectome (tck2connectome).
Reading, writing and manipulating neuroimaging file formats (NIfTI, MGZ, GIFTI, CIFTI). Used in all Python-based neuroimaging scripts.
Statistical learning and machine learning for neuroimaging. First-level GLM, functional connectivity, seed-based correlation, parcellation, plotting.
Workflow engine for building reproducible neuroimaging pipelines. Wraps FSL, FreeSurfer, SPM, ANTs, AFNI interfaces into portable Python workflows.
DTI tensor fitting, FA/MD/RD/AD maps, fibre tracking, noise estimation, gradient table handling.
Fast, reliable DICOM to NIfTI converter with automatic BIDS JSON sidecar generation. By Chris Rorden (University of South Carolina).
Robust, standardised fMRI preprocessing pipeline. Handles fieldmap correction, motion correction, confound extraction, ICA-AROMA, and multi-space outputs.
MRI quality control: computes image quality metrics (IQMs) for T1w and BOLD data, generates visual reports for participant and group levels.
Heuristic-driven DICOM to BIDS conversion tool. Automates session/run labelling via user-defined heuristic Python scripts.
Open-source cluster management and job scheduling. Used for submitting neuroimaging pipelines as job arrays across HPC systems.
Standard for organising neuroimaging datasets. All BIDS-related commands in MRISpin follow the official BIDS specification v1.8+.
MRISpin SpinLab (© 2026 MRISpin) is an independent tool that provides code templates, pipeline builders and reference documentation to assist neuroimaging researchers. It is not affiliated with, endorsed by, or a product of any of the tool developers listed above.
All code snippets are original compositions inspired by official documentation and best-practice examples from the neuroimaging community. They are provided as educational templates under fair-use principles. Users are responsible for citing the appropriate original tools and publications in their research outputs.
If you use any of the above tools in your research, please cite them according to their official citation guidelines.
Helpdesk & Support
Get help with SpinLab, report issues, or contact the MRISpin team. We are happy to assist with setup, scripting questions, and tool feedback.
Enter your QC metrics and SpinLab checks them against normative ranges from 50+ published studies.
Ranges derived from: HCP (n=1200), UK Biobank (n=40,000), ABIDE (n=1112), Cam-CAN (n=652), and 50+ published papers. Values are for healthy adults unless specified.
Select your BIDS dataset folder. The validator checks structure, naming, sidecars and events files against the BIDS specification — no internet connection or terminal needed.
✓ participants.tsv present
✓ Subject folders (sub-<label>)
✓ Session folders (ses-<label>)
✓ NIfTI filename BIDS suffixes
✓ JSON sidecar for every NIfTI
✓ events.tsv for task bold runs
✓ Unexpected root-level files
Select the tools used in your study. Generates a formatted bibliography and acknowledgement sentence ready to paste into your manuscript.
Enter your MRI acquisition parameters. SpinLab checks them against published recommendations and scores your protocol.