This repository is under construction. Please look at the main repository in the meantime.
TODO: Add segmentation image(s)?
Sequence Adaptive Multimodal SEGmentation (SAMSEG) is a tool to robustly segment dozens of brain structures from head MRI scans without preprocessing. The characteristic property of SAMSEG is that it accepts multi-contrast MRI data without prior assumptions on the specific type of scanner or pulse sequences used. Dedicated versions to handle longitudinal data, or to segment white matter lesions in multiple sclerosis (MS) patients are also available.
TODO: The description above does not include the subregions module. Fix this.
Linux | Windows | MacOS |
---|---|---|
SAMSEG runs on 64bit Windows, Linux, and MacOS machines. Please visit the official SAMSEG Wiki and subregions Wiki for instructions.
Most of the functionalities of SAMSEG do not require FreeSurfer to be installed on your system, except:
- longitudinal registration preprocessing;
- subregions module.
-
Clone project:
git clone https://github.com/freesurfer/samseg.git
-
Get the submodules:
git submodule init
git submodule update
-
Create a virtual environment using, e.g., conda:
conda create -n samseg python=3.9
-
Activate the virtual environment:
conda activate samseg
-
Install correct compilers for ITK v.4.13.2
conda install -c conda-forge gxx_linux-64=7.5 gcc_linux-64=7.5 sysroot_linux-64=2.17
-
Create the ITK build directory
mkdir ITK-build
cd ITK-build
-
Export compilers installed with conda:
export CC=<your_conda_path>/envs/samseg/bin/x86_64-conda_cos6-linux-gnu-gcc
export CXX=<your_conda_path>/envs/samseg/bin/x86_64-conda_cos6-linux-gnu-g++
-
Run CMAKE:
cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../ITK-install ../ITK
-
Install:
make install
cd..
-
Install in development mode (
.[test]
installs pytest, use just.
if you don't want to run tests)ITK_DIR=ITK-install python -m pip install --editable .[test]
-
If you want to build wheels call
ITK_DIR=ITK-install python -m pip wheel . -w ./dist --no-deps
-
If you're developing and want to run the tests call (in the root of the git repository):
pytest samseg
If you use these tools in your analysis, please cite:
-
Cross-sectional: Fast and sequence-adaptive whole-brain segmentation using parametric Bayesian modeling. O. Puonti, J.E. Iglesias, K. Van Leemput. NeuroImage, 143, 235-249, 2016.
-
MS lesions: A Contrast-Adaptive Method for Simultaneous Whole-Brain and Lesion Segmentation in Multiple Sclerosis. S. Cerri, O. Puonti, D.S. Meier, J. Wuerfel, M. Mühlau, H.R. Siebner, K. Van Leemput. NeuroImage, 225, 117471, 2021.
-
Longitudinal: An Open-Source Tool for Longitudinal Whole-Brain and White Matter Lesion Segmentation. S. Cerri, D.N. Greve, A. Hoopes, H. Lundell, H.R. Siebner, M. Mühlau, K. Van Leemput. NeuroImage: Clinical, 38, 103354, 2023.
-
Thalamus: A probabilistic atlas of the human thalamic nuclei combining ex vivo MRI and histology. Iglesias, J.E., Insausti, R., Lerma-Usabiaga, G., Bocchetta, M., Van Leemput, K., Greve, D., van der Kouwe, A., Caballero-Gaudes, C., Paz-Alonso, P. Neuroimage (accepted).
-
Hippocampus: A computational atlas of the hippocampal formation using ex vivo, ultra-high resolution MRI: Application to adaptive segmentation of in vivo MRI. Iglesias, J.E., Augustinack, J.C., Nguyen, K., Player, C.M., Player, A., Wright, M., Roy, N., Frosch, M.P., Mc Kee, A.C., Wald, L.L., Fischl, B., and Van Leemput, K. Neuroimage, 115, July 2015, 117-137.
-
Amygdala: High-resolution magnetic resonance imaging reveals nuclei of the human amygdala: manual segmentation to automatic atlas. Saygin ZM & Kliemann D (joint 1st authors), Iglesias JE, van der Kouwe AJW, Boyd E, Reuter M, Stevens A, Van Leemput K, Mc Kee A, Frosch MP, Fischl B, Augustinack JC. Neuroimage, 155, July 2017, 370-382.
-
Brainstem: Bayesian segmentation of brainstem structures in MRI. Iglesias, J.E., Van Leemput, K., Bhatt, P., Casillas, C., Dutt, S., Schuff, N., Truran-Sacrey, D., Boxer, A., and Fischl, B. NeuroImage, 113, June 2015, 184-195.
-
Longitudinal subregions: Bayesian longitudinal segmentation of hippocampal substructures in brain MRI using subject-specific atlases. Iglesias JE, Van Leemput K, Augustinack J, Insausti R, Fischl B, Reuter M. Neuroimage, 141, November 2016, 542-555.