All notable changes to this project will be documented in this file.
This project adheres to Semantic Versioning.
- 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.electronfactors
andpymedphys.wlutz
were 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.connect
now returns aConnection
object instead of aCursor
object. This was so as to align with PEP0249. See pymedphys#1352.- All instances where previously the argument name within a function or
method was
cursor
have been changed toconnection
. - Previously a server and port could be provided to
pymedphys.mosaiq.connect
by 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 --pylint
withpymedphys 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 run
was 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
--live
parameter withinpymedphys dev docs
has been removed.
pymedphys dicom listen
stores 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__.py
so 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 propagate
had the--copies
and--pyproject
flags 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 gui
will 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.dateutil
dependency 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 gui
within 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_number
withinpymedphys.Delivery.from_dicom
andpymedphys.Delivery.to_dicom
has been changed tofraction_group_number
. - The name of the first argument to
pymedphys.Delivery.from_dicom
has been changed fromdicom_dataset
tortplan
. It now also accepts either apydicom.Dataset
or a filepath. - A range of files utilised by
pymedphys.data_path
and related functions that contained the words "mudensity", "mu-density", or "mu_density" have been replaced with "metersetmap". - The exceptions that
pymedphys.Delivery.from_mosaiq
raises when either no entry in Mosaiq is found (NoMosaiqEntries
) or multiple entries are found (MultipleMosaiqEntries
) now both inherit fromValueError
instead of the baseException
class.
- All instances of
mudensity
have been replaced withmetersetmap
. Themudensity
API is still currently available, but it will be removed in a future release. pymedphys.Delivery.from_logfile
has 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 gui
now 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.toml
should now include aversion = 1
entry. This is to support undergoing breaking changes withinconfig.toml
but 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.iviewdb
has been created.
- Nil
- Removed
pymedphys experimental gui
.
- Within
pymedphys.experimental.pseudonymisation
bothpseudonymise
andis_valid_strategy_for_keywords
were added.pseudonymise
provides 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
docs
tolib/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
--output
flag 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.txt
andrequirements-dev.txt
,lib/pymedphys/.pylintrc
,lib/pymedphys/docs/README.rst
,lib/pymedphys/docs/CHANGELOG.md
, and the 'extras' field withinpyproject.toml
. pymedphys dev tests
includes simplified flags.--run-only-slow
can be undergone with--slow
,--run-only-yarn
with--cypress
,--run-only-pydicom
with--pydicom
, and--run-only-pylinac
with--pylinac
.- Within cypress end to end testing the custom
cy.start
command now has a parameterapp
which 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 pymedphys
is 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.experimental
does not raise anImportError
when 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.toml
extras. 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.toml
has 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_strategy
andidentifying_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.zip
was removed and its contents were moved intopinnacle_test_data.zip
. - Data files
treatment-record-anonymisation.zip
,negative-mu-density.trf
, andtrf-references-and-baselines.zip
were 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_dispatch
andpymedphys.experimental.pseudonymisation.get_default_pseudonymisation_keywords
. These are designed to be passed to the new keywordsreplacement_strategy
andidentifying_keywords
withinpymedphys.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 gui
in 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 anonymise
andpymedphys.dicom.anonymise
would not anonymise nested tags. Thanks sjswerdloff for finding and fixing #920.
- Removed the
--publish
option from CLIpymedphys dev docs
. - Moved
pymedphys logfile orchestration
topymedphys trf orchestrate
pymedphys.zenodo_data_paths
has a new optional parameterfilenames
that can be used to only download some files.pymedphys.data_path
has a new optional parameterhash_filepath
which can be used to provide a custom hash record.- Added usage warning to the MU Density GUI.
pymedphys.read_trf
has 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
ConnectionResetError
occurs.
- A new
pymedphys.beta
module 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.identify
to allow the usage of Mosaiq to identify a trf logfile.
- Instances of
labs
has 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 bundle
CLI as well all of its associated code. - Removed a range of unused files from the
pymedphys.data_path
API. - 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 tests
to 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-pylinac
so that upstream tools can run tests on this downstream project. - These extra options are directly passed through to
pytest
. To achieve this, made thepymedphys
CLI 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-libjpeg
in order to decode lossless-jpeg files. m2r
is no longer used to build the docs.- No longer using
tox
for 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 docs
would not run. - Fixed a case where on some Windows environments
pymedphys gui
would not run. - Fixed issue where the
pymedphys logfile orchestration
CLI 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 orchestration
would 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-commit
tool 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
/tests
into/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 gui
would not find the streamlit installation. _gui/init.py
- Changed the
patient_directories
icom parameter to accept a list of paths instead of a single path within the pymedphysconfig.toml
. config.toml#L67-L72 - Changed
pymedphys gui
iCOM 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 archive
CLI command, this archiving is now built directly into the listener itself.
- The
pymedphys icom listener
CLI 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 archive
CLI, but this functionality has now been merged into the listener. listener.py#L79 - Should an error occur within
pymedphys icom listener
CLI 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
--debug
and--verbose
flag to the PyMedPhys CLI which allows users to set the logging level. These logging levels are currently only utilised within thepymedphys icom listen
CLI. 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
--structures
flag 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
psutil
as 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 gui
for the first time, no longer doesstreamlit
request 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 gui
which 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 aredirect
field to allow configuration to be stored in a different location such as within a git repo, or a network drive. pymedphys.zip_data_paths
now 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 gui
with the cypress tool.
- Within the bundle created by
pymedphys bundle
fixed a bug where the streamlit server will not start due stdout not flushing.
- Within the bundle created by
pymedphys bundle
fixed a bug where sometimes the streamlit server would not start should a stdout race condition occur.
- Include
matplotlib
withinstreamlit
bundle. Streamlit requires this but has not labeled it as a dependency. - Call
yarn
fromos.system
, for some reason on Windowssubprocess.check_call
could not findyarn
on the path, although on Linux this worked fine.
- If
pymedphys.mosaiq.connect
is 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 bundle
cli function which creates an electron streamlit installation bundle. - Added the 'all' fractions option to
Delivery.from_dicom
which 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.1
cases withinDelivery.from_monaco
get_patient_name
added topymedphys._mosaiq.helpers
- Wlutz bb finding cost function adjusted
- Note, wlutz algorithm still not ready for the prime time
- Removed
jupyter
,bundle
, andapp
sub commands from the CLI. - Removed the
gui
andjupyter
optional extra installation commands. - In order to support Python 3.8, the
pymssql
dependency 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
pymssql
for Python 3.8.
- Fix
pymedphys._monaco
package 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-name
pymedphys dicom adjust-RED
pymedphys dicom adjust-RED-by-structure-name
- Implemented
from_icom
method on thepymedphys.Delivery
object. This was to support calculating an MU Density from an iCOM stream.- See pymedphys#733
- Once again made
shapely
a default dependency with the aim to make installation be "batteries included".Shapely
now ships wheels for Windows. This meansshapely
will install normally with pip. See shapely/shapely#815 (comment)
- Pinned
pydicom
due to a currently unknown issue with a new version breaking apymedphys
test.
- 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
pip
refuses to install due to theshapely-helper
workaround.
- 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-deps
to have a minimal installation. - Made a
shapely-helpers
package which automatically handles installation ofshapely
on Windows. PyMedPhys now depends onshapely-helpers
instead ofshapely
.
- Made wlutz determination less fussy.
- Initial alpha release of an experimental JupyterLab application bundler.
Run with
pymedphys bundle
in a directory that contains anotebooks
dir and arequirements.txt
file.
- Gracefully reject ipython inspection for optional modules by returning
None
for '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-later
toApache-2.0
.
- Expose
pymedphys.electronfactors.plot_model
as part of the public API.
- Experimental support for Elekta Unity trf log file decoding.
- Updated wheel to correctly handle optional dependencies.
- Vendored in
apipkg
due to PyPI installation issues.
- Given the input to
pymedphys.gamma
is unitless, removed the units from the logging output of gamma. See pymedphys#611
- Moved
pymedphys pinnacle
cli 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.connect
would not work for just one hostname.
- Fixed issue where
pymedphys.mosaiq.connect
would not work for just one hostname.
- Made
pymedphys.mosaiq.execute
a 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_dataset
thereshape
parameter has been removed. - Removed the following functions:
load_dicom_data
axes_and_dose_from_dicom
extract_depth_dose
extract_profiles
- Added functions
pymedphys.dicom.depth_dose
andpymedphys.dicom.profiles
. - Exposed the
trf2pandas
function viapymedphys.fileformats.trf2pandas
.
- Made the resolution detection of
pymedphys.plt.pcolormesh_grid
more robust.
- Re-exposed
convert2_ratio_perim_area
andcreate_transformed_mesh
frompymedphys.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_name
frompymedphys.msq
.
0.8.4 -- 2019/06/04
- Made
xlwings
not install by default if system isLinux
withinsetup.py
- Removed unreleased
jupyter
based GUI
0.8.3 -- 2019/06/04
- Updated MANIFEST file within
pymedphys_fileformats
to 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
DeliveryData
has been renamed toDelivery
and is now importable by runningfrom pymedphys import Delivery
- A range of functions that used to use
DeliveryData
are now instead accessible as methods on theDelivery
object.
- 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
import
again, 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_data
moved from themsq
module to themudensity
module.compare_mosaiq_fields
moved from themsq
module into theplancompare
module.pymedphys.dicom.get_structure_aligned_cube
has had itsx0
parameter changed from required to optional. It is no longer the first parameter passed to the function. By defaultx0
is 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_dicom
now 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_dicom
has been renamed toanonymise_dicom_dataset
- The CLI interface
trf2csv
has 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
'sDataset
object. This class includes additions such as an anonymisation method.DicomImage
, designed to hold a single DICOM image slice. Might someday contain methods such asresample
and the like.DicomSeries
, a series ofDicomImage
objects 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 onDicomStudy
depending what is housed within it. For example having bothDicomDose
andDicomStructure
should 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 intoDicomStudy
objects 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
decodetrf
library is now distributed within PyMedPhys. You can now simply install PyMedPhys and runpymedphys trf to-csv
within the command line to convert.trf
files into.csv
files.
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.dicom
coords_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.coll
package, instead they are found withinpymedphys.mudensity
package. - The DICOM coordinate extraction functions now return simple tuples rather
than
Coords
namedtuples: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
dcm
as a variable name for instances of PyDicom Datasets have been converted tods
to match PyDicom convention.
0.5.1 -- 2019/01/05
- Began keeping record of changes in
changelog.md