Package: platipy
PlatiPyProcessing Library and Analysis Toolkit for Medical Imaging in PythonPlatiPy is a library ofamazingtools for image processing and analysis - designed specifically
for medical imaging!Check out thePlatiPy documentationfor more info.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.PlatiPy is written in Python, and uses SimpleITK, VTK, and standard Python libraries. Jupyter
notebooks are provided where possible, mainly for guidance on getting started with using the tools.
We welcome feedback and contributions from the community (yes, you!) and you can find more
information about contributinghere.What can I do withplatipy?A lot! A good place to start is by looking in theexamples directory.Some examples of what PlatiPy can do:DICOM organising and converting:Bulk convert from multiple series and studies with a single functionConvert DICOM-RT structure and dose files to NIfTI imagesCreate DICOM-RT structure files from binary masks e.g. from automatic contouring algorithmsImage registrationRegister images and transform labels with a few lines of codeLinear transformations: rigid, affine, similarityNon-linear deformable transformations: demons, b-splinesMultiple metrics for optimisationAtlas-based segmentationA suite of tools that can be used out-of-the-boxIncludes advanced algorithms foriterative atlas selectionandvessel spliningSynthetic deformation field generationSimulate anatomically realistic shifts, expansions, and bendingCompare DIR results from clinical systemsBasic tools for image processing and analysisComputing label similarity metrics: DSC, mean distance to agreement, Hausdorff distance, and moreCropping images to a region of interestRotate images and generate maximum/mean intensity projections (beams eye view modelling)A major part of this package isvisualisation, and some examples are shown below!Visualise some contoursfromplatipy.imagingimportImageVisualiservis=ImageVisualiser(image)vis.add_contour(contours)fig=vis.show()Register some imagesfromplatipy.imaging.registration.linearimportlinear_registrationimage_2_registered,tfm=linear_registration(image_1,image_2)vis=ImageVisualiser(image_1)vis.add_comparison_overlay(image_2_registered)fig=vis.show()Calculate deformation vector fieldsfromplatipy.imaging.registration.deformableimportfast_symmetric_forces_demons_registrationimage_2_deformed,tfm_dir,dvf=fast_symmetric_forces_demons_registration(image_1,image_2_registered)vis=ImageVisualiser(image_2_deformed,axis="z")vis.add_vector_overlay(dvf,subsample=12,arrow_scale=1,arrow_width=2,colormap=plt.cm.magma,name="DVF magnitude [mm]",color_function="magnitude")fig=vis.show()Getting startedThere aren't many requirements, just an installed Python interpreter (3.7 or greater). PlatiPy can
be installed withpip:pipinstallplatipyThe base installation of platipy does not include some large libraries needed for various
components of platipy. The following extras are available to install to run specific platipy tools:pipinstallplatipy[cardiac]pipinstallplatipy[nnunet]pipinstallplatipy[backend]AuthorsPhillip Chlap-phillip.chlap@unsw.edu.auRobert Finnegan-robert.finnegan@sydney.edu.au