Skip to content

CLI Reference

This page provides documentation for our command line tools.

dicom-qr

DICOM Query & Retrieve tool.

Usage

dicom-qr [OPTIONS] COMMAND [ARGS]...

Arguments

No arguments available

Options

Name Description Required Default
--version Show version info and exit. No -
--help Show this message and exit. No -

Commands

Name Description
query-tui Start the Query TUI.
list-series-for-study Get the series for a study.
list-studies-name Get the studies for a patient name,...
list-studies-patient-id Get the studies for a patient ID,...
list-studies-accession-number List the studies for an accession number,...
list-studies-date Get all studies between two dates,...
studyuid-from-acc-number-file Load a CSV file, read the column...
echo-pacs Send C-ECHO to server.
download-from-patientid-date Download the images from the patientID and...
download-from-name-date Download the images from the patient name...
download-from-accession-number Download the images from the accession...
download-from-studyuid Download a study, filtering for modalities.
download-from-studyuid-file Download the studies listed in file...
deident-check-files Check files against the filters in the...
deident-retain-patient-id-name Apply de-identification keeping the...
deident-replace-patient-id-name Apply de-identification and use a lookup...
generate-key-file Generate a pseudononymization key file...
sort-files Sort all DICOM files in the input folder...
send-data-to-dicom-node Send DICOM files in a folder to a DICOM...
send-data-to-dicom-web Send DICOM files in a folder to a DICOMWeb...

Sub Commands

dicom-qr query-tui

Start the Query TUI.

Usage

dicom-qr query-tui [OPTIONS][SETTINGS_FILE]

Arguments

Name Description Required
[SETTINGS_FILE] [default: settings.json] No

Options

Name Description Required Default
--help Show this message and exit. No -

dicom-qr list-series-for-study

Get the series for a study.

Usage

dicom-qr list-series-for-study [OPTIONS] STUDY_UID [MODALITIES]...

Arguments

Name Description Required
STUDY_UID StudyInstanceUID Yes

Options

Name Description Required Default
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr list-studies-name

Get the studies for a patient name, filtering for modalities.

Usage

dicom-qr list-studies-name [OPTIONS] PATIENT_NAME [MODALITIES]...

Arguments

Name Description Required
PATIENT_NAME Patient name to query Yes

Options

Name Description Required Default
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr list-studies-patient-id

Get the studies for a patient ID, filtering for modalities.

Usage

dicom-qr list-studies-patient-id [OPTIONS] PATIENT_ID [MODALITIES]...

Arguments

Name Description Required
PATIENT_ID Patient ID to query Yes

Options

Name Description Required Default
-d, --study_descr TEXT Study description for filtering No -
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr list-studies-accession-number

List the studies for an accession number, filtering for modalities.

Usage

dicom-qr list-studies-accession-number [OPTIONS] ACCESSION_NUMBER [MODALITIES]...

Arguments

Name Description Required
ACCESSION_NUMBER Accession number (16 characters). Yes

Options

Name Description Required Default
-c, --constraint [as_is|pad_trunc_16_leading_zero] Apply constraints to accession number [default: as_is] No -
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr list-studies-date

Get all studies between two dates, filtering any of the study descriptions and modalities. Does not download images. The number of responses from the PACS is limited, if no results show try more filtering (descriptions and/or modalities or shorten the date range).

Usage

dicom-qr list-studies-date [OPTIONS]

Arguments

No arguments available

Options

Name Description Required Default
-s, --start [%Y-%m-%d|%Y%m%d] Start date Yes -
-e, --end [%Y-%m-%d|%Y%m%d] End date [default: 2026-07-07] No -
-d, --study_descr TEXT Study description for filtering, can be used multiple times. No -
-p, --patient_id TEXT Patient ID for filtering No -
-m, --modalities TEXT Modalities used for filtering, can be used multiple times. No -
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr studyuid-from-acc-number-file

Load a CSV file, read the column 'AccessionNumber' and write all studies to output. Does not download images.

Usage

dicom-qr studyuid-from-acc-number-file [OPTIONS] FILENAME OUTPUT

