Skip to content

imgtools CLI

imgtools

A collection of tools for working with medical imaging data.

Usage:

imgtools [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--quiet, -q boolean Suppress all logging except errors, overrides verbosity options. False
--verbose, -v integer range (0 and above) Increase verbosity of logging, overrides environment variable. (0-3: ERROR, WARNING, INFO, DEBUG). 0
--version boolean Show the version and exit. False
-h, --help boolean Show this message and exit. False

imgtools dicomfind

A tool to find DICOM files.

PATH is the directory to search for DICOM files.

SEARCH_INPUT is an optional list of substring(s) to search for in the DICOM files. If multiple substrings are provided, all substrings must match to return a result.

i.e dicomfind /path/to/directory/ "substring1" "substring2" "substring3"

Usage:

imgtools dicomfind [OPTIONS] PATH [SEARCH_INPUT]...

Options:

Name Type Description Default
-e, --extension text File extension to look for. dcm
-c, --count boolean Whether to just print the count of files found. This is useful for scripts. False
-l, --limit integer The limit of results to return. None
-ch, --check-header boolean Whether to check DICOM header for "DICM" signature. False
-s, --sorted boolean Sort the results alphabetically. False
-h, --help boolean Show this message and exit. False

imgtools dicomsort

Sorts DICOM files into directories based on their tags.

Usage:

imgtools dicomsort [OPTIONS] SOURCE_DIRECTORY TARGET_DIRECTORY

Options:

Name Type Description Default
--action, -a choice (move | copy | symlink | hardlink) Action to perform on the files. _required
-n, --dry-run boolean Do not move or copy files, just print what would be done. Always recommended to use this first to confirm the operation! False
-j, --num-workers integer Number of worker processes to use for sorting. 1
--truncate-uids, -t integer Truncate the UIDs in the DICOM files to the specified length. Set to 0 to disable truncation. 5
-h, --help boolean Show this message and exit. False

imgtools index

Crawl DICOM directory and create a database index.

  • looks for all DICOM files in the specified directory, extracts metadata, and builds a comprehensive index of the dataset.

  • The index includes information about the series, modalities, and other relevant details, making it easier to manage and analyze the DICOM files.

  • The output is saved in a structured format, including JSON and CSV files, which can be used for further processing or analysis.

  • By default, it saves the results in a ".imgtools" folder right next to your DICOM directory, but you can pick your own place to store them.

Usage:

imgtools index [OPTIONS]

Options:

Name Type Description Default
--dicom-dir path Path to the DICOM directory. _required
--output-dir path Path to the output directory. If not specified, a directory named '.imgtools' will be created in the parent directory of the DICOM directory. None
--dataset-name text Name of the dataset. If not specified, the name of the DICOM directory will be used. None
--n-jobs integer Number of jobs to use for parallel processing. 2
--force boolean Force overwrite existing files. False
-h, --help boolean Show this message and exit. False

imgtools shell-completion

Emit shell completion script (hidden command).

This command generates a shell completion script for the specified shell. Supported shells: bash, zsh, fish.

Usage:

imgtools shell-completion [OPTIONS] {bash|zsh|fish}

Options:

Name Type Description Default
--help boolean Show this message and exit. False