Skip to main content

Admin CLI for managing medical imaging datasets in S3/MinIO for DataSHIELD

Project description

dsimaging-admin

Admin CLI for managing medical imaging datasets in S3/MinIO for DataSHIELD.

Install

pip install dsimaging-admin

Quick start

# 1. Publish a local dataset to MinIO
dsimaging-admin --endpoint http://minio:9000 publish \
  --dataset-id lung_ct_v1 \
  --source /data/lung_ct \
  --modality ct

# 2. List published datasets
dsimaging-admin --endpoint http://minio:9000 list

# 3. Check health
dsimaging-admin --endpoint http://minio:9000 doctor

# 4. Re-scan after adding images
dsimaging-admin --endpoint http://minio:9000 rescan --dataset-id lung_ct_v1

For repeated use, create ~/.dsimaging.yaml once:

dsimaging-admin init

What publish does

  1. Scans your local image directory (NIfTI, DICOM, NRRD, etc.)
  2. Computes SHA-256 content hash for every file
  3. Uploads images to s3://<bucket>/datasets/<dataset_id>/source/images/
  4. Generates and uploads:
    • manifest.yaml (dataset descriptor)
    • content_hash_index.parquet (dedup index)
    • sample_manifests.parquet (multi-file sample support)
    • samples.parquet (basic metadata)
  5. Optionally registers the dataset as an Opal resource
  6. Prints the DataSHIELD resource configuration

publish can register the resource directly in Opal:

dsimaging-admin --endpoint http://localhost:9000 publish \
  --dataset-id lung_ct_v1 \
  --source /data/lung_ct \
  --modality ct \
  --opal-url https://opal.example.org \
  --opal-user administrator \
  --opal-password "$OPAL_PASSWORD" \
  --opal-project IMAGING

Environment variables

Variable Default Description
DSIMAGING_ENDPOINT http://127.0.0.1:9000 S3/MinIO endpoint
DSIMAGING_ACCESS_KEY minioadmin S3 access key
DSIMAGING_SECRET_KEY minioadmin123 S3 secret key
DSIMAGING_BUCKET imaging-data Bucket name
DSIMAGING_REGION (empty) S3 region
OPAL_TOKEN (empty) Optional Opal token for publish --opal-url
OPAL_USER (empty) Optional Opal username for publish --opal-url
OPAL_PASSWORD (empty) Optional Opal password for publish --opal-url

Rescan

rescan --dataset-id <id> rebuilds content_hash_index.parquet, sample_manifests.parquet, samples.parquet and manifest.yaml from the current contents of source/images/. This is the same contract maintained automatically by the dsimaging-store controller when MinIO webhooks are enabled.

Dataset layout in S3

s3://<bucket>/datasets/<dataset_id>/
  manifest.yaml
  metadata/
    samples.parquet
    sample_manifests.parquet
  indexes/
    content_hash_index.parquet
  source/
    images/
  derived/
  qc/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dsimaging_admin-0.1.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dsimaging_admin-0.1.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file dsimaging_admin-0.1.0.tar.gz.

File metadata

  • Download URL: dsimaging_admin-0.1.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for dsimaging_admin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 93c22917a5d4b09ffc54c9ac410e7f99e1f584a9293e68d7896a8f4fd644f1c6
MD5 f0c81ce6fcac9d46594d0d3c77efdc83
BLAKE2b-256 d62055c4ac6c12fd0bb62152913e8e714fcfe09148c5a50300106a532658618d

See more details on using hashes here.

File details

Details for the file dsimaging_admin-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for dsimaging_admin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f05b223b40909c0aca724d194555c743fc69f7e77bbc737ab8f8715dd45f45a
MD5 b323b4da214c44096e218deed06496ea
BLAKE2b-256 2bcc059dc65f81e8821efdfd3b89c9640664cf01bcd7f34edfce1e8b1923edf9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page