CUDA-accelerated Python utilities for high-throughput PET/MR image processing and analysis
Project description
NIMPA is a stand-alone Python sub-package of NiftyPET, dedicated to high-throughput processing and analysis of brain images, particularly those, which are acquired using positron emission tomography (PET) and magnetic resonance (MR). Although, it is an essential part of the NiftyPET package for seamless PET image reconstruction, NIMPA is equally well suited for independent image processing, including image trimming, upsampling and partial volume correction (PVC).
Trimming is performed in order to reduce the unused image voxels in brain imaging, when using whole body PET scanners, for which only some part of the field of view (FOV) is used.
The upsampling is needed for more accurate extraction (sampling) of PET data using regions of interest (ROI), obtained using parcellation of the corresponding T1w MR image, usually of higher image resolution.
PVC is needed to correct for the spill-in and spill-out of PET signal from defined ROIs (specific for any given application).
In order to facilitate these operations, NIMPA relies on third-party software for image conversion from DICOM to NIfTI (dcm2niix) and image registration (NiftyReg). The additional software is installed automatically to a user specified location.
Documentation with installation manual and tutorials: https://niftypet.readthedocs.io/
Quick Install
Note that installation prompts for setting the path to NiftyPET_tools. This can be avoided by setting the environment variables PATHTOOLS. It’s also recommended (but not required) to use conda.
# optional (Linux syntax) to avoid prompts
export PATHTOOLS=$HOME/NiftyPET_tools
# cross-platform install
conda install -c conda-forge python=3 \
ipykernel numpy scipy scikit-image matplotlib ipywidgets
pip install "nimpa>=2"
External CMake Projects
The raw C/CUDA libraries may be included in external projects using cmake. Simply build the project and use find_package(NiftyPETnimpa).
# print installation directory (after `pip install nimpa`)...
python -c "from niftypet.nimpa import cmake_prefix; print(cmake_prefix)"
# ... or build & install directly with cmake
mkdir build && cd build
cmake ../niftypet && cmake --build . && cmake --install . --prefix /my/install/dir
At this point any external project may include NIMPA as follows (Once setting -DCMAKE_PREFIX_DIR=<installation prefix from above>):
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
project(myproj)
find_package(NiftyPETnimpa COMPONENTS improc REQUIRED)
add_executable(myexe ...)
target_link_libraries(myexe PRIVATE NiftyPET::improc)
Licence
Copyright 2018-21
Pawel J. Markiewicz @ University College London
Casper O. da Costa-Luis @ King’s College London
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.