A comprehensive medical image processing service combining FreeSurfer and FSL toolchains, available in three variants:
| Variant | Image Name | Use Case |
|---|---|---|
| jupyter | simcore/services/dynamic/jupyter-medimproc |
Interactive analysis, visualization, notebook development |
| runner | simcore/services/comp/runner-medimproc |
Production pipelines, automated processing, full feature set |
| runner-slim | simcore/services/comp/runner-medimproc-slim |
Production pipelines with space constraints, optimized size |
- Docker installed and running
- FreeSurfer license file (
freesurfer_license.txt) in root directory - For GitLab CI: GitLab account with registry access
Get a free FreeSurfer license at: https://surfer.nmr.mgh.harvard.edu/registration.html
# Clone repository
git clone <repository-url>
cd jupyter-medimproc
# Build a variant
make build VARIANT=jupyter # Interactive Jupyter
make build VARIANT=runner # Headless runner
make build VARIANT=runner-slim # Optimized runner
# Run tests
make test VARIANT=jupyter
# Interactive shell
make shell VARIANT=jupyter
# Start with docker-compose
docker-compose up -d jupyter
# Access JupyterLab at http://localhost:8888All variants include both toolchains:
- FreeSurfer 6.0.0: Neuroimaging toolkit for processing, analyzing, and visualizing brain MR images
- MRtrix3 3.0.4: Tools for diffusion MRI analysis
- ART: Advanced registration tools
- ANTs: Advanced normalization tools
- FSL: Comprehensive library of analysis tools for FMRI, MRI and DTI brain imaging data
- Synb0-DISCO: Distortion correction for diffusion weighted MRI
- ANTs 2.4.4: Advanced normalization tools (FSL variant)
- C3D: Image processing toolkit
- PyTorch: Deep learning framework for Synb0-DISCO (CPU version)
- Spinal Cord Toolbox 7.2: Comprehensive set of tools for processing and analysis of spinal cord MRI data (Available in
jupyterandrunnervariants only)
.
├── services/
│ ├── jupyter/ # Interactive Jupyter variant
│ │ └── Dockerfile
│ ├── runner/ # Headless runner (standard)
│ │ └── Dockerfile
│ └── runner-slim/ # Headless runner (optimized)
│ └── Dockerfile
├── common/
│ ├── scripts/
│ │ ├── install_mrtrix3_art.sh # FreeSurfer stack installation
│ │ └── install_fsl.sh # FSL stack installation
│ └── entrypoint.sh # Runner entrypoint
├── validation/ # Test data and outputs
├── tests/ # Test infrastructure
├── .gitlab-ci.yml # GitLab CI configuration
├── Makefile # Build automation
└── docker-compose.yml # Local development
make build VARIANT=jupyter # Build jupyter variant
make build VARIANT=runner # Build runner variant (standard)
make build VARIANT=runner-slim # Build runner-slim variant (optimized)make build-allmake build-nc VARIANT=jupyter# Start services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose downmake shell-jupyter # Jupyter variant
make shell-runner # Runner variant
make shell-runner-slim # Runner slim variant# Runner variant with mounted data
docker run -v /path/to/input:/input \
-v /path/to/output:/output \
-e INPUT_FOLDER=/input \
-e OUTPUT_FOLDER=/output \
simcore/services/comp/runner-medimproc:latest
# Slim variant
docker run -v /path/to/input:/input \
-v /path/to/output:/output \
simcore/services/comp/runner-medimproc-slim:latest# Test specific variant
make test VARIANT=jupyter
make test VARIANT=runner
make test VARIANT=runner-slimcd tests
make test-smoke VARIANT=jupyter # Quick smoke tests
make test-all VARIANT=runner # All tests including slow ones
make test-pipeline VARIANT=runner # Full pipeline test (slow)- Based on
itisfoundation/jupyter-math:2.0.9 - Interactive JupyterLab interface
- Full installation (not optimized)
- User:
jovyan(UID 1000)
- Based on
ubuntu:24.04 - Headless runner
- Full installation (not optimized)
- User:
scu(UID 8004) - Includes entrypoint for runner integration
- Based on
ubuntu:24.04 - Headless runner
- Optimized installation (removes docs, examples, etc.)
- User:
scu(UID 8004) - Includes entrypoint for runner integration
The slim variant removes unnecessary files to reduce image size:
FreeSurfer cleanup:
subjects/- Example subjectsdocs/- Documentationtrctrain/- Training datadiffusion/- Diffusion examplesmatlab/- MATLAB scripts
FSL cleanup:
data/standard/- Standard templatesdoc/- Documentationextras/src/- Extra source filessrc/- Source files
INSTALL_DIR: Installation directory (default:/usr/localor${HOME})VENV_DIR: Python virtual environment directory (default:/home/jovyan/.venv)OPTIMIZED: Enable optimizations (default:false,truefor slim variant)
INPUT_FOLDER: Input data directory (default:/input)OUTPUT_FOLDER: Output data directory (default:/output)SC_BUILD_TARGET: Build target (default:runtime)FREESURFER_HOME: FreeSurfer installation directoryFSLDIR: FSL installation directory
The repository is configured for GitLab CI with three parallel build pipelines:
jupyter-medimproc-build/jupyter-medimproc-testrunner-medimproc-build/runner-medimproc-testrunner-medimproc-slim-build/runner-medimproc-slim-test
Configure these in GitLab CI/CD settings:
SC_CI_TESTING_REGISTRY- Testing registry URLSC_CI_TESTING_REGISTRY_USER- Testing registry usernameSC_CI_TESTING_REGISTRY_PASSWORD- Testing registry passwordSC_CI_MASTER_REGISTRY- Master registry URLSC_CI_MASTER_REGISTRY_USER- Master registry usernameSC_CI_MASTER_REGISTRY_PASSWORD- Master registry password
Builds are triggered on:
- Branch pushes
- Merge requests
- Changes to relevant directories (
services/*/,common/,.gitlab-ci.yml)
Once inside the container (via shell or notebook):
# FreeSurfer commands
freesurfer --version
recon-all -h
mri_convert -h
# FSL commands
fsl --version
fslinfo
bet
# MRtrix3 commands
mrconvert -h
dwi2tensor -h
# Synb0-DISCO
pipeline_no_docker.sh -h
# Python (with PyTorch for Synb0-DISCO)
source ~/.venv/bin/activate # Activate venv
python -c "import torch; print(torch.__version__)"validation/
├── inputs/ # Mount your input data here
├── outputs/ # Results will appear here
└── workspace/ # Persistent workspace
Mount points:
/input -> Your input data
/output -> Your results
- Unified Installation: FreeSurfer and FSL are now installed together
- New Structure: 3 variants instead of 6 separate services
- GitLab CI: Builds now happen on GitLab due to memory requirements
- Simplified Dockerfiles: All use common installation scripts
# Old images
simcore/services/comp/jupyter-freesurfer:latest
simcore/services/comp/jupyter-fsl-synb0:latest
# New images
simcore/services/dynamic/jupyter-medimproc:latest
simcore/services/comp/runner-medimproc:latest
simcore/services/comp/runner-medimproc-slim:latest# Old way
make build SERVICE=jupyter-freesurfer
# New way
make build VARIANT=jupyter- All FreeSurfer tools and versions
- All FSL tools and versions
- Environment variables
- Entrypoint behavior for runner
- FreeSurfer license requirement
- Synb0-DISCO pipeline script
- Image names
- Build commands
- Directory structure
- CI platform (GitHub Actions -> GitLab CI)
- Both toolchains always included (can't separate anymore)
Solution: Use GitLab CI (designed for this) or increase Docker memory locally:
- Docker Desktop -> Settings -> Resources -> Memory: 16GB+
Symptom: ERROR: FreeSurfer license file not found
Solution:
# Ensure license file exists in root directory
ls -la freesurfer_license.txtCheck environment:
# Inside container
echo $FREESURFER_HOME
echo $FSLDIR
echo $PATH
# Re-source environments if needed
source $FREESURFER_HOME/SetUpFreeSurfer.sh
source $FSLDIR/etc/fslconf/fsl.shCurrent version: 1.4.1
make version-patch # 1.4.1 -> 1.3.5
make version-minor # 1.4.1 -> 1.4.1
make version-major # 1.4.1 -> 2.0.0# Show all make targets
make help
# Check Docker logs
docker logs <container-id>
# Inspect image
docker inspect simcore/services/dynamic/jupyter-medimproc:latest- Javier Garcia Ordonez (ordonez@itis.swiss)
- ZMT Zurich MedTech AG
See LICENSE file for details.