Skip to main content

A wrapper for generating Docker commands using regular PETFit syntax

Project description

petfit-docker

petfit-docker is a lightweight Python wrapper that turns a BIDS-App-like command line into the matching docker run invocation for PETFit. Interactive Shiny mode is the default; use --automatic or --mode automatic to run a non-interactive pipeline.

petfit-docker /path/to/bids /path/to/derivatives participant \
  --app modelling_plasma \
  --blood-dir /path/to/blood \
  --analysis-foldername Primary_Analysis

The command above runs:

docker run --rm -it \
  -p 3838:3838 \
  -v /path/to/bids:/data/bids_dir:ro \
  -v /path/to/derivatives:/data/derivatives_dir:rw \
  -v /path/to/blood:/data/blood_dir:ro \
  mathesong/petfit:latest \
  --func modelling_plasma --mode interactive

Install for development

cd wrapper
python -m pip install -e .

Examples

Launch the default region definition app:

petfit-docker /path/to/bids /path/to/derivatives/petfit participant

The three positional arguments follow the BIDS App convention:

petfit-docker <bids_dir> <output_dir> participant

Launch region definition:

petfit-docker /path/to/bids /path/to/derivatives participant --app regiondef

The positional output_dir can be either the derivatives root or the final PETFit output directory. These are equivalent with the default output folder name:

petfit-docker /path/to/bids /path/to/derivatives/petfit participant
petfit-docker /path/to/bids /path/to/derivatives participant --app regiondef
petfit-docker /path/to/bids /path/to/derivatives/petfit participant --app regiondef

Launch plasma-input modelling:

petfit-docker /path/to/bids /path/to/derivatives participant \
  --app modelling_plasma \
  --blood-dir /path/to/blood

Run plasma-input modelling automatically:

petfit-docker /path/to/bids /path/to/derivatives participant \
  --app modelling_plasma \
  --blood-dir /path/to/blood \
  --automatic

Open a shell in the image:

petfit-docker --shell -i mathesong/petfit:latest

Patching a local petfit

Use --patch (or -f) to point the wrapper at a local petfit checkout and test your local changes without rebuilding the image. The wrapper bind-mounts the source into the container, where it is reinstalled from source at startup so it overrides the petfit baked into the image:

petfit-docker /path/to/bids /path/to/derivatives participant \
  --app modelling_ref \
  --patch /path/to/your/petfit/checkout

This mirrors the --patch option of the PETPrep Docker wrapper. Because petfit is an R package it is reinstalled (not run directly from source), so the first few seconds of startup are spent installing the patched package. The patch works with every mode, including --shell.

Apple Silicon

The published PETFit Docker images are currently linux/amd64 only. The wrapper therefore requests --platform linux/amd64 by default, which avoids Docker's platform-mismatch warning on Apple Silicon while running under emulation. If a native or multi-architecture image is published later, override the platform with --platform linux/arm64 or disable the explicit platform with --platform "".

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

petfit_docker-0.1.4.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

petfit_docker-0.1.4-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file petfit_docker-0.1.4.tar.gz.

File metadata

  • Download URL: petfit_docker-0.1.4.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for petfit_docker-0.1.4.tar.gz
Algorithm Hash digest
SHA256 5ee4590f83e914d4d18dd096d972c77f4e53b85944166ed27e4709b8da11a955
MD5 4fbb6a372008a31297ed63dfc0fe6b67
BLAKE2b-256 b608d49d7af5524be1cd92d1561c47a759c9835d34804feef161c33c7b9dd0ed

See more details on using hashes here.

File details

Details for the file petfit_docker-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: petfit_docker-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for petfit_docker-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1b27a6ae514667803456dadd025849ab0425a44b5c257a218853ea42ffdf8cea
MD5 7ec2c020ebf0e01daa06675445bbc2cb
BLAKE2b-256 54aac15c7576444ed30768ae5b6d8ee8c76d5ea97a65a9f3510d0b9702dcd9cc

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