Basic Python wrapper for Plastimatch
Project description
PyPlastimatch
PyPlastimatch is a python wrapper for Plastimatch, an ITK-based open source software designed for volumetric medical image processing and radiation therapy applications.
The main reason behing the development of PyPlastimatch is being able to use the Plastimatch functions within python scripts without having to code using os.system
or subprocess
all the time. Also, we are working on making the output of some of the functions Plastimatch implements for evaluation (e.g., Dice Coefficient and Hausdorff Distance) more pythonic/easily usable in python-based data analysis pipelines.
Together with the wrapping functions, we are also developing simple but handy functions that can be used for quick data exploration (e.g., simple widgets based on ipywidgets) in ipython notebooks and JupyterLab.
PyPlastimatch is completely independent from the main software Plastimatch, and it is being developed mainly for internal use. For this reason, most of the Plastimatch functions might be missing. If you would like to see something added or point out how we could improve anything in the wrapper, you are very welcome to open an issue at the issue page.
Table of Contents
Install Via pip
PyPlastimatch can be installed via pip:
pip install pyplastimatch
Dependencies
Python
If you decide to clone the PyPlastimatch repository and not to install it with pip
, in order to run the code as intended, all the python libraries found in requirements.txt
must be installed. This can be done running the command:
pip3 install -r requirements.txt
Plastimatch
Since PyPlastimatch is a python wrapper and doesn't include any processing code, Plastimatch must be installed on the machine separately.
For Linux users, Plastimatch can be installed simply by running:
sudo apt install plastimatch
For Windows users, Plastimatch can be installed following the guide at this webpage.
Plastimatch can also be build from source following the guide at this webpage.
DCMQI
Some functions might be based on the DICOM for Quantitative Imaging (dcmqi) library, that must be installed separately (e.g., under Linux, download the latest release, move the content of the bin
folder under usr/local/bin
, and make the files executable).
Usage Example
Since Plastimatch and this wrapper are being used for the development of AI-base medical image analysis pipelines on the NIH CRDC Imaging Data Commons plaftorm, some examples on how to use PyPlastimatch can be found at the IDC-Examples/notebooks repository.
For instance, the "Cohort Preparation" Colab notebook contains a simple tutorial on how to get a cohort ready for any image processing applications (e.g., best practices for the conversion from DICOM to NRRD and NIfTI, pointers to pre-processing utilities).
To open the Colab notebook, click here:
Note: provided you have a Google Cloud Platform project correctly setup, you will be able to run this and all the other notebooks for free, completely on the cloud.
Further Reading
Paolo Zaffino's (un)"official" wrapper.
Further discussion about the python-wrapping of Plastimatch can be found at this discourse.slicer thread.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pyplastimatch-0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53b1ed8b3059e2d8e5089cb95e08cddd75cd2ea51672f97c9306dcf69d07962f |
|
MD5 | b842081df064155588a3b8586037d9db |
|
BLAKE2b-256 | 4a0e27f077c17f5bac09c71fc119bceddf3bcd35995143a765fae09370d07477 |