CLI Reference#
Note
This regards all pacsanini sub-commands that have an optional -f/--config option.
If unset, pacsanini will search for the following files in the provided order:
- A file specified by the
PACSANINI_CONFIGenvironment variable; - A file named
pacsaninirc.yamlin your current directory. - A file named
pacsaninirc.yamlin your home directory.
If none of these options correspond to an existing file and the -f/--config option is unset, an error will be raised.
Note
Refer to the command configuration section to see which configuration file settings need to be specified to run particular commands.
pacsanini#
Parse or configure your DICOM tag parsing capabilities from the command line.
Usage:
pacsanini [OPTIONS] COMMAND [ARGS]...
Options:
--version
--help Show this message and exit.
config#
Generate a default configuration file to the specified output file CONF. If unset, the configuration will be written to the default configuration file path (PACSANINI_CONFIG or ~/pacsaninirc.yaml)
Usage:
pacsanini config [OPTIONS] [CONF]
Options:
--fmt [json|yaml] The format to output the configuration in. [default:
yaml]
--edit If set, indicate that you want to edit the configuration
file.
--help Show this message and exit.
dashboard#
Launch the pacsanini dashboard. This only works if the pacsanini backend is a sql database.
Usage:
pacsanini dashboard [OPTIONS]
Options:
-f, --config TEXT The pacsanini configuration file to use. The order of
evaluation is: (1) the value you explicitely provided,
(2) the value provided by the PACSANINI_CONFIG env var,
(3) a file named pacsaninirc.yaml in your current
directory, (4) a file named pacsaninirc.yaml in your
home directory.
-p, --port INTEGER The port to use for the server. [default: 8050]
--debug If set, launch the dashboard in debug mode.
--help Show this message and exit.
db#
Perform database related commands.
Usage:
pacsanini db [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
dump#
Dump pacsanini database tables in CSV format.
Usage:
pacsanini db dump [OPTIONS]
Options:
-f, --config TEXT The pacsanini configuration file to use. The
order of evaluation is: (1) the value you
explicitely provided, (2) the value provided
by the PACSANINI_CONFIG env var, (3) a file
named pacsaninirc.yaml in your current
directory, (4) a file named pacsaninirc.yaml
in your home directory.
-o, --output TEXT If set, specify the output directory to
write results to. They will be written to
the current directory otherwise.
-t, --table [patients|studies|studies_find|series|images]
If specified, select one or more tables to
dump in CSV format. The default is all
tables.
--help Show this message and exit.
init#
Initialize the database and its tables using the resources value in the supplied configuration file.
Usage:
pacsanini db init [OPTIONS]
Options:
-f, --config TEXT The pacsanini configuration file to use. The order of
evaluation is: (1) the value you explicitely provided,
(2) the value provided by the PACSANINI_CONFIG env var,
(3) a file named pacsaninirc.yaml in your current
directory, (4) a file named pacsaninirc.yaml in your home
directory.
--force-init If set, force the creation of the database regardless of
whether it exists.
--help Show this message and exit.
upgrade#
Migrate the database schema.
Usage:
pacsanini db upgrade [OPTIONS]
Options:
-f, --config TEXT The pacsanini configuration file to use. The order of
evaluation is: (1) the value you explicitely provided,
(2) the value provided by the PACSANINI_CONFIG env var,
(3) a file named pacsaninirc.yaml in your current
directory, (4) a file named pacsaninirc.yaml in your home
directory.
--dry-run If set, only check if the database needs an upgrade and
only print commands.
--help Show this message and exit.
echo#
Test your connection with an another DICOM node over a network.
Usage:
pacsanini echo [OPTIONS]
Options:
-f, --config TEXT The pacsanini configuration file to use. The order of
evaluation is: (1) the value you explicitely provided,
(2) the value provided by the PACSANINI_CONFIG env var,
(3) a file named pacsaninirc.yaml in your current
directory, (4) a file named pacsaninirc.yaml in your home
directory.
--debug If set, print debug messages.
--help Show this message and exit.
find#
Emit C-FIND requests to the called node as specified by the config file. Results will be written to the output file specified by the "resources" setting in the configuration file.
Usage:
pacsanini find [OPTIONS]
Options:
-f, --config TEXT The pacsanini configuration file to use. The order of
evaluation is: (1) the value you explicitely provided,
(2) the value provided by the PACSANINI_CONFIG env var,
(3) a file named pacsaninirc.yaml in your current
directory, (4) a file named pacsaninirc.yaml in your home
directory.
--create-tables If set, create the database tables before parsing
results.
--debug If set, print debug messages.
--help Show this message and exit.
move#
Move the DICOM resources specified by the resources parameter in the configuration file.
Usage:
pacsanini move [OPTIONS]
Options:
-f, --config TEXT The pacsanini configuration file to use. The order of
evaluation is: (1) the value you explicitely provided,
(2) the value provided by the PACSANINI_CONFIG env var,
(3) a file named pacsaninirc.yaml in your current
directory, (4) a file named pacsaninirc.yaml in your home
directory.
--debug If set, print debug messages.
--help Show this message and exit.
orchestrate#
Run the find-move-parse pipeline orchestrated by pacsanini.
Usage:
pacsanini orchestrate [OPTIONS]
Options:
-f, --config TEXT The pacsanini configuration file to use. The order
of evaluation is: (1) the value you explicitely
provided, (2) the value provided by the
PACSANINI_CONFIG env var, (3) a file named
pacsaninirc.yaml in your current directory, (4) a
file named pacsaninirc.yaml in your home
directory.
-t, --threads INTEGER The number of threads to use (applicable if the
backend is not a database). [default: 1]
--init-db / --no-init-db If --init-db is set and the results backend is a
database: create the database. [default: False]
--help Show this message and exit.
parse#
Parse DICOM tags using the tags configuration file for the specified DICOM files and write the results to the output destination. Configuration files can be obtained using the parse-conf command.
Usage:
pacsanini parse [OPTIONS]
Options:
-i, --input PATH The input directory to parse DICOM files.
[required]
-f, --config TEXT The pacsanini configuration file to use. The
order of evaluation is: (1) the value you
explicitely provided, (2) the value provided
by the PACSANINI_CONFIG env var, (3) a file
named pacsaninirc.yaml in your current
directory, (4) a file named pacsaninirc.yaml
in your home directory.
-o, --output PATH The output file to write results to. If
unset and the format is 'csv' or 'json',
write to the standard output.
--fmt [csv|json|sql] The destination format to write the results
to. Use if the -o/--output option is used.
[default: csv]
--include-path / --exclude-path
Include DICOM file paths in the output
results. [default: True]
--institution-name TEXT If specified, include the institution name
in SQL results.
-m, --mode [w|a] The file writing mode for CSV and JSON
formats ([w]rite or [a]ppend). [default: w]
-t, --threads INTEGER The number of threads to use. [default: 1]
--create-tables If set, create the database tables before
parsing results. (only used if --fmt is set
to sql).
--help Show this message and exit.
parse-conf#
Generate a DICOM tag parser configuration file with helpful prompts. With the configuration file ready, you will be able to use the parse command to extract DICOM tags from given DICOM files.
Usage:
pacsanini parse-conf [OPTIONS]
Options:
-o, --output TEXT The destination file to write the configuration to. If
unset, write to the standard output.
--fmt [json|yaml] The format to write the results in. [default: json]
--help Show this message and exit.
send#
Send a DICOM or a DICOM directory by specifying the DCMDIR argument from your local node to a destination node using C-STORE operations.
Usage:
pacsanini send [OPTIONS] DCMDIR
Options:
-f, --config TEXT The pacsanini configuration file to use. The order of
evaluation is: (1) the value you explicitely provided,
(2) the value provided by the PACSANINI_CONFIG env var,
(3) a file named pacsaninirc.yaml in your current
directory, (4) a file named pacsaninirc.yaml in your home
directory.
--debug If set, print debug messages.
--help Show this message and exit.
server#
Start a DICOM storescp server in the current process.
Usage:
pacsanini server [OPTIONS]
Options:
-f, --config TEXT The pacsanini configuration file to use. The order of
evaluation is: (1) the value you explicitely provided,
(2) the value provided by the PACSANINI_CONFIG env var,
(3) a file named pacsaninirc.yaml in your current
directory, (4) a file named pacsaninirc.yaml in your home
directory.
--debug If set, print debug messages.
--help Show this message and exit.