CLI Reference#
autods-pet provides a command-line interface built with Typer. All commands share the following global options:
Option |
Description |
|---|---|
|
Path to the INI configuration file (required). |
|
Patient(s) to process: a single ID, comma-separated IDs, or path to a |
|
Write detailed logs to a file. |
|
Enable DEBUG-level logging. |
|
Re-run stages even if outputs already exist (applies to |
|
Show version and exit. |
autods-pet create-config#
Generate a configuration file from a named profile.
# Default profile (standard)
autods-pet create-config -o my_config.ini
# Choose a specific profile
autods-pet create-config -p quick -o my_config.ini
Extra options:
|
Config profile: |
|
Output path (default: |
|
Overwrite an existing file. |
Creates a commented INI file with profile-specific defaults.
See also the example configs in the configs/ folder.
Profile |
TotalSeg |
License |
Targets |
Masks saved |
Use case |
|---|---|---|---|---|---|
|
Fast |
No |
None |
None |
Rapid screening, QC, testing |
|
High-res |
No |
None |
Refined only |
General-purpose research (default) |
|
High-res |
Yes |
None |
Refined only |
Research with bone marrow DS |
|
High-res |
Yes |
FL, PM, EM |
Raw + refined |
Complete clinical analysis |
|
High-res |
No |
None |
Refined only |
Brain-to-Liver Ratio studies |
autods-pet validate-config#
Validate an existing configuration file.
autods-pet validate-config my_config.ini
Checks that all required keys are present and paths are valid.
Pass --patients <id1,id2> to additionally print a mask discovery
preview for each named patient – a dry-run of which manual lesion
masks (NIfTI/NRRD or DICOM SEG) would be picked up for each configured
target ROI section, before launching a full extract / score run.
autods-pet validate-config my_config.ini --patients PATIENT_001,PATIENT_002
autods-pet convert#
Convert DICOM, NIfTI, or NRRD images to the standard NIfTI layout.
autods-pet convert -c config.ini -p PATIENT_001,PATIENT_002
Detects the input format automatically. For DICOM inputs, also extracts PET metadata (radiopharmaceutical tags, patient weight) and writes a JSON sidecar file.
autods-pet normalize#
Compute SUV body-weight from raw PET images.
autods-pet normalize -c config.ini
Reads PET metadata from the JSON sidecar (written by convert) or from
the CSV specified via metadata_csv in config. Writes
PET_SUV.nii.gz to the patient results folder
(output_dir/{patient_id}_results/images/).
If patients have incomplete metadata, an auto-generated template
metadata.csv is written to output_dir/.
autods-pet register#
Rigidly register the PET SUV image onto the CT grid.
autods-pet register -c config.ini
Uses SimpleElastix for rigid registration. Writes
PET_SUV_reg.nii.gz to output_dir/{patient_id}_results/images/ and
saves the Elastix transform (elastix_transform.txt, native Elastix
format) to output_dir/{patient_id}_results/metadata/.
autods-pet segment#
Run TotalSegmentator on CT images.
autods-pet segment -c config.ini --fast
Extra options:
|
Use TotalSegmentator fast mode (lower accuracy, faster).
Note: the |
Produces a single multilabel output
output_dir/{patient_id}_results/segmentations/TotSeg_multilabel.nii.gz
(no individual per-label files are created).
autods-pet extract#
Extract ROI statistics from registered PET images.
autods-pet extract -c config.ini
Processes all configured ROIs (aorta MBP, liver, lumbar VB, long bones, brain, and target ROIs) and prints status for each.
Extra options:
|
Save both raw and refined masks as NIfTI. |
|
Save individual raw label masks as NIfTI. |
|
Save refined ROI masks as NIfTI. |
|
Subtract target lesion masks (FL, PM, EM, custom) from marrow ROIs (BM, LB) before computing statistics. |
|
Print a per-patient mask discovery report (every DICOM SEG and NIfTI/NRRD file found, every segment, which targets matched, which came up empty) before running the extraction. |
The same --explain-masks and --subtract-lesions flags are
available on score and run.
autods-pet score#
Assign Deauville Scores from pre-extracted ROI statistics.
autods-pet score -c config.ini -p PATIENT_001,PATIENT_002
Runs extraction then scoring, printing a results table.
autods-pet run#
Run the full Deauville Score pipeline end-to-end.
autods-pet run -c config.ini --format xlsx
This command chains all stages (convert, normalize, register, segment, extract, score) and writes results per patient and in batch.
Per-patient CSVs are written to the patient results folder:
output_dir/{patient_id}_results/DeauvilleScores/deauville_scores.csvoutput_dir/{patient_id}_results/SUV/SUV_values.csv
For multi-patient runs, batch summaries are written to output_dir/:
batch_results_DS.csv– Deauville Score columnsbatch_results_SUV.csv– SUV statisticsbatch_errors.csv– errors (only created if any patients fail)
Extra options:
|
Use TotalSegmentator fast mode. |
|
Output format: |
|
Save both raw and refined masks as NIfTI. |
|
Save individual raw label masks as NIfTI. |
|
Save refined ROI masks as NIfTI. |
|
Subtract target lesion masks (FL, PM, EM, custom) from marrow ROIs (BM, LB) before computing statistics. |
|
Print a per-patient mask discovery report before running. |
autods-pet list-segments#
List the segments contained in a DICOM SEG (.dcm) file.
autods-pet list-segments path/to/segmentation.dcm
Takes a single positional PATH argument pointing to an existing,
readable DICOM SEG file and prints a table of segment numbers, labels,
and descriptions. Useful for choosing the correct segment_label
value to set in the [focal_lesion] / [paramedullary] /
[extramedullary] / [targets.<name>] config sections when working
with multi-segment DICOM SEG masks.
Requires the dicom-seg extra
(pip install autods-pet[dicom-seg]).