Skip to main content

Pydra tasks package for FMRIB Software Library (FSL)

Project description

pydra-tasks-fsl

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


Pydra tasks for FSL.

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

FSL is a comprehensive library of analysis tools for FMRI, MRI and DTI brain imaging data.

Table of contents

Tested interfaces

Module Tasks
bet BET, RobustFOV
eddy Eddy, ApplyTopup, Topup
fast FAST
flirt FLIRT, ApplyXFM, ConcatXFM, ConvertXFM, InvertXFM, FixScaleSkew, Img2ImgCoord, Img2StdCoord, Std2ImgCoord
fnirt FNIRT, FNIRTFileUtils, ApplyWarp, ConvertWarp, InvWarp
fugue FUGUE, PrepareFieldmap, Prelude, SigLoss
maths (experimental) Maths, Mul
susan SUSAN
utils ChFileType, FFT, Info, Interleave, Merge, Orient, Reorient2Std, ROI, SelectVols, Slice, SmoothFill, Split, SwapDim

Installation

pip install pydra-tasks-fsl

A separate installation of FSL is required to use this package. Please review the FSL installation instructions and licensing details.

Automatic Conversion

Automatically generated tasks can be found in the pydra.tasks.fsl.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.fsl.v* sub-packages (e.g. pydra.tasks.fsl.v7_4) corresponding to the version of the fsl 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

Before the pydra task interfaces can be generated and installed, the file-format classes fileformats packages corresponding to FSL specific file formats will need to be installed

pip install -e ./related-packages/fileformats[dev]
pip install -e ./related-packages/fileformats-extras[dev]

Next 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.fsl.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/fsl/auto/tests/test_<the-name-of-the-task-you-edited>.py

If the test passes you should then edit the pydra/tasks/fsl/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 FSL that you have tested it against e.g.

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

and copy the test file pydra/tasks/fsl/auto/tests/test_<validated-task>.py into pydra/tasks/fsl/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 FSL, 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.

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

pydra_tasks_fsl-0.2.2.tar.gz (96.0 kB view details)

Uploaded Source

Built Distribution

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

pydra_tasks_fsl-0.2.2-py3-none-any.whl (204.9 kB view details)

Uploaded Python 3

File details

Details for the file pydra_tasks_fsl-0.2.2.tar.gz.

File metadata

  • Download URL: pydra_tasks_fsl-0.2.2.tar.gz
  • Upload date:
  • Size: 96.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pydra_tasks_fsl-0.2.2.tar.gz
Algorithm Hash digest
SHA256 b30b019f1b1e3b83f2077c2047dad47dbf9f339ee37f124d5c946d1090c2590f
MD5 e882bce4c338d44043e4616a0d354983
BLAKE2b-256 35c984b041d727920be595da368a5338bb2aa02583f6f3b8121d8c051808c810

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydra_tasks_fsl-0.2.2.tar.gz:

Publisher: ci-cd.yaml on nipype/pydra-tasks-fsl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pydra_tasks_fsl-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: pydra_tasks_fsl-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 204.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pydra_tasks_fsl-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 56dfad35543c48477d0f44352fa4545606b629fa98d3ca8c33188efd75a26263
MD5 1cf215ff1ecd99ea32a4bcda070ec23f
BLAKE2b-256 9dc32db3349c6c13aee4a3dde376ebfbfeac4c8eb39aa0d18df097f299127ddc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pydra_tasks_fsl-0.2.2-py3-none-any.whl:

Publisher: ci-cd.yaml on nipype/pydra-tasks-fsl

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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