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
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.
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.
pip install dicomtrolleytool
{{% octicon-alert Not implemented yet }}
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>
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
You can get series level information like this:
> trolley query suid 123 --query-level Series
You can restrict the output using --output-fields
> trolley -v query acc 1234 --query-level INSTANCE --output-format TABLE --output-fields ProtocolName,SeriesInstanceUID,PatientID
> trolley query suid 123 --query-level Series > grep 'thing to grep for' "
{{% octicon-alert Not implemented yet }}
Add credentials to keyring: trolley credentials add -f