Skip to main content

Pydra2App - XNAT

tests codecov Python versions Latest Version docs

An extension for the Pydra2App framework that support for building XNAT "apps" (container service docker images) from Pydra tasks.

Quick Installation

This extension can be installed for Python 3 using pip:

$ pip3 install pydra2app-xnat

This will also install the core Pydra2App package and any required dependencies.

Reconcile XNAT pipelines

deploy-pipelines performs one reconciliation against a release catalogue and exits:

PIPELINE_CATALOGUE_URL=https://example.org/pipeline-release.json \
XNAT_HOST=https://xnat.example.org \
XNAT_USER=username \
XNAT_PASS=password \
pydra2app ext xnat deploy-pipelines

The catalogue may instead be passed as a local file or URL argument. The command reports each pipeline as installed, updated, unchanged, or failed, with how many of its commands were enabled, and exits nonzero if any pipeline fails. Existing commands are updated in place (keeping their site and project enablement), and commands absent from the catalogue are not removed. The XNAT user must be an administrator or a Container Service manager.

Selecting and enabling pipelines

A YAML config file passed to --config (or PIPELINE_RECONCILER_CONFIG) selects which catalogue pipelines are reconciled and whether their commands are enabled:

include:              # optional; leave out to take every pipeline
  - mri.human.neuro.*
exclude:              # optional; wins over include
  - mri.human.neuro.bidsapp.*
enablement: approval  # or "auto"; default is approval

Patterns are case-sensitive wildcards matched against the whole catalogue pipeline ID, where * also matches .. Excluded pipelines are left untouched even if already installed: their commands are not downloaded, updated or enabled. Invalid config fails before XNAT is contacted, and a pattern matching no pipeline logs a warning. Without a config, every pipeline is reconciled in approval mode.

  • approval: new commands are installed disabled until an administrator enables them.
  • auto: every selected command is enabled for the site on each run, including any an administrator has disabled. To block a pipeline, exclude it, then disable it in XNAT.

Either way, project owners still enable commands for their own projects.

Pipeline assessor outputs (XNAT 1.10+)

Opt in per command, then rebuild the image:

commands:
  concatenate:
    task: frametree.testing.tasks:Concatenate
    operates_on: medimage/session
    assessor_outputs: true

deploy-pipelines and install-command register the type and form; this requires a site administrator. Pipeline runs use the launching user's project permissions. Installing only through image-label discovery does not register them.

Frequency Results are attached to
medimage/session Imaging session
medimage/subject Subject
medimage/dataset Project asset

Each run processes one session, one subject, or a whole project, respectively. Subject inputs are retrieved through the API because Container Service cannot mount a subject's archive.

List scalar outputs explicitly in sinks (supported: string, integer, float and boolean). Outputs are staged until the run succeeds. Files are stored in output-named resources; scalar results and run details are in a Custom Form, with full provenance in PROVENANCE/provenance.json. Form fields are available in Advanced Search. Reruns reuse the same assessor and reconcile its output files.

Types and run labels use readable pipeline names. Types are stable; schema changes create a new form revision, preserving previous forms and values. Existing types, forms and labels are not renamed. Default XNAT layouts are unchanged. Project results are searchable project assets, but XNAT 1.10 has no standard detail page for browsing their files.

Commands without opt-in are unchanged. On XNAT older than 1.10, assessor outputs fall back to the existing storage behavior. internal_upload is not supported. Reading assessors as FrameTree derivatives is separate work in frametree-xnat.

For Container Service REST launches, root must be the wrapper input name: SESSION, SUBJECT or PROJECT—not an XNAT datatype.

License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Creative Commons License: Attribution-NonCommercial-ShareAlike 4.0 International Creative Commons License: Attribution-NonCommercial-ShareAlike 4.0 International

Metadata

Release files for pydra2app-xnat 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pydra2app-xnat 0.10.0
File Size Uploaded Provenance Actions
pydra2app_xnat-0.10.0.tar.gz 56.4 kB Without provenance Details for pydra2app_xnat-0.10.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydra2app-xnat 0.10.0
File Interpreter ABI Platform Actions
pydra2app_xnat-0.10.0-py3-none-any.whl Python 3 none any Details for pydra2app_xnat-0.10.0-py3-none-any.whl

Total release size: 126.2 kB

Release files / pydra2app_xnat-0.10.0.tar.gz

Download URL pydra2app_xnat-0.10.0.tar.gz
Size 56.4 kB
Tags Source
SHA-256 checksum
How to use checksums
eef6814a70b1a1f1972fde54cce5f21181524a40f3c4f2d1d18bcd0b2818e679
BLAKE2b-256 checksum
How to use checksums
fe8d583698667674dd89a4398bd5998ed13f7ffab04f71081b059f6db7303f97
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / pydra2app_xnat-0.10.0-py3-none-any.whl

Download URL pydra2app_xnat-0.10.0-py3-none-any.whl
Size 69.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1415d0f901bc37dd5ea4904a5f309fce1a4c205ac01d64e164c7c543bfe7d85f
BLAKE2b-256 checksum
How to use checksums
f25b74f2be0373ab41e1f3ea8a8cd874b727c37ae47a7fe674819110a595ae15
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for pydra2app-xnat 0.10.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page