dicomtrolleytool
Command line tool to query and retrieve DICOM datasets
- CLI frontend to dicomtrolley
- Developed for debug and testing. Quick queries and downloads from command line
- Convenient handling of login secrets using keyring
Why?
For testing and debugging DICOM server connections I kept creating single use, throw-away python scripts. This is annoying for three reasons:
- Duplication: Copy-pasting code for each single query, files piling up.
- Slowness: Creating a pyton file, running this is overhead each time.
- Credential faff: Finding the right credentials and safely including them in this script for each single query.
dicomtrolleytool solves these three issues.
Development - Alpha
Nov 2023: This is a personal tool. I try to keep it clean and tested enough to continue developing, but expect NotImplementedError, incomplete coverage, incomplete docs, missing parameters. If this tool containue to work for me I might make an effort and clean up.
Installation
pip install dicomtrolleytool
Setup
NOTE: this whole section is not implemented yet (feel free to step in). The actual current method of setting up channels is:
- Install keyring (see 'handling credentials' below)
- Look at
/examples/persist_connection, fill in and run - Manually edit your settings file
trolley settings editto add your channel to thechannelslist.
A channel is ready-to use communication channel including password. This needs to be saved to
a secure location. To this end the channel information is first entered into a file, which is then
stored in a secure location using the store command.
trolley channel new <type>
# Creates a new empty channel file
# Add data to this file, then:
trolley channel store <template_file>
shred -d <template_file>
Handling credentials
intall keyring. Works great. But installation can be a bit fiddly because it has to link to your OS secret store. I've only tested this
For me the magic installation string (tested on on ubuntu 20,22,24) was:
pip install secretstorage dbus-python keyring
But this could definitely be just my system.. Just search for it
When that works, you need to write your dicomtrolley channels into your secret store
For this, look at /examples/persist_connection. Would be great to have a cli command
for this like trolley credentials add -f <json file> but there isn't. Feel free to add.
Usage
You can used the keyword trolley from the command line.
Some examples:
> trolley query suid 12345 # simple query
> trolley query suid 12345 324345 345345 # query multiple
> trolley query patient_id 1234
> trolley download suid 12345
Query levels
You can get series level information like this:
> trolley query suid 123 --query-level Series
Filtering output
You can restrict the output using --output-fields
> trolley -v query acc 1234 --query-level INSTANCE --output-format TABLE --output-fields ProtocolName,SeriesInstanceUID,PatientID
Metadata
Release files for dicomtrolleytool 0.6.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| dicomtrolleytool-0.6.1.tar.gz | 17.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| dicomtrolleytool-0.6.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.8 kB
Release files / dicomtrolleytool-0.6.1.tar.gz
| Download URL | dicomtrolleytool-0.6.1.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6b52191adfb226fea3959df3ce0c730543d0f2b41f3edcfe4eac0822c4742c7
|
|
BLAKE2b-256 checksum How to use checksums |
93c905da353d0a205e269600ce1a60e25880484926fbb21c6dda9164dd7ab157
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.9.22 Linux/6.11.0-1014-azure
|
Release files / dicomtrolleytool-0.6.1-py3-none-any.whl
| Download URL | dicomtrolleytool-0.6.1-py3-none-any.whl |
|---|---|
| Size | 21.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f4c7effaf7c138db052942a4f762e962723c379882974fba5b9f7717dab9615b
|
|
BLAKE2b-256 checksum How to use checksums |
acbb4732294faeace2d55fbb63c5a4ec07d4b310692dd7cae91295de45602c2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.3 CPython/3.9.22 Linux/6.11.0-1014-azure
|