Skip to main content

pydra-ants

PyPI - Version PyPI - Python Version PyPI - Downloads Status-docs Status-CICD


Pydra tasks for ANTs

Pydra is a dataflow engine which provides a set of lightweight abstractions for DAG construction, manipulation, and distributed execution.

ANTs is a toolbox for multi-variate image registration, segmentation and statistical analysis.

Table of Contents

Available Tasks

  • ApplyTransforms
  • CreateJacobianDeterminantImage
  • N4BiasFieldCorrection
  • Registration, registration_syn, registration_syn_quick

Installation

pip install pydra-ants

A separate installation of ANTs is required to use this package.

An official conda package is available through conda-forge:

conda install -c conda-forge ants

Automatic Conversion

Automatically generated tasks can be found in the pydra.tasks.ants.auto sub-package. These interfaces should be treated with caution as they likely do not pass testing. Generated tasks that have been edited and pass testing will be imported into one or more of the pydra.tasks.ants.v* sub-packages (e.g. pydra.tasks.ants.v7_4) corresponding to the version of the ants toolkit they are designed for.

Continuous integration

This template uses GitHub Actions to run tests and deploy packages to PYPI. New packages are built and uploaded when releases are created on GitHub, or new releases of Nipype or the Nipype2Pydra conversion tool are released. Releases triggered by updates to Nipype or Nipype2Pydra are signified by the postN suffix where N = <nipype-version><nipype2pydra-version> with the '.'s stripped, e.g. v0.2.3post185010 corresponds to the v0.2.3 tag of this repository with auto-generated packages from Nipype 1.8.5 using Nipype2Pydra 0.1.0.

Development

Methodology

The development of this package is expected to have two phases

  1. Where the corresponding Nipype interfaces are considered to be the ground truth, and the Pydra tasks are generated from them
  2. When the Pydra tasks are considered be mature and they are edited by hand

Different tasks will probably mature at different times so there will probably be an intermediate phase between 1 and 2.

Developer installation

First install the requirements for running the auto-conversion script and generate the Pydra task interfaces from their Nipype counterparts

pip install -r nipype-auto-conv/requirements.txt

The run the conversion script to convert Nipype interfaces to Pydra

nipype-auto-conv/generate

Install repo in developer mode from the source directory and install pre-commit to ensure consistent code-style and quality.

pip install -e .[test,dev]
pre-commit install

Auto-conversion phase

The auto-converted Pydra tasks are generated from their corresponding Nipype interface in combination with "conversion hints" contained in YAML specs located in nipype-auto-conv/specs/. The self-documented conversion specs are to be edited by hand in order to assist the auto-converter produce valid pydra tasks. After editing one or more conversion specs the pydra.tasks.ants.auto package should be regenerated by running

nipype-auto-conv/generate

The tests should be run on the auto-generated tasks to see if they are valid

pytest pydra/tasks/ants/auto/tests/test_<the-name-of-the-task-you-edited>.py

If the test passes you should then edit the pydra/tasks/ants/v*/__init__.py file to import the auto-generated task interface to signify that it has been validated and is ready for use, where v* corresponds to the version of ANTs that you have tested it against e.g.

from pydra.tasks.ants.auto import <the-task-you-have-validated>

and copy the test file pydra/tasks/ants/auto/tests/test_<validated-task>.py into pydra/tasks/ants/v*/tests.

File-formats and sample test data

The automatically generated tests will attempt to provided the task instance to be tested with sensible default values based on the type of the field and any constraints it has on it. However, these will often need to be manually overridden after consulting the underlying tool's documentation.

For file-based data, automatically generated file-system objects will be created for selected format types, e.g. Nifti, Dicom. Therefore, it is important to specify the format of the file using the "mime-like" string corresponding to a fileformats class in the inputs > types and outputs > types dicts of the YAML spec.

If the required file-type is not found implemented within fileformats, please see the fileformats docs [https://arcanaframework.github.io/fileformats/developer.html] for instructions on how to define new fileformat types, and see fileformats-medimage-extras for an example on how to implement methods to generate sample data for them. Implementations of new fileformats that are specific to ANTs, and functions to generate sample data for them, should be defined in related-packages/fileformats and related-packages/fileformats-extras, respectively.

License

This project is distributed under the terms of the Apache License, Version 2.0.

Metadata

Release files for pydra-ants 0.1.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 pydra-ants 0.1.0
File Size Uploaded Provenance Actions
pydra_ants-0.1.0.tar.gz 117.4 kB Without provenance Details for pydra_ants-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pydra-ants 0.1.0
File Interpreter ABI Platform Actions
pydra_ants-0.1.0-py3-none-any.whl Python 3 none any Details for pydra_ants-0.1.0-py3-none-any.whl

Total release size: 226.4 kB

Release files / pydra_ants-0.1.0.tar.gz

Download URL pydra_ants-0.1.0.tar.gz
Size 117.4 kB
Tags Source
SHA-256 checksum
How to use checksums
245fcb6549e8530f3b67044772dc60fcc1eb8f426f54573321639da8617baa4f
BLAKE2b-256 checksum
How to use checksums
e6d642653511dded5154a3ad89ab8d44973a2eb4541c5a8c4d37c698091fd829
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / pydra_ants-0.1.0-py3-none-any.whl

Download URL pydra_ants-0.1.0-py3-none-any.whl
Size 109.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1fd1fb32fea2a51e522e2f1e26890695165cda7ce2f8480b28f90122a535b0d5
BLAKE2b-256 checksum
How to use checksums
255ffadb4031ff0031a9f864e342201605d02106d6746c5e601f401bc6daed96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.3

Security for pydra-ants 0.1.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