Release Notes¶
All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.
0.37.0¶
News around this release¶
Jake Rembish has been undergoing his PhD with the output of his work being contributed to PyMedPhys. This release coincides with the culmination of Jake’s PhD and this version will be the one referenced within his dissertation. It has been brilliant to see both Jake and his project to grow be what it is today. Thank you Jake 😊.
Breaking changes¶
The configuration for the TRF CLI now utilises the centralised
config.tomlfile instead of the priorCSVfiles.
New features and enhancements¶
A range of application have been added to and improved on within the PyMedPhys GUI.
A Daily WLutz application was added which utilises the air cavity within an iso-cube, combined with morning run-up beams (as arcs) to record the beam position at every gantry angle for each photon beam each morning.
A range of configuration improvements, making more applications more widely able to be utilised. Of particular note are Jake’s transfer check and weekly check applications which were written as a part of his PhD.
A QCL investigator tool, allowing one to produce plots and break downs of numbers of QCLs broken down either by QCL type, or the user who completed them.
An extend ct application was added providing the means to duplicate slices superiorly and inferiorly.
An application for the viewing of back-end iView jpg images.
An application for tweaking the WLutz algorithm options from iView back-end jpg images.
A range of fixes and improvements within the WLutz Arc and the MetersetMap applications.
The docs are now distributed with the PyMedPhys package. These are accessible by opening
http://localhost:8501/docs/index.htmlafter runningpymedphys gui. In the future it is intended to make this link more accessible.A range of error messaging has been improved. Of particular benefit to new users is the error message that occurs when a dependency is missing.
The ball-bearing finding component of the WLutz algorithm was tweaked to be able to also support the finding of air-cavities within an iso-cube.
The testing suite around Mosaiq was built upon and extended across the breadth of PyMedPhys.
Fixed a bug which was making
pymedphys.Delivery.from_mosaiqnon functional.Fixed a bug where some TRF files where not able to be decoded. Thank you LipTeck for the bug report.
The
pymedphys.trf.identifyinterface was moved out of beta. See the documentation for this newly stable API over at https://docs.pymedphys.com/lib/ref/trf.html.Improved the robustness of the internal
extend ctroutines.[Contributor facing only] created
pymedphys dev mssqlwhich boots up a docker image of the Developer edition of Microsoft SQL. This is for utilisation by the Mosaiq testing suite.[Contributor facing only] made
pymedphys dev tests --cypressautomatically include the options-vand-sfor displaying thecypressprintouts during testing as well as--reruns 5so that the test automatically reruns on failure in alignment with the CI procedure.
0.36.1¶
New features and enhancements¶
Added the
icominstallation option which can be run by callingpip install pymedphys[icom]==0.36.1. This will install only the dependencies needed for the iCom listener.
0.36.0¶
News around this release¶
We have a new team member, Derek Lane he has undergone swathes of work around improving the long term maintenance of the Mosaiq SQL code. Thank you Derek! 🎉 🎈 🥳.
Matt Jennings has rejoined the team, picking up his previous hat of Maintainer, great to have you back Matt 😊.
Breaking changes¶
The modules
pymedphys.electronfactorsandpymedphys.wlutzwere removed from the public API.There did not appear to be any usage of these modules outside of Cancer Care Associates.
The electron factors module can be re-exposed upon request.
The Winston Lutz module is undergoing a significant re-work and will be re-exposed in its new form once complete.
There have been a range of changes to the previously undocumented Mosaiq database connection and execution API.
pymedphys.mosaiq.connectnow returns aConnectionobject instead of aCursorobject. This was so as to align with PEP0249. See https://github.com/pymedphys/pymedphys/pull/1352.All instances where previously the argument name within a function or method was
cursorhave been changed toconnection.Previously a server and port could be provided to
pymedphys.mosaiq.connectby passing it as a colon separated string, for example"localhost:1234". This is no longer the case. Now, hostname and port need to be provided separately. There are also three extra arguments,alias,username, andpassword. See either the docs https://docs.pymedphys.com/lib/ref/mosaiq.html or the docstring for more details https://github.com/pymedphys/pymedphys/blob/a124bc56fb576456cc6eec44a711ebd478a995f3/lib/pymedphys/_mosaiq/api.py#L33-L79.Removed
pymedphys.mosaiq.qcls.
[Contributor facing only] replaced
pymedphys dev tests --pylintwithpymedphys dev lint.
New features and enhancements¶
Added CLI argument for setting the hostname on the DICOM listen server. For example
pymedphys dicom listen 7779 --host 127.0.0.1.Added DICOM send functionality to DICOM connect module and made it available on the CLI. For example
pymedphys dicom send 127.0.0.1 7779 path\to\dicom\*.dcmA range of application changes and improvements. The PyMedPhys app can be accessed by running
pymedphys gui.[Streamlit users only] A CLI command
pymedphys streamlit runwas added to facilitate utilising the custom PyMedPhys patches on the streamlit server for arbitrary streamlit apps. See https://github.com/pymedphys/pymedphys/issues/1422.[Contributor facing only] Added the following contributor CLI tools/options:
pymedphys dev tests --mosaiqdb, to load up the tests that depend on having a Microsoft SQL server running. Thanks to Derek Lane for all of his work building the Mosaiq CI workflow and the first set of Mosaiq tests.pymedphys dev doctests, run doctests.pymedphys dev imports, verify optional import logic by creating a clean Python install and attempting to import all modules.pymedphys dev lint, run pylint.pymedphys dev cypress, load up Cypress for interactively writing and running the end-to-end tests.
Misc changes¶
Significant work was undergone to improve the documentation layout. Thanks to Matt Jennings for all his work here.
How Mosaiq username and passwords are saved has been updated. This will result in these credentials being requested once more.
0.35.0¶
News around this release¶
PyMedPhys now has a Discourse group at https://pymedphys.discourse.group. The goal for this group is to build a community where we can discuss and collaborate around all things related to PyMedPhys.
Breaking changes¶
Developer facing only: The
--liveparameter withinpymedphys dev docshas been removed.
New features and enhancements¶
pymedphys dicom listenstores incoming DICOM objects in a directory hierarchy: PatientID/Study Instance UID/Series Instance UID aligning with the DICOM Q/R hierarchy, and more suitable for use with tools like dicompyler and OnkoDICOM. See PR #1208 for more details.
Note
This pymedphys dicom listen adjustment changes where a 3rd party or in-house
program would expect to find the DICOM data on the file system compared to the
previous release.
Please raise an issue on GitHub https://github.com/pymedphys/pymedphys/issues/new if you believe changes like this in the future should be considered a breaking change.
Documentation now uses the new Jupyter Book tool from the Executable Book Project. Among other things this has enabled:
Increased docstring coverage of public functions
Installation on MacOS (Intel) has been simplified and is now the same as for other platforms, thanks to @termim who has taken on the mantle of maintaining
pymssql. See PR pymssql#677 for more details.Streamlit development now supports reloading during development across the whole PyMedPhys library. See PR #1202 for more details.
A pre-release binary has been built and CI infrastructure around it has begun being built. Watch this space for a future release where it will be officially distributed. See PR #1192 for more details.
Create a
__main__.pyso that the PyMedPhys CLI can be called usingpython -m pymedphys.This is to support running the GUI and the tests within the binary.
Created a
requirements-user.txt, this will allow users to install PyMedPhys from the repo while using the exact dependencies that are being tested within the CI. See PR #1266 for more details.pymedphys dev propagatehad the--copiesand--pyprojectflags added. This allows for subsections of propagate to be undergone instead of the whole procedure.
Bug fixes¶
CLI initialisation was delayed by unused tensorflow imports
Pseudonymisation of Decimal String (e.g. Patient Weight) was failing. See #1244 for more details.
Pseudonymisation of Date, Time or DateTime elements with embedded UTC offsets would fail.
Improved Mosaiq username and password login. Thank you @nickmenzies for reporting. See PR #1199 for more details.
pymedphys guiwill use the Python used to run the CLI to boot streamlit as opposed to the streamlit able to be found on the user’s PATH. See pymedphys/_gui.py for more details. This is to support booting the GUI within the binary.dateutildependency was removed for compatibility reasons with Streamlit’s cache. This tool was replaced with an equivalent tool withinpandas. See pymedphys/_trf/manage/identify.py for more details.A range of fixes for the testing infrastructure for the case where the pymedphys CLI isn’t on the user’s path.
This was to support testing within the binary infrastructure.
Library structure changes¶
All GUI tools that are labelled experimental are now appropriately located within the experimental part of the library.
0.34.0¶
News around this release¶
🚀 Stuart Swerdloff (@sjswerdloff) has agreed to come on board as a maintainer of PyMedPhys. Thank you Stuart! You have been a massive help and encouragement.
Created an online PyMedPhys GUI. It is accessible from https://app.pymedphys.com. This is in its early stages and most parts of the online GUI are not optimised for use in this fashion.
Of note, its main purpose is to demonstrate the GUI functionality. If you wish to begin using this GUI in your centre install PyMedPhys on your local machine and then start it by calling
pymedphys guiwithin a terminal/command prompt.The online demo GUI should not have sensitive information submitted to it.
@matthewdeancooper uploaded his Masters thesis on deep learning auto-segmentation to the docs.
PyMedPhys was featured in a talk at the ACPSEM 2020 Summer School. Both the video and slides are available online.
“Stable” API changes¶
Breaking changes¶
The parameter
fraction_numberwithinpymedphys.Delivery.from_dicomandpymedphys.Delivery.to_dicomhas been changed tofraction_group_number.The name of the first argument to
pymedphys.Delivery.from_dicomhas been changed fromdicom_datasettortplan. It now also accepts either apydicom.Datasetor a filepath.A range of files utilised by
pymedphys.data_pathand related functions that contained the words “mudensity”, “mu-density”, or “mu_density” have been replaced with “metersetmap”.The exceptions that
pymedphys.Delivery.from_mosaiqraises when either no entry in Mosaiq is found (NoMosaiqEntries) or multiple entries are found (MultipleMosaiqEntries) now both inherit fromValueErrorinstead of the baseExceptionclass.
Deprecations¶
All instances of
mudensityhave been replaced withmetersetmap. ThemudensityAPI is still currently available, but it will be removed in a future release.pymedphys.Delivery.from_logfilehas been renamed aspymedphys.Delivery.from_trf. The previous name is still temporarily available but it will be removed in a future release.
New features¶
Bug fixes¶
Sometimes a range of DICOM API calls would require the downloading of a baseline DICOM dictionary. This is now distributed with the library.
GUI changes¶
Logistics changes¶
pymedphys guinow boots up a multi application index. This index breaks applications up into five categories, mature, maturing, raw, beta, and experimental.
Pseudonymise¶
A new pseudonymise application has been created. This allows users to drag and drop DICOM files into the GUI and then download the resulting DICOM file in its pseudonymised form. Thanks @sjswerdloff!
MetersetMap¶
New Features¶
The MetersetMap comparison application (which used to be MU density) is now able to work with a bare bones configuration file which can be used by just dragging and dropping TRF and DICOM files for comparison. See #1117 for details of the configuration file needed.
Path configuration now supports expansion of
~to the users home directory.
Bug fixes¶
In some cases a patient having a middle name would cause the DICOM file upload method to crash. Thanks @mchamberland for reporting in #1137 and thanks @sjswerdloff for the prompt fix in #1144!
Experimental applications¶
A new “anonymise monaco” application has been exposed. This allows the back-end Monaco filesystem to be anonymised in such a way that Monaco can still open and work with the contents.
A new “dashboard” application has been exposed. This connects to multiple Mosaiq sites and displays the QCLs across each site.
A new “electrons” application has been exposed. This reads Monaco back-end files, extract the electron insert shape and then predicts the corresponding insert output factor.
A new “iviewdb” application has been exposed. This allows for exploration of the iView database.
Work has begun on a new Winston Lutz Arc GUI.
Configuration changes¶
New keys¶
~/.pymedphys/config.tomlshould now include aversion = 1entry. This is to support undergoing breaking changes withinconfig.tomlbut allowing PyMedPhys to still read in old configuration files without issue.For use within the up-coming Winston-Lutz Arc GUI a new key
site.export-directories.iviewdbhas been created.
Beta API changes¶
Nil
Experimental API changes¶
Breaking changes¶
Removed
pymedphys experimental gui.
New Features¶
Within
pymedphys.experimental.pseudonymisationbothpseudonymiseandis_valid_strategy_for_keywordswere added.pseudonymiseprovides a convenient simple API for pseudonymisation. See the API docs for more information. Credit to @sjswerdloff for all his work here.
Developer facing API changes¶
The pymedphys library directory has moved to
lib/pymedphys. After this move you will need to rerunpoetry install -E devThe development branch of pymedphys has moved from master to main
Documentation is now stored within the library, moving from
docstolib/pymedphys/docsDocs can now be built, viewed, and updated with hot-reloading by running
poetry run pymedphys dev docs --live.The output directory for the docs building can now be controlled by passing an
--outputflag topymedphys dev docs.A new CLI utility that propagates a range of files that depend upon each other files within the repo are “propagated” by calling
poetry run pymedphys dev propagate. The files created/updated by this command arelib/pymedphys/_version.py,requirements.txtandrequirements-dev.txt,lib/pymedphys/.pylintrc,lib/pymedphys/docs/README.rst,lib/pymedphys/docs/CHANGELOG.md, and the ‘extras’ field withinpyproject.toml.pymedphys dev testsincludes simplified flags.--run-only-slowcan be undergone with--slow,--run-only-yarnwith--cypress,--run-only-pydicomwith--pydicom, and--run-only-pylinacwith--pylinac.Within cypress end to end testing the custom
cy.startcommand now has a parameterappwhich refers to the URL app key of the application to be testedhttp://localhost:8501/?app=${app}.
0.33.0¶
“Stable” API changes¶
Beta API changes¶
Nil
Experimental API changes¶
Breaking changes¶
Removed a range of unmaintained experimental package APIs; film, collimation, sinogram, and Profile. The underlying code has not been removed, but they are no longer exposed through the APIs.
Bug fixes¶
New Features¶
Created a Mosaiq QCL dashboard that reads the QCLs from multiple Mosaiq installs across multiple sites. _gui/streamlit/dashboard.py#L20-L78
Internal Changes¶
Made it so that when developing streamlit apps an autoreload function can be used to have the streamlit app update on dependency changes. _streamlit/rerun.py#L89-L96
See discussion over on streamlit’s issue tracker
Internal Mosaiq connection function now accepts custom functions for prompting the user for their database username, password, and prompting the user with responses. _mosaiq/connect.py#L134-L147
This was utilised for connecting to a fresh database within streamlit. _streamlit/mosaiq.py#L20-L50
Created tool to manage
pyproject.tomlextras. scripts/propagate-extras.py#L26-L51See discussion on the poetry issue tracker for more details.
0.32.0¶
“Stable” API changes¶
Bug fixes¶
Breaking changes¶
config.tomlhas undergone a few breaking changes.See the example for a working config file.
See below for a comparison highlighting the key differences.
# Previous version
[[site]]
name = "rccc"
escan_directory = '\\pdc\Shared\Scanned Documents\RT\PhysChecks\Logfile PDFs'
[[site.linac]]
name = "2619"
icom_live_directory = '\\rccc-physicssvr\iComLogFiles\live\192.168.100.200'
# New version
[[site]]
name = "rccc"
[site.export-directories]
escan = '\\pdc\Shared\Scanned Documents\RT\PhysChecks\Logfile PDFs'
anonymised_monaco = 'S:\DataExchange\anonymised-monaco'
icom_live = '\\rccc-physicssvr\iComLogFiles\live'
[[site.linac]]
name = "2619"
ip = '192.168.100.200'
New Features¶
Two new optional keywords were added to
pymedphys.dicom.anonymise. These arereplacement_strategyandidentifying_keywords. This was designed to support alternative anonymisation methods. The API to the anonymise function is being flagged for a rework and simplification for which a breaking change is likely to occur in the near future.Added ability to configure logging via
config.toml.
Data file changes¶
Refers to the data files accessible via pymedphys.data_path,
pymedphys.zip_data_paths, and pymedphys.zenodo_data_paths.
The data file
pinnacle_test_data_no_image.zipwas removed and its contents were moved intopinnacle_test_data.zip.Data files
treatment-record-anonymisation.zip,negative-mu-density.trf, andtrf-references-and-baselines.zipwere added.
Beta API changes¶
Nil
Experimental API changes¶
New Features¶
Added pseudonymisation as an experimental extension of anonymise.
This API is undergoing refinement, however in its current form it is accessible via
pymedphys.experimental.pseudonymisation.pseudonymisation_dispatchandpymedphys.experimental.pseudonymisation.get_default_pseudonymisation_keywords. These are designed to be passed to the new keywordsreplacement_strategyandidentifying_keywordswithinpymedphys.dicom.anonymise.The pseudonymisation strategy uses SHA3_256 hashing for text and UIDs, date shifting for dates, and jittering for Age. The intent is to enable sets of data that are correlated to remain correlated, and to prevent uncorrelated patient/study/series from clashing.
Added experimental pseudonymisation CLI. Callable via
pymedphys experimental dicom anonymise --pseudo path/to/dicom.dcmAdded
pymedphys experimental gui. This is a testing ground for new GUIs that are intended to appear withinpymedphys guiin the future. The GUIs exposed under this experimental scope are minimally tested.At this point in time, the new GUIs include a GUI index, an electron insert factor prediction tool, and a Monaco anonymisation tool.
0.31.0¶
“Stable” API changes¶
Critical bug fixes¶
Fixed bug where
pymedphys dicom anonymiseandpymedphys.dicom.anonymisewould not anonymise nested tags. Thanks sjswerdloff for finding and fixing #920.
Breaking changes¶
Removed the
--publishoption from CLIpymedphys dev docs.Moved
pymedphys logfile orchestrationtopymedphys trf orchestrate
New features¶
pymedphys.zenodo_data_pathshas a new optional parameterfilenamesthat can be used to only download some files.pymedphys.data_pathhas a new optional parameterhash_filepathwhich can be used to provide a custom hash record.Added usage warning to the MU Density GUI.
Deprecations¶
pymedphys.read_trfhas been replaced withpymedphys.trf.read. The old API is still available, but will be removed in a future version.
Bug fixes¶
Cache data downloads now also retry when a
ConnectionResetErroroccurs.
Beta API changes¶
New features¶
A new
pymedphys.betamodule created. This is intended to allow a section of the API to be exposed and iterated on but having breaking changes not induce a major version bump (when PyMedPhys goes tov1.0.0+)Added
pymedphys.beta.trf.identifyto allow the usage of Mosaiq to identify a trf logfile.
0.30.0¶
Breaking changes¶
Removed the proof of concept
pymedphys bundleCLI as well all of its associated code.Removed a range of unused files from the
pymedphys.data_pathAPI.The previous install options
pip install pymedphys[pytest]andpip install pymedphys[pylint]have been removed and replaced withpip install pymedphys[tests].
New Features¶
Added a new toolbox for retrieving PTW Quickcheck measurement data and write it to a csv file.
pymedphys labs quickcheck to-csv your.quickcheck.ip path/to/output.csvAdded
pymedphys dev teststo the CLI.Moved all of tests into the pymedphys repo itself. Now the automated testing suite is able to be run from a pypi install.
This CLI has options such as
--run-only-pydicom,--run-only-slow, and--run-only-pylinacso that upstream tools can run tests on this downstream project.These extra options are directly passed through to
pytest. To achieve this, made thepymedphysCLI be able to optionally handle arbitrary commands.
Made the Zenodo download tool retry up to four times should the download fail.
Added DICOM helpers functionality and updated the Mosaiq helpers as a part of the UTHSCSA TPS/OIS comparison project. Not yet exposed as part of the API. See _mosaiq/helpers.py#L353-L482
Added more debugging strings to the iCOM CLI. See these outputs by running
pymedphys --debug icom listen external.nss.ip.address your/output/directoryThese were added to support remotely debugging the iCOM listen software. To see the conversation around debugging that tool see the PyMedPhys forum discussion
Format of MU in logging display now rounded to one decimal.
Dependency changes¶
Now depending on
pylibjpeg-libjpegin order to decode lossless-jpeg files.m2ris no longer used to build the docs.No longer using
toxfor tests.
Bug fixes¶
Fixed an issue where the iCOM listener could not handle Machine IDs that were not entirely an integer.
See _icom/mappings.py#L6 for changes.
See the PyMedPhys forum discussion for details.
Fixed a case where on some Windows environments
pymedphys dev docswould not run.Fixed a case where on some Windows environments
pymedphys guiwould not run.Fixed issue where the
pymedphys logfile orchestrationCLI would not be able to create anindex.json, or a range of the needed directories on its first run.See the PyMedPhys forum discussion for more details.
Documentation updates¶
Fixed an issue where the displayed CSV files for configuring
pymedphys logfile orchestrationwould actually cause an error due to excess spaces used for display purposes.See the PyMedPhys forum discussion for more details.
Development changes¶
Removed any file that was larger than 300 kB from the git history bring down clone times to a manageable state.
The
pre-committool now does not allow commits greater than 300 kB.All testing files that were larger than 300 kB have been moved to Zenodo.
All tests have been moved from
/testsinto/pymedphys/tests, running these tests can now be undergone by callingpymedphys dev testsNo longer using
tox.
0.29.1¶
Bug fixes¶
Fix issue in some Windows environments where running
pymedphys guiwould not find the streamlit installation. _gui/init.py
0.29.0¶
Breaking changes¶
Changed the
patient_directoriesicom parameter to accept a list of paths instead of a single path within the pymedphysconfig.toml. config.toml#L67-L72Changed
pymedphys guiiCOM path resolution logic to instead search over a list of paths instead of just one path as before. mudensity-compare.py#L668-L670
0.28.0¶
Overview¶
This release primarily focused on changes regarding the iCOM listener and the PyMedPhys GUI that utilises these iCOM records.
Breaking changes¶
Removed the
pymedphys icom archiveCLI command, this archiving is now built directly into the listener itself.
New Features¶
The
pymedphys icom listenerCLI command now will collect the icom stream into beam delivery batches and index them by patient name. This functionality used to be undergone within thepymedphys icom archiveCLI, but this functionality has now been merged into the listener. listener.py#L79Should an error occur within
pymedphys icom listenerCLI it will now pause for 15 minutes and then reattempt a connection.Add in extra sanity checks within the iCOM patient indexing tooling.
Added a
--debugand--verboseflag to the PyMedPhys CLI which allows users to set the logging level. These logging levels are currently only utilised within thepymedphys icom listenCLI. cli/main.py#L51-L70
Bug fixes¶
Reduced the buffer size of the iCOM listener. listener.py#L9
If either the listener is turned off and then on again, or it is interrupted the next time an iCOM stream socket is opened the Linac appears to send a larger batch containing prior irradiations. The listener code was adjusted to handle these extra bursts. listener.py#L57-L83
Made PyMedPhys GUI skip name formatting attempt if the original patient name format was not as expected. mudensity-compare.py#L733-L738
0.27.0¶
New Features¶
Added an optional
--structuresflag topymedphys dicom merge-contours. This allows you to only compute the merge for those structures named.
0.26.0¶
New Features¶
Created a function to merge overlapping contours that have the same name within a DICOM structure file.
Exposed the above command as a part of the CLI. It is runnable with
pymedphys dicom merge-contours
0.25.1¶
Dependency Changes¶
Now included
psutilas an optional dependency.
Quality of life improvements¶
Now raises a descriptive error when a DICOM RT plan file’s control point is missing a cumulative meterset weight. https://github.com/pymedphys/pymedphys/blob/dfd418a6dd1b8b57ba6bbfd27a498596477ceb6f/pymedphys/_dicom/delivery/core.py#L180-L196
When running
pymedphys guifor the first time, no longer doesstreamlitrequest credentials. https://github.com/pymedphys/pymedphys/blob/dfd418a6dd1b8b57ba6bbfd27a498596477ceb6f/pymedphys/_gui/__init__.py#L24-L36
Development changes¶
Implemented Cypress GUI testing infrastructure into the CI workflow. See details at https://dashboard.cypress.io/projects/tgt8f6/runs.
0.25.0¶
New Features¶
Created the command line tool
pymedphys guiwhich boots the GUI for PyMedPhys within your browser. GUI at this stage is quite minimal.Created a tool to handle a PyMedPhys config file, by default stored within
~/.pymedphys/.config.toml. That config file can have aredirectfield to allow configuration to be stored in a different location such as within a git repo, or a network drive.pymedphys.zip_data_pathsnow has a new optional parameterextract_directory. When this parameter is passed the contents of the zip downloaded zip data will be extracted to the provided directory. For example now the following is possible:
import pathlib
import pymedphys
CWD = pathlib.Path.cwd()
pymedphys.zip_data_paths("mu-density-gui-e2e-data.zip", extract_directory=CWD)
pymedphys.Delivery.from_dicom()now supports step and shoot and 3DCRT DICOM plan files.Work on
pymedphys.Delivery.from_monaco()was undergone with an attempt to support step and shoot plans. This work was preliminary.Created a utility to pretty print patient names
Added ground work for e2e testing of
pymedphys guiwith the cypress tool.
0.24.3¶
Bug Fixes¶
Within the bundle created by
pymedphys bundlefixed a bug where the streamlit server will not start due stdout not flushing.
0.24.2¶
Bug Fixes¶
Within the bundle created by
pymedphys bundlefixed a bug where sometimes the streamlit server would not start should a stdout race condition occur.
0.24.1¶
Bug Fixes¶
Include
matplotlibwithinstreamlitbundle. Streamlit requires this but has not labeled it as a dependency.Call
yarnfromos.system, for some reason on Windowssubprocess.check_callcould not findyarnon the path, although on Linux this worked fine.
0.24.0¶
Breaking Changes¶
If
pymedphys.mosaiq.connectis passed a list of length one, it will now return a cursor within a list of length 1 instead of just returning a cursor by itself.
New Features¶
Added a
pymedphys bundlecli function which creates an electron streamlit installation bundle.Added the ‘all’ fractions option to
Delivery.from_dicomwhich can be used aspymedphys.Delivery.from_dicom(dicom_file, fraction_number='all')Made the iCOM patient archiving only save the data if MU was delivered.
Added wlutz mock image generation functions
Handle more Monaco
tel.1cases withinDelivery.from_monacoget_patient_nameadded topymedphys._mosaiq.helpers
Algorithm Adjustments¶
Wlutz bb finding cost function adjusted
Note, wlutz algorithm still not ready for the prime time
0.23.0¶
Breaking Changes¶
Removed
jupyter,bundle, andappsub commands from the CLI.Removed the
guiandjupyteroptional extra installation commands.In order to support Python 3.8, the
pymssqldependency needed to be removed for that Python version. All tools that make SQL calls to Mosaiq will not currently work on Python 3.8.
New Features¶
PyMedPhys now is able to be installed on Python 3.8.
Dependency Changes¶
No longer depend upon
pymssqlfor Python 3.8.
Bug Fixes¶
Fix
pymedphys._monacopackage path.Fixed issue where the following header adjustment DICOM CLI tools may not work with
pydicom==1.4.2. See https://github.com/pymedphys/pymedphys/pull/747 and https://github.com/pymedphys/pymedphys/pull/748.pymedphys dicom adjust-machine-namepymedphys dicom adjust-REDpymedphys dicom adjust-RED-by-structure-name
0.22.0¶
New Features¶
Implemented
from_icommethod on thepymedphys.Deliveryobject. This was to support calculating an MU Density from an iCOM stream.
0.21.0¶
Dependency Changes¶
Once again made
shapelya default dependency with the aim to make installation be “batteries included”.Shapelynow ships wheels for Windows. This meansshapelywill install normally with pip. See https://github.com/Toblerity/Shapely/issues/815#issuecomment-579945334
Pinned
pydicomdue to a currently unknown issue with a new version breaking apymedphystest.
0.19.0¶
Breaking Changes¶
Made shapely an optional dependency once more. No longer depending on
shapely-helper.Shapely can be installed by running
pip install pymedphys[difficult]==0.19.0This fixes an issue where
piprefuses to install due to theshapely-helperworkaround.
0.18.0¶
Breaking Changes¶
Removed the optional extras tags of
library,labs, anddifficult. All of these now install by default. For example PyMedPhys can no longer be installed withpip install pymedphys[library].
Quality of life improvements¶
Installation of PyMedPhys has been reverted to including all of its primary dependencies. This was done to make the default install less confusing. Nevertheless, these dependencies are mostly optional and if you wish you can install with
pip install pymedphys --no-depsto have a minimal installation.Made a
shapely-helperspackage which automatically handles installation ofshapelyon Windows. PyMedPhys now depends onshapely-helpersinstead ofshapely.
0.17.0¶
New Features¶
Initial alpha release of an experimental JupyterLab application bundler. Run with
pymedphys bundlein a directory that contains anotebooksdir and arequirements.txtfile.
0.16.3¶
Bug Fixes¶
Gracefully reject ipython inspection for optional modules by returning
Nonefor ‘file’ attribute requests for modules that are not currently installed.
0.16.2¶
Bug Fixes¶
Fixed bug with optional dependency logic within
apipkg. Occurred whenever an optional submodule was called, for examplescipy.interpolate.
0.16.0¶
Package changes¶
The license of the package has changed from
AGPL-3.0-or-latertoApache-2.0.
New Features¶
Expose
pymedphys.electronfactors.plot_modelas part of the public API.
0.14.1¶
Bug Fixes¶
Given the input to
pymedphys.gammais unitless, removed the units from the logging output of gamma. See https://github.com/pymedphys/pymedphys/issues/611
0.14.0¶
Breaking Changes¶
Moved
pymedphys pinnaclecli command to be nested underpymedphys labs pinnacle
Dependency Changes¶
Made the greater majority of the pymedphys dependencies optional. Should a dependency be required during usage an error is raised informing the user to install the package. To install all pymedphys dependencies as before now run
pip install pymedphys[library,labs]==0.14.0.
0.12.0¶
Breaking Changes¶
The API has undergone a complete redesign. Expect most code to be broken with this release.
0.11.0¶
Breaking Changes¶
Within
dose_from_datasetthereshapeparameter has been removed.Removed the following functions:
load_dicom_dataaxes_and_dose_from_dicomextract_depth_doseextract_profiles
New Features¶
Added functions
pymedphys.dicom.depth_doseandpymedphys.dicom.profiles.Exposed the
trf2pandasfunction viapymedphys.fileformats.trf2pandas.
Improvements¶
Made the resolution detection of
pymedphys.plt.pcolormesh_gridmore robust.
0.10.0¶
New Features¶
Re-exposed
convert2_ratio_perim_areaandcreate_transformed_meshfrompymedphys.electronfactors.Pinnacle module providing a tool to export raw Pinnacle data to DICOM objects.
A CLI is provided: See the Pinnacle CLI docs.
As well as an API: See the Pinnacle library docs.
0.9.0 – 2019/06/06¶
New Features¶
Re-exposed
multi_mosaiq_connect,multi_fetch_and_verify_mosaiq,get_qcls_by_date, andget_staff_namefrompymedphys.msq.
0.8.4 – 2019/06/04¶
Package changes¶
Made
xlwingsnot install by default if system isLinuxwithinsetup.pyRemoved unreleased
jupyterbased GUI
0.8.3 – 2019/06/04¶
Package changes¶
Updated MANIFEST file within
pymedphys_fileformatsto appropriately include LICENSE files.
0.8.0 – 2019/06/01¶
Breaking Changes¶
DeliveryDatahas been renamed toDeliveryand is now importable by runningfrom pymedphys import DeliveryA range of functions that used to use
DeliveryDataare now instead accessible as methods on theDeliveryobject.
A large number of functions that were previously exposed have now been made private in preparation for eventually stabilising the API. No function that was within the documentation has been removed. If there is a function that you were using that you would like to be exposed via
importagain, please let us know by opening an issue on GitHub and we will happily re-expose it! However, please bear in mind that the entire API that is currently exposed will likely change before a 1.0.0 release.anonymise_dicom_dataset()has been renamed toanonymise_dataset()to remove redundant labelling.mu_density_from_delivery_datamoved from themsqmodule to themudensitymodule.compare_mosaiq_fieldsmoved from themsqmodule into theplancomparemodule.pymedphys.dicom.get_structure_aligned_cubehas had itsx0parameter changed from required to optional. It is no longer the first parameter passed to the function. By defaultx0is now determined using the min/max bounds of the structure.The DICOM coordinate extraction functions -
extract_dicom_patient_xyz(),extract_iec_patient_xyz()andextract_iec_fixed_xyz()- have been combined into a single function calledxyz_from_dataset(). The x, y, z axes can still be returned in either the DICOM, IEC fixed or IEC patient coordinate systems by passing the following case-insensitive strings to thecoord_system=parameter ofxyz_from_dataset():DICOM:
'd'or'DICOM'IEC fixed:
'f','fixed'or'IEC fixed'IEC patient:
'p','patient'or'IEC patient'
gamma_dicomnow take datasets as opposed to filenames
New Features¶
A DICOM anonymisation CLI! See the DICOM Files CLI docs.
anonymise_file()andanonymise_directory():two new DICOM anonymisation wrapper functions that take a DICOM file and a directory as respective arguments.
is_anonymised_dataset(),is_anonymised_file()andis_anonymised_directory():three new functions that check whether a pydicom dataset, a DICOM file or all files within a directory have been anonymised, respectively.
coords_from_xyz_axes()is a previously internal function that has now been exposed in the API. It converts x, y, z axes returned byxyz_from_dataset()into a full grid of coordinate triplets that correspond to the original grid (pixel array or dose grid).
0.7.1 – 2019/04/05¶
Performance Improvements¶
reduced PyPI package size by removing unnecessary development testing files.
0.7.0 – 2019/04/05¶
Breaking Changes¶
anonymise_dicomhas been renamed toanonymise_dicom_datasetThe CLI interface
trf2csvhas been replaced withpymedphys trf to-csv. This has the same usage, just a changed name to come in line with the rest of the CLI interfaces exposed by PyMedPhys.
New Features¶
Implementing a suite of Dicom objects, currently a work in progress:
DicomBase, a base DICOM class that wrapspydicom’sDatasetobject. This class includes additions such as an anonymisation method.DicomImage, designed to hold a single DICOM image slice. Might someday contain methods such asresampleand the like.DicomSeries, a series ofDicomImageobjects creating a CT dataset.DicomStructure, designed to house DICOM structure datasets.DicomPlan, a class that holds RT plan DICOM datasets.DicomDose, a class that to hold RT DICOM dose datasets. It has helper functions and parameters such as coordinate transforms built into it.DicomStudy, a class designed to hold an interrelated set ofDicomDose,DicomPlan,DicomStructure, andDicomSeries. Not every type is required to create aDicomStudy. Certain methods will be available onDicomStudydepending what is housed within it. For example having bothDicomDoseandDicomStructureshould enable DVH based methods.DicomCollection, a class that can hold multiple studies, interrelated or not. A common use case that will likely be implemented isDicomCollection.from_directory(directory_path)which would pull all DICOM files nested within a directory and sort them intoDicomStudyobjects based on their header UIDs.
Added CLI commands for a WIP docker server, logfile orchestration, and DICOM editor tools.
Added a range of xlwings tools that allow the use of PyMedPhys functions within Excel
Added rudimentary code to pull profiles from Mephysto files.
The previously separate
decodetrflibrary is now distributed within PyMedPhys. You can now simply install PyMedPhys and runpymedphys trf to-csvwithin the command line to convert.trffiles into.csvfiles.
0.6.0 – 2019/03/15¶
Breaking Changes¶
All uses of “dcm” in directory names, module names, function names, etc. have been converted to “dicom”. Anything that makes use of this code will need to be adjusted accordingly. Required changes include:
pymedphys.dcm–>pymedphys.dicomcoords_and_dose_from_dcm()–>coords_and_dose_from_dicom()dcmfromdict()–>dicom_dataset_from_dict()gamma_dcm()–>gamma_dicom()
MU Density related functions are no longer available under the
pymedphys.collpackage, instead they are found withinpymedphys.mudensitypackage.The DICOM coordinate extraction functions now return simple tuples rather than
Coordsnamedtuples:extract_dicom_patient_xyz()extract_iec_patient_xyz()extract_iec_fixed_xyz()
New Features¶
DICOM anonymisation now permits replacing deidentified values with suitable “dummy” values. This helps to maintain compatibility with DICOM software that includes checks (beyond those specified in the DICOM Standard) of valid DICOM tag values. Replacing tags with dummy values upon anonymisation is now the default behaviour.
A set of 3D coordinate transformation functions, including rotations (passive or active) and translations. Transformations may be applied to a single coordinate triplet (an
ndarray) or a list of arbitrarily many coordinate triplets (a 3 x nndarray). NB: Documentation forthcoming.
Code Refactoring¶
All uses of
dcmas a variable name for instances of PyDicom Datasets have been converted todsto match PyDicom convention.