All notable changes to are documented here.
This project adheres to Semantic Versioning.
- PyMedPhys no longer has a Discourse group. Forum-like conversation and collaboration has moved to GitHub Discussions.
- PyMedPhys now includes its own custom,
numba-accelerated implementation of multilinear interpolation. You can find the technical reference here. This was implemented for the following reasons:- The PyMedPhys implementation gives a 5-8x speed boost over EconForge's
interplationand 10-70x over Scipy'sRegularGridInterpolator. See the technical reference page for a performance comparison. - At the time of writing, EconForge's
interpolationappears incompatible withnumba>=0.60. - Removing an additional dependency (namely, EconForge's
interpolation) is generally better for maintenance, holding all else equal.
- The PyMedPhys implementation gives a 5-8x speed boost over EconForge's
- WARNING: Updating to
scipy >= 1.11introduced changes to test baselines for the electron factors algorithm. This occurred without anypymedphyscode changes. Changes in baseline on the order of ~0.5% have been observed to be, but we cannot guarantee that changes in a given electron factor calculation do not exceed 0.5%. If you do use this algorithm, we strongly recommend that you compare current results with previously known results and report any large deviations here
- The gamma tool now utilises EconForge's
interpolationpackage by default. Initial testing shows improvements in gamma calculation times by approximately a factor of 4. PR #1761 - Improvements to Elekta TRF decoding. PR #1773
- The Pinnacle Export Tool has been added to the stable API and is no longer considered experimental. PR #1803
- The Pinnacle Export Tool now supports the
inverse_greyROI display colour. PR #1784
- To simplify maintenance, all experimental modules other than
pseudonymise,quickcheckandstreamlithave been removed. These may be added back upon request.
- This is the version of PyMedPhys reviewed for PyMedPhys' first publication within the Journal of Open Source Software (JOSS). The paper can be accessed here
- Utilise pylibjpeg-libjpeg 1.3.2 or greater (Current libjpeg version for Apple M1 compatibility)
pymedphys dicom anonymisenow produces DICOM conformant patient names in the anonymised result.- Shout out to Rebecca Moylan and Stephen Smith for the bug report! Thank you!
- A release intended for use by JOSS, however, a subsequent release was utilised instead.
- The Gamma tool now utilises the
loggingmodule. Thequietparameter forpymedphys.gammais deprecated but its use is non-breaking (for now). - The
pymedphys.electronfactorshas been added back in to the public API in Pull Request.
- The
devextra has been reduced and an additional extraallhas been added: Pull Request
- Phillip Chlap has joined as a pymedphys Maintainer
- Thanks to Cedric for reporting and fixing DICOM coordinates bug: Discourse
- Privacy related bug within the experimental components of pymedphys (not stable) has been fixed. See bug fix notes.
- Pseudonymise was susceptible to brute-force reversal, mitigated in Pull Request
- DICOM Coordinates
- Fix pixel spacing bug Pull Request
- Pinnacle Export Tool
- Write DICOM files to be more compatible with other software Pull Request
- Daily Winston-lutz
- Small workaround Pull Request
- Pinnacle Export Tool
- A new CLI option is provided to append the patient MRN to the output path for convenience. Thanks crewso for submitting this Pull Request
- Make it so that Mephysto files that have non-unicode characters can still be opened.
- Varying penumbra and ball bearing diameter within the Monthly WLutz application now accepts floating point numbers as well as numbers smaller than the default.
- Fixed a bug where
Delivery.from_monacowouldn't be able to load beams where the stop angle of one beam was +180 and the start angle of the subsequent beam was -180 (or visa-versa). The conversion from IEC to bipolar is now handled on a "per-beam" basis. This bug affected the MetersetMap application.
- The daily WLutz application can now have its bb size configured.
- Site can now be passed as a URL parameter to the daily WLutz application.
- Improved error messaging around the configuration of the iView machine alias.
- 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 grow to be what it is today. Thank you Jake 😊.
- The configuration for the TRF CLI now utilises the centralised
config.tomlfile instead of the priorCSVfiles.
- A range of applications 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.
- 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.
- 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 😊.
- 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 pymedphys#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.
- 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\*.dcm - A 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 pymedphys#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.
- 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.
- 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.
- Developer facing only: The
--liveparameter withinpymedphys dev docshas been removed.
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.
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.
- 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.
- All GUI tools that are labelled experimental are now appropriately located within the experimental part of the library.
- 🚀 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.
- 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
- @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.
- 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.
- 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.
- Added CLI
pymedphys dicom listen#1161. This begins a DICOM listener which will store the DICOM files sent to it to disk. It accepts the arguments--port,--aetitle, and--storage_directory. Thanks @pchlap!
- Sometimes a range of DICOM API calls would require the downloading of a baseline DICOM dictionary. This is now distributed with the library.
pymedphys guinow boots up a multi application index. This index breaks applications up into five categories, mature, maturing, raw, beta, and experimental.
- 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!
- 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.
- 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!
- 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.
~/.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.
- Nil
- Removed
pymedphys experimental gui.
- 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.
- The pymedphys library directory has moved to
lib/pymedphys. After this move you will need to rerunpoetry install -E dev - The development branch of pymedphys has moved from master to main
- Documentation is now stored within the library, moving from
docstolib/pymedphys/docs - Docs 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}.
- To install pymedphys with all of its user dependencies now the following needs to be run:
pip install pymedphys[user]- When
pip install pymedphysis called, PyMedPhys will now be installed with minimal/no dependencies.- Pull request #1036
Nil
- 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.
- Made it so that
import pymedphys.experimentaldoes not raise anImportErrorwhen an optional dependency has not been installed. - Fixed a bug where pseudonymisation wouldn't work when in cases of identifying sequences.
- Created a Mosaiq QCL dashboard that reads the QCLs from multiple Mosaiq installs across multiple sites. _gui/streamlit/dashboard.py#L20-L78
- 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-L51- See discussion on the poetry issue tracker for more details.
- Fixed bug in the PyMedPhys trf decoding logic where leaf pairs 77, 78, 79, and 80 on the Y2 bank were decoded into having the wrong sign.
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'- 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.
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.
Nil
-
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.
- This API is undergoing refinement, however in its current form it is
accessible via
-
Added experimental pseudonymisation CLI. Callable via
pymedphys experimental dicom anonymise --pseudo path/to/dicom.dcm -
Added
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.
- Pinnacle Export Tool now allows for the trial to be set using the CLI. See issue #973 and pull request #995 for more details.
- Fixed bug where the dose grid in the Pinnacle Export Tool was only correct when patients were in HFS. See #929 for more details.
- Fixed bug where
pymedphys dicom anonymiseandpymedphys.dicom.anonymisewould not anonymise nested tags. Thanks sjswerdloff for finding and fixing #920.
- Removed the
--publishoption from CLIpymedphys dev docs. - Moved
pymedphys logfile orchestrationtopymedphys trf orchestrate
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.
pymedphys.read_trfhas been replaced withpymedphys.trf.read. The old API is still available, but will be removed in a future version.
- Cache data downloads now also retry when a
ConnectionResetErroroccurs.
- 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.
- Instances of
labshas been changed toexperimental. This affects all imports from the labs and the CLI usage.
- Fixed issue with Pinnacle Export Tool crashing when an image is missing from the archive.
- 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].
- 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.csv - Added
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/directory- These 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.
- Now depending on
pylibjpeg-libjpegin order to decode lossless-jpeg files. m2ris no longer used to build the docs.- No longer using
toxfor tests.
- 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.
- 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.
- 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.
- The
- All tests have been moved from
/testsinto/pymedphys/tests, running these tests can now be undergone by callingpymedphys dev tests- No longer using
tox.
- No longer using
- Fix issue in some Windows environments where running
pymedphys guiwould not find the streamlit installation._gui/__init__.py
- Changed the
patient_directoriesicom parameter to accept a list of paths instead of a single path within the pymedphysconfig.toml. config.toml#L67-L72 - Changed
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
This release primarily focused on changes regarding the iCOM listener and the PyMedPhys GUI that utilises these iCOM records.
- Removed the
pymedphys icom archiveCLI command, this archiving is now built directly into the listener itself.
- 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#L79 - Should 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
- 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
- Added an optional
--structuresflag topymedphys dicom merge-contours. This allows you to only compute the merge for those structures named.
- 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
- Now included
psutilas an optional dependency.
- 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
- Implemented Cypress GUI testing infrastructure into the CI workflow. See details at https://dashboard.cypress.io/projects/tgt8f6/runs.
- 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.
- Within the bundle created by
pymedphys bundlefixed a bug where the streamlit server will not start due stdout not flushing.
- Within the bundle created by
pymedphys bundlefixed a bug where sometimes the streamlit server would not start should a stdout race condition occur.
- 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.
- 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.
- 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_monaco get_patient_nameadded topymedphys._mosaiq.helpers
- Wlutz bb finding cost function adjusted
- Note, wlutz algorithm still not ready for the prime time
- 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.
- PyMedPhys now is able to be installed on Python 3.8.
- No longer depend upon
pymssqlfor Python 3.8.
- Fix
pymedphys._monacopackage path. - Fixed issue where the following header adjustment DICOM CLI tools may not
work with
pydicom==1.4.2. See pymedphys#747 and pymedphys#748.pymedphys dicom adjust-machine-namepymedphys dicom adjust-REDpymedphys dicom adjust-RED-by-structure-name
- Implemented
from_icommethod on thepymedphys.Deliveryobject. This was to support calculating an MU Density from an iCOM stream.- See pymedphys#733
- 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 shapely/shapely#815 (comment)
- Pinned
pydicomdue to a currently unknown issue with a new version breaking apymedphystest.
- Expose some portions of the Winston Lutz API.
- Add iCom listener CLI.
- 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.0 - This fixes an issue where
piprefuses to install due to theshapely-helperworkaround.
- Shapely can be installed by running
- 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].
- 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.
- Made wlutz determination less fussy.
- Initial alpha release of an experimental JupyterLab application bundler.
Run with
pymedphys bundlein a directory that contains anotebooksdir and arequirements.txtfile.
- Gracefully reject ipython inspection for optional modules by returning
Nonefor__file__attribute requests for modules that are not currently installed.
- Fixed bug with optional dependency logic within
apipkg. Occurred whenever an optional submodule was called, for examplescipy.interpolate.
- Updated the badges reported within the README.
- The license of the package has changed from
AGPL-3.0-or-latertoApache-2.0.
- Expose
pymedphys.electronfactors.plot_modelas part of the public API.
- Experimental support for Elekta Unity trf log file decoding.
- Updated wheel to correctly handle optional dependencies.
- Vendored in
apipkgdue to PyPI installation issues.
- Given the input to
pymedphys.gammais unitless, removed the units from the logging output of gamma. See pymedphys#611
- Moved
pymedphys pinnaclecli command to be nested underpymedphys labs pinnacle
- 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.
- Fixed issue where
pymedphys.mosaiq.connectwould not work for just one hostname.
- Fixed issue where
pymedphys.mosaiq.connectwould not work for just one hostname.
- Made
pymedphys.mosaiq.executea part of the API.
- Fixed version number within package.
- Re-added the license classifier to the PyPI upload.
- The API has undergone a complete redesign. Expect most code to be broken with this release.
- Within
dose_from_datasetthereshapeparameter has been removed. - Removed the following functions:
load_dicom_dataaxes_and_dose_from_dicomextract_depth_doseextract_profiles
- Added functions
pymedphys.dicom.depth_doseandpymedphys.dicom.profiles. - Exposed the
trf2pandasfunction viapymedphys.fileformats.trf2pandas.
- Made the resolution detection of
pymedphys.plt.pcolormesh_gridmore robust.
- 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
- Re-exposed
multi_mosaiq_connect,multi_fetch_and_verify_mosaiq,get_qcls_by_date, andget_staff_namefrompymedphys.msq.
0.8.4 -- 2019/06/04
- Made
xlwingsnot install by default if system isLinuxwithinsetup.py - Removed unreleased
jupyterbased GUI
0.8.3 -- 2019/06/04
- Updated MANIFEST file within
pymedphys_fileformatsto appropriately include LICENSE files.
0.8.2 -- 2019/06/01
- Included license files within the subpackage distributions
0.8.1 -- 2019/06/01
- Removed numpy version upper-limit
0.8.0 -- 2019/06/01
DeliveryDatahas been renamed toDeliveryand is now importable by runningfrom pymedphys import Delivery- A range of functions that used to use
DeliveryDataare now instead accessible as methods on theDeliveryobject.
- A range of functions that used to use
- 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'
- DICOM:
gamma_dicomnow take datasets as opposed to filenames
- 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.2 -- 2019/04/05
- Removed numpy version upper-limit
0.7.1 -- 2019/04/05
- reduced PyPI package size by removing unnecessary development testing files.
0.7.0 -- 2019/04/05
anonymise_dicomhas been renamed toanonymise_dicom_dataset- The 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.
- 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
- 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()
- 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.
- All uses of
dcmas a variable name for instances of PyDicom Datasets have been converted todsto match PyDicom convention.
0.5.1 -- 2019/01/05
- Began keeping record of changes in
changelog.md