Command line utilities
Eyened ORM CLI
The Eyened ORM provides several command line utilities to help with development, testing, and maintenance. These commands are available through the eorm CLI tool.
Available Commands
database-mirror-test
Creates a test database for ORM testing, developing new features, or running alembic migrations. This command creates a database with the schema but only a subset of the data from the production database.
eorm database-mirror-test [OPTIONS]database-mirror-full
Creates a complete test database with all data from the production database. This is useful when you need a full copy of the database for development or testing purposes.
eorm database-mirror-full [OPTIONS]update-thumbnails
Updates thumbnails for all images in the database. This is useful when the thumbnail generation logic has changed or when thumbnails are missing.
eorm update-thumbnails [OPTIONS]Options:
-e, --env PATH: Path to.envfile for environment configuration (see Configuration)--failed: Include images with failed thumbnails (emptyThumbnailPath) in addition to images with no thumbnails (NULLThumbnailPath)
Usage:
By default, the command processes images where ThumbnailPath is NULL:
eorm update-thumbnails --env production.envTo also regenerate thumbnails for images where generation previously failed:
eorm update-thumbnails --failed --env production.envUpdating thumbnail generation code:
If you need to modify the thumbnail generation logic (e.g., to support new image types or change generation behavior):
- Update the thumbnail generation code in
orm/eyened_orm/importer/thumbnails.py - Test your changes using the test notebook
- For images that need regeneration, set their
ThumbnailPathto NULL in the database - Run the update command with the
--failedflag to regenerate all thumbnails:
eorm update-thumbnails --failed --env production.envrun-models
Runs inference models on the database. This command processes images with the configured AI models.
eorm run-models [OPTIONS]validate-forms
Validates form annotations and schemas in the database. This helps ensure that all form data is correctly structured and follows the defined schemas.
eorm validate-forms [OPTIONS]zarr-tree
Displays the structure of the zarr store, showing groups and array shapes. This is useful for understanding the organization of segmentation data stored in zarr format.
eorm zarr-tree [OPTIONS]defragment-zarr
Defragments the zarr store by copying all segmentations to a new store with sequential indices. This command creates a new zarr store and copies all existing segmentations to it, assigning new sequential ZarrArrayIndex values to eliminate gaps and improve storage efficiency.
eorm defragment-zarr [OPTIONS]update-hashes
Updates FileChecksum and DataHash for all ImageInstances in the database where they are NULL. This maintains data integrity by ensuring all images have proper hash values.
eorm update-hashes [OPTIONS]run-registration
Runs registration processing for images in the database. This command processes images to perform registration operations, which can be filtered by patient identifier, project ID, form schema, or creator.
eorm run-registration [OPTIONS]Options:
-e, --env PATH: Path to.envfile for environment configuration (see Configuration)--patient PATIENT: Patient identifier to run registration for (optional)--project PROJECT_ID: Project ID to run registration for (optional)--schema SCHEMA_NAME: SchemaName to run registration for (default: “RegistrationSet”)--creator CREATOR_NAME: CreatorName to run registration for (default: “registration model”)--replace: Replace existing registration if it already exists
Usage:
To run registration for a specific patient:
eorm run-registration --env production.env --patient Patient_001To run registration for all patients in a project:
eorm run-registration --env production.env --project 1To run registration with custom schema and creator:
eorm run-registration --env production.env --schema "CustomRegistration" --creator "My Registration Model"