This repository contains the gems C++ code and python bindings used in Freesurfer's Sequence-Adaptive Multimodal SEGmentation (SAMSEG) (Puonti et al., NeuroImage, 2016) and in SimNIBS 4.0 Complete Head Anatomy Reconstruction Method (CHARM) (Puonti et al., NeuroImage, 2020) to create individualized head models for electric field simulations.
The compiled charm-gems library is available via pip ≥ 19.3, for python 3.6, 3.7 and 3.8
pip install --upgrade pip
pip install charm-gemsAfterwards the package can be imported by calling
import charm_gems as gems- A C++ compiler compatible with C++ 11
- Python ≥ 3.6
- CMake
- Make (Linux/MacOS)
- Visual Studio (Windows)
- zlib (for windows, see https://github.com/horta/zlib.install)
This repository uses submodules. To start it, use
git submodule init
git submodule update- Build ITK
mkdir ITK-build
cd ITK-build
cmake \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTING=OFF \
-DBUILD_EXAMPLES=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=../ITK-install \
../ITK
make install
cd ..
- Install charm-gems
ITK_DIR=ITK-install python setup.py install
- Build ITK
md ITK-build
cd ITK-build
cmake.exe ^
-DBUILD_SHARED_LIBS=OFF ^
-DBUILD_TESTING=OFF ^
-DBUILD_EXAMPLES=OFF ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX=..\ITK-install ^
..\ITK
cmake --build . --config Release --target Install
cd ..
- Install charm-gems
set ITK_DIR=ITK-install
python setup.py install