Arguments

Name Description Required
FILENAME [required] No
OUTPUT [required] No

Options

Name Description Required Default
-c, --constraint [as_is|pad_trunc_16_leading_zero] Apply constraints to accession number [default: as_is] No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr echo-pacs

Send C-ECHO to server.

Usage

dicom-qr echo-pacs [OPTIONS]

Arguments

No arguments available

Options

Name Description Required Default
-v Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr download-from-patientid-date

Download the images from the patientID and date, filtering for modalities.

Usage

dicom-qr download-from-patientid-date [OPTIONS] PATIENT_ID STUDY_DATE:[%Y-%m-%d|%Y%m%d]

Arguments

Name Description Required
PATIENT_ID [required] No
STUDY_DATE:[%Y-%m-%d|%Y%m%d] [required] No

Options

Name Description Required Default
-m, --modality TEXT Filter series based on modalities No -
-s, --sop-class-uid TEXT Filter series based on SOPClassUID No -
--dumpdir DIRECTORY Override output folder. No -
--no-store-scp No local C_STORE SCP server. No -
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr download-from-name-date

Download the images from the patient name and date, filtering for modalities.

Usage

dicom-qr download-from-name-date [OPTIONS] PATIENT_NAME STUDY_DATE:[%Y-%m-%d|%Y%m%d]

Arguments

Name Description Required
PATIENT_NAME [required] No
STUDY_DATE:[%Y-%m-%d|%Y%m%d] [required] No

Options

Name Description Required Default
-m, --modality TEXT Filter series based on modalities No -
-s, --sop-class-uid TEXT Filter series based on SOPClassUID No -
--dumpdir DIRECTORY Override output folder. No -
--no-store-scp No local C_STORE SCP server. No -
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr download-from-accession-number

Download the images from the accession number, filtering for modalities.

Usage

dicom-qr download-from-accession-number [OPTIONS] ACCESSION_NUMBER

Arguments

Name Description Required
ACCESSION_NUMBER Accession number. Yes

Options

Name Description Required Default
-c, --constraint [as_is|pad_trunc_16_leading_zero] Apply constraints to accession number [default: as_is] No -
-m, --modality TEXT Filter series based on modalities No -
-s, --sop-class-uid TEXT Filter series based on SOPClassUID No -
--dumpdir DIRECTORY Override output folder. No -
--no-store-scp No local C_STORE SCP server. No -
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr download-from-studyuid

Download a study, filtering for modalities.

Usage

dicom-qr download-from-studyuid [OPTIONS] STUDY_UID

Arguments

Name Description Required
STUDY_UID Study UID to download Yes

Options

Name Description Required Default
-m, --modality TEXT Filter series based on modalities No -
-s, --sop-class-uid TEXT Filter series based on SOPClassUID No -
--dumpdir DIRECTORY Override output folder. No -
--no-store-scp No local C_STORE SCP server. No -
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr download-from-studyuid-file

Download the studies listed in file (column name: StudyInstanceUID), filtering for modalities and/or sop_class_uid.

Usage

dicom-qr download-from-studyuid-file [OPTIONS] FILENAME

Arguments

Name Description Required
FILENAME Input Yes

Options

Name Description Required Default
-m, --modality TEXT Filter series based on modalities No -
-s, --sop-class-uid TEXT Filter series based on SOPClassUID No -
--already-processed FILE File with already processed UIDs. No -
--dumpdir DIRECTORY Override output folder. [default: dumpdir] No -
--no-store-scp No local C_STORE SCP server. No -
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr deident-check-files

Check files against the filters in the recipe and log the results.

Usage

dicom-qr deident-check-files [OPTIONS] INPUT_DIR

Arguments

Name Description Required
INPUT_DIR input folder. Yes

Options

Name Description Required Default
-r, --recipe PATH Recipe to de-identify No -
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr deident-retain-patient-id-name

Apply de-identification keeping the existing patient name and id.

Usage

dicom-qr deident-retain-patient-id-name [OPTIONS] INPUT_DIR OUTPUT_DIR

Arguments

Name Description Required
INPUT_DIR input folder. Yes
OUTPUT_DIR output folder. Yes

Options

Name Description Required Default
-r, --recipe PATH Recipe to de-identify No -
-l, --log PATH Log UID lookup to file No -
-d, --date-offset INTEGER Date offset to de-identify No -
--xnat-project TEXT Add PatientComments tag for importing into the correct XNAT project No -
--xnat-prefix TEXT Prefix added subject and session field for XNAT No -
--pixel-anonymize Perform pixel anonymization No -
--rename-file Rename output file in case it contains PHI. No -
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr deident-replace-patient-id-name

Apply de-identification and use a lookup table to update patient name and id.

Usage

dicom-qr deident-replace-patient-id-name [OPTIONS] INPUT_DIR OUTPUT_DIR PATIENT_MAPPING

Arguments

Name Description Required
INPUT_DIR input folder. Yes
OUTPUT_DIR output folder. Yes
PATIENT_MAPPING CSV/XSLX file with the original patient IDs and the new ones. Yes

Options

Name Description Required Default
--patient-id-column INTEGER Column number containing the original patient ID [default: 0] No -
--pseudo-patient-id-column INTEGER Column number containing the new patient ID [default: 1] No -
-r, --recipe PATH Recipe to de-identify No -
-l, --log PATH Log UID lookup to file No -
-d, --date-offset INTEGER Date offset to de-identify No -
-e, --time-offset INTEGER Time offset to de-identify No -
--xnat-project TEXT Add PatientComments tag for importing into the correct XNAT project No -
--xnat-prefix TEXT Prefix added subject and session field for XNAT No -
--pixel-anonymize Perform pixel anonymization No -
--rename-file Rename output file in case it contains PHI. No -
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr generate-key-file

Generate a pseudononymization key file from a CSV file containing patient IDs. The patient IDs will be randomly shuffled before assigning the pseuodo IDs.

Usage

dicom-qr generate-key-file [OPTIONS] FILENAME OUTPUT

Arguments

Name Description Required
FILENAME [required] No
OUTPUT [required] No

Options

Name Description Required Default
--original-column TEXT Original column name [default: PatientID] No -
--number-of-digits INTEGER Number of digits in the pseudo IDs. [default: 3] No -
--help Show this message and exit. No -

dicom-qr sort-files

Sort all DICOM files in the input folder into a folder structure defined by the template. When using PowerShell, use ` to escape the $ signs. On linux use single quotes around template.

Usage

dicom-qr sort-files [OPTIONS] INPUT_DIR OUTPUT_DIR

Arguments

Name Description Required
INPUT_DIR input folder. Yes
OUTPUT_DIR output folder. Yes

Options

Name Description Required Default
-t, --template TEXT Template to use [default: ${PatientID}/${StudyDate}/${StudyDescription}/${Modality}/${SeriesDescription}] No -
-v, --verbose Print more output No -
--help Show this message and exit. No -

dicom-qr send-data-to-dicom-node

Send DICOM files in a folder to a DICOM Store SCP node.

Usage

dicom-qr send-data-to-dicom-node [OPTIONS] DESTINATION PORT DATA_FOLDER

Arguments

Name Description Required
DESTINATION Address of the destination DICOM node Yes
PORT Port of the destination DICOM node Yes
DATA_FOLDER File or folder to upload. Yes

Options

Name Description Required Default
--ae TEXT AE Title No -
-r, --recursive Recursive scanning of input No -
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -

dicom-qr send-data-to-dicom-web

Send DICOM files in a folder to a DICOMWeb server.

Usage

dicom-qr send-data-to-dicom-web [OPTIONS] URL DATA_FOLDER

Arguments

Name Description Required
URL Address of the destination DICOM node Yes
DATA_FOLDER File or folder to upload. Yes

Options

Name Description Required Default
-r, --recursive Recursive scanning of input No -
-v, --verbose Print more output No -
-vv Print even more output No -
--help Show this message and exit. No -