Skip to content

Commit

Permalink
Merge branch 'master' into visualisation-and-registration-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pchlap authored Sep 11, 2023
2 parents f05a5f7 + d2ade8b commit 796a191
Show file tree
Hide file tree
Showing 36 changed files with 2,909 additions and 1,980 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Build Docs

on: workflow_dispatch
on:
workflow_dispatch:
push:
branches: ["main"]

jobs:
docs:
Expand All @@ -15,8 +18,10 @@ jobs:
- name: Install dependencies
run: |
curl -sSL https://install.python-poetry.org | python - --version 1.3.2
poetry install --with docs
poetry install --with docs --all-extras
echo "PYTHONPATH=`pwd`" >> $GITHUB_ENV
- name: Build Docs
run: |
sudo apt-get update -y && sudo apt-get install -y pandoc python3-pkg-resources python3-setuptools
poetry run sphinx-build -b html -a docs docs/site
- name: Deploy docs
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,13 @@ jobs:
tags: |
platipy/platipy:nnunet
ghcr.io/pyplati/platipy:nnunet
- name: Build and Push TotalSegmentator Image
uses: docker/build-push-action@v2
with:
context: services/totalsegmentator
platforms: linux/amd64
push: true
tags: |
platipy/platipy:totalsegmentator
ghcr.io/pyplati/platipy:totalsegmentator
74 changes: 31 additions & 43 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,46 +1,34 @@
cff-version: 1.2.0
title: "PlatiPy: Processing Library and Analysis Toolkit for Medical Imaging in Python"
message: >-
If you find the PlatiPy library useful in your research, please consider citing it using these
metadata.
abstract: >-
PlatiPy is a library of tools developed in Python for image processing and analysis of medical
images. A broad scope of functionality is provided including image conversion, registration
and segmentation is provided as well as computation of similarity and radiotherapy dosimtery
metrics and much more.
type: software
cff-version: "1.2.0"
authors:
- given-names: Phillip
family-names: Chlap
email: [email protected]
affiliation: University of New South Wales
- family-names: Chlap
given-names: Phillip
orcid: "https://orcid.org/0000-0002-6517-8745"
- family-names: Finnegan
given-names: Robert N.
orcid: "https://orcid.org/0000-0003-4728-8462"
doi: 10.5281/zenodo.8032858
message: If you use this software, please cite our article in the
Journal of Open Source Software.
preferred-citation:
authors:
- family-names: Chlap
given-names: Phillip
orcid: "https://orcid.org/0000-0002-6517-8745"
- given-names: Robert
family-names: Finnegan
email: [email protected]
affiliation: University of Sydney
- family-names: Finnegan
given-names: Robert N.
orcid: "https://orcid.org/0000-0003-4728-8462"
license: Apache-2.0
repository-code: "https://github.com/pyplati/platipy"
url: "https://pyplati.github.io/platipy/"
keywords:
- "medical image analysis"
- "auto-segmentation"
- "image registration"
references:
- authors:
- family-names: Lowekamp
given-names: Bradley C
- family-names: Chen
given-names: David T
- family-names: Ibáñez
given-names: Luis
- family-names: Blezek
given-names: Daniel
doi: 10.3389/fninf.2013.00045
issn: 16625196
journal: "Frontiers in Neuroinformatics"
title: "The design of simpleITK"
type: article
volume: 7
year: 2013
date-published: 2023-06-26
doi: 10.21105/joss.05374
issn: 2475-9066
issue: 86
journal: Journal of Open Source Software
publisher:
name: Open Journals
start: 5374
title: "PlatiPy: Processing Library and Analysis Toolkit for Medical
Imaging in Python"
type: article
url: "https://joss.theoj.org/papers/10.21105/joss.05374"
volume: 8
title: "PlatiPy: Processing Library and Analysis Toolkit for Medical
Imaging in Python"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN pip install --upgrade pip
COPY poetry.lock /platipy/poetry.lock
COPY pyproject.toml /platipy/pyproject.toml

RUN curl -sSL https://install.python-poetry.org | python - --version 1.2.1
RUN curl -sSL https://install.python-poetry.org | python - --version 1.3.2
RUN echo 'export PATH="/root/.local/bin:$PATH"' >> ~/.bashrc
RUN echo "/usr/lib/python3.8/site-packages" >> /usr/local/lib/python3.8/dist-packages/site-packages.pth

Expand Down
Binary file removed PlatiPy-GettingStarted.pdf
Binary file not shown.
60 changes: 33 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
# PlatiPy
# PlatiPy

[![DOI](https://joss.theoj.org/papers/10.21105/joss.05374/status.svg)](https://doi.org/10.21105/joss.05374)

## Processing Library and Analysis Toolkit for Medical Imaging in Python

PlatiPy is a library of **amazing** tools for image processing and analysis - designed specifically
for medical imaging!
for medical imaging!

Check out the [PlatiPy documentation](https://pyplati.github.io/platipy/) for more info.

This project was motivated by the need for a simple way to use, visualise, process, and analyse
This project was motivated by the need for a simple way to use, visualise, process, and analyse
medical images. Many of the tools and algorithms are designed in the context of radiation therapy,
although they are more widely applicable to other fields that use 2D, 3D, or 4D imaging.

Expand All @@ -16,31 +19,33 @@ We welcome feedback and contributions from the community (yes, you!) and you can
information about contributing [here](https://pyplati.github.io/platipy/contributing.html).

## What can I do with **platipy**?
A lot! A good place to start is by looking in the

A lot! A good place to start is by looking in the
[examples directory](https://github.com/pyplati/platipy/tree/master/examples).

Some examples of what PlatiPy can do:
- DICOM organising and converting:
* Bulk convert from multiple series and studies with a single function
* Convert DICOM-RT structure and dose filesto NIfTI images
* Create DICOM-RT structure files from binary masks e.g. from automatic contouring algorithms
- Image registration
* Register images and transform labels with a few lines of code
* Linear transformations: rigid, affine, similarity
* Non-linear deformable transformations: demons, b-splines
* Multiple metrics for optimisation
- Atlas-based segmentation
* A suite of tools that can be used out-of-the-box
* Includes advanced algorithms for
[iterative atlas selection](https://doi.org/10.1088/1361-6560/ab652a/) and

- DICOM organising and converting:
- Bulk convert from multiple series and studies with a single function
- Convert DICOM-RT structure and dose files to NIfTI images
- Create DICOM-RT structure files from binary masks e.g. from automatic contouring algorithms
- Image registration
- Register images and transform labels with a few lines of code
- Linear transformations: rigid, affine, similarity
- Non-linear deformable transformations: demons, b-splines
- Multiple metrics for optimisation
- Atlas-based segmentation
- A suite of tools that can be used out-of-the-box
- Includes advanced algorithms for
[iterative atlas selection](https://doi.org/10.1088/1361-6560/ab652a/) and
[vessel splining](https://doi.org/10.1088/1361-6560/abcb1d/)
- Synthetic deformation field generation
* Simulate anatomically realistic shifts, expansions, and bending
* Compare DIR results from clinical systems
- Basic tools for image processing and analysis
* Computing label similarity metrics: DSC, mean distance to agreement, Hausdorff distance, and more
* Cropping images to a region of interest
* Rotate images and generate maximum/mean intensity projections (beams eye view modelling)
- Synthetic deformation field generation
- Simulate anatomically realistic shifts, expansions, and bending
- Compare DIR results from clinical systems
- Basic tools for image processing and analysis
- Computing label similarity metrics: DSC, mean distance to agreement, Hausdorff distance, and more
- Cropping images to a region of interest
- Rotate images and generate maximum/mean intensity projections (beams eye view modelling)

A major part of this package is **visualisation**, and some examples are shown below!

Expand Down Expand Up @@ -74,7 +79,7 @@ fig = vis.show()
![Figure 2](assets/figure_2.png)

#### Calculate deformation vector fields

```python
from platipy.imaging.registration.deformable import fast_symmetric_forces_demons_registration

Expand All @@ -99,6 +104,7 @@ fig = vis.show()
![Figure 3](assets/figure_3.png)

## Getting started

There aren't many requirements, just an installed Python interpreter (3.7 or greater). PlatiPy can
be installed with **pip**:

Expand All @@ -117,5 +123,5 @@ pip install platipy[backend]

## Authors

* **Phillip Chlap** - [[email protected]]([email protected])
* **Robert Finnegan** - [[email protected]]([email protected])
- **Phillip Chlap** - [[email protected]]([email protected])
- **Robert Finnegan** - [[email protected]]([email protected])
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ def setup(app):
shutil.copy("../examples/atlas_segmentation.ipynb", "_examples/atlas_segmentation.ipynb")
shutil.copy("../examples/contour_comparison.ipynb", "_examples/contour_comparison.ipynb")
shutil.copy("../examples/bronchus_segmentation.ipynb", "_examples/bronchus_segmentation.ipynb")
shutil.copy(
"../examples/left_ventricle_17_segments.ipynb", "_examples/left_ventricle_17_segments.ipynb"
)

shutil.rmtree("site/assets", ignore_errors=True)
os.makedirs("site", exist_ok=True)
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ PlatiPy documentation
_examples/atlas_segmentation
_examples/contour_comparison
_examples/dvh_analysis
_examples/left_ventricle_17_segments

.. toctree::
:caption: Reference
Expand Down
6 changes: 6 additions & 0 deletions docs/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ Geometry
.. automodule:: platipy.imaging.utils.geometry
:members:

Left Ventricle
==============

.. automodule:: platipy.imaging.utils.ventricle
:members:

IO
==

Expand Down
4 changes: 4 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/pyplati/platipy/blob/master/examples/cardiac_segmentation.ipynb)

### Example to Perform Cardiac Left Ventricle 17-segment model Segmentation

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/pyplati/platipy/blob/master/examples/left_ventricle_17_segments.ipynb)

### Example to Perform Automatic Bronchial Tree Segmentation

[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/pyplati/platipy/blob/master/examples/bronchus_segmentation.ipynb)
Expand Down
Loading

0 comments on commit 796a191

Please sign in to comment.