3
3
[ ![ PyPI - Version] [ pypi-version ]] [ pypi-project ]
4
4
[ ![ PyPI - Python Version] [ pypi-pyversions ]] [ pypi-project ]
5
5
[ ![ PyPI - Downloads] [ pypi-downloads ]] [ pypi-project ]
6
- ![ ] [ status-docs ]
7
- ![ ] [ status-test ]
6
+ [ ![ Status-docs ] [ status-docs-badge ]] [ status-docs-link ]
7
+ [ ![ Status-CICD ] [ status-cicd-badge ]] [ status-cicd-link ]
8
8
9
9
----
10
10
@@ -24,7 +24,7 @@ for FMRI, MRI and DTI brain imaging data.
24
24
- [ Development] ( #development )
25
25
- [ License] ( #license )
26
26
27
- ## Available tasks
27
+ ## Tested interfaces
28
28
29
29
| Module | Tasks |
30
30
| --------| --------------------------------------------------------------------------------------------------------------------|
@@ -48,26 +48,126 @@ A separate installation of FSL is required to use this package.
48
48
Please review the FSL [ installation instructions] [ fsl-install ]
49
49
and [ licensing details] [ fsl-license ] .
50
50
51
+
52
+ ## Automatic Conversion
53
+
54
+ Automatically generated tasks can be found in the ` pydra.tasks.fsl.auto ` sub-package.
55
+ These interfaces should be treated with caution as they likely do not pass testing.
56
+ Generated tasks that have been edited and pass testing will be imported into one or more of the
57
+ ` pydra.tasks.fsl.v* ` sub-packages (e.g. ` pydra.tasks.fsl.v7_4 ` ) corresponding
58
+ to the version of the fsl toolkit they are designed for.
59
+
60
+
61
+ ### Continuous integration
62
+
63
+ This template uses [ GitHub Actions] ( https://docs.github.com/en/actions/ ) to run tests and
64
+ deploy packages to PYPI. New packages are built and uploaded when releases are created on
65
+ GitHub, or new releases of Nipype or the Nipype2Pydra conversion tool are released.
66
+ Releases triggered by updates to Nipype or Nipype2Pydra are signified by the ` postN `
67
+ suffix where ` N = <nipype-version><nipype2pydra-version> ` with the '.'s stripped, e.g.
68
+ ` v0.2.3post185010 ` corresponds to the v0.2.3 tag of this repository with auto-generated
69
+ packages from Nipype 1.8.5 using Nipype2Pydra 0.1.0.
70
+
51
71
## Development
52
72
53
- This project is managed with [ Hatch] [ hatch ] :
73
+ ### Methodology
74
+
75
+ The development of this package is expected to have two phases
76
+
77
+ 1 . Where the corresponding Nipype interfaces are considered to be the ground truth, and
78
+ the Pydra tasks are generated from them
79
+ 2 . When the Pydra tasks are considered be mature and they are edited by hand
80
+
81
+ Different tasks will probably mature at different times so there will probably be an
82
+ intermediate phase between 1 and 2.
83
+
84
+ ### Developer installation
85
+
86
+ Before the pydra task interfaces can be generated and installed, the file-format classes
87
+ [ fileformats] ( https://arcanaframework.github.io/fileformats/ ) packages
88
+ corresponding to FSL specific file formats will need to be installed
89
+
90
+ ``` console
91
+ pip install -e ./related-packages/fileformats[dev]
92
+ pip install -e ./related-packages/fileformats-extras[dev]
93
+ ```
94
+
95
+ Next install the requirements for running the auto-conversion script and generate the
96
+ Pydra task interfaces from their Nipype counterparts
97
+
98
+ ``` console
99
+ pip install -r nipype-auto-conv/requirements.txt
100
+ ```
101
+
102
+ The run the conversion script to convert Nipype interfaces to Pydra
103
+
104
+ ``` console
105
+ nipype-auto-conv/generate
106
+ ```
107
+
108
+ Install repo in developer mode from the source directory and install pre-commit to
109
+ ensure consistent code-style and quality.
110
+
111
+ ``` console
112
+ pip install -e .[test,dev]
113
+ pre-commit install
114
+ ```
115
+
116
+ ### Auto-conversion phase
117
+
118
+ The auto-converted Pydra tasks are generated from their corresponding Nipype interface
119
+ in combination with "conversion hints" contained in YAML specs
120
+ located in ` nipype-auto-conv/specs/ ` . The self-documented conversion specs are
121
+ to be edited by hand in order to assist the auto-converter produce valid pydra tasks.
122
+ After editing one or more conversion specs the ` pydra.tasks.fsl.auto ` package should
123
+ be regenerated by running
54
124
55
125
``` console
56
- pipx install hatch
126
+ nipype-auto-conv/generate
57
127
```
58
128
59
- To run the test suite:
129
+ The tests should be run on the auto-generated tasks to see if they are valid
60
130
61
131
``` console
62
- hatch run test
132
+ pytest pydra/tasks/fsl/auto/tests/test_<the-name-of-the-task-you-edited>.py
63
133
```
64
134
65
- To fix linting issues:
135
+ If the test passes you should then edit the ` pydra/tasks/fsl/v*/__init__.py ` file
136
+ to import the auto-generated task interface to signify that it has been validated and is
137
+ ready for use, where v* corresponds to the version of FSL that you have tested
138
+ it against e.g.
66
139
67
140
``` console
68
- hatch run lint:fix
141
+ from pydra.tasks.fsl.auto import <the-task-you-have-validated>
69
142
```
70
143
144
+ and copy the test file ` pydra/tasks/fsl/auto/tests/test_<validated-task>.py `
145
+ into ` pydra/tasks/fsl/v*/tests ` .
146
+
147
+
148
+ ### File-formats and sample test data
149
+
150
+ The automatically generated tests will attempt to provided the task instance to be tested
151
+ with sensible default values based on the type of the field and any constraints it has
152
+ on it. However, these will often need to be manually overridden after consulting the
153
+ underlying tool's documentation.
154
+
155
+ For file-based data, automatically generated file-system objects will be created for
156
+ selected format types, e.g. Nifti, Dicom. Therefore, it is important to specify the
157
+ format of the file using the "mime-like" string corresponding to a
158
+ [ fileformats] ( https://github.com/ArcanaFramework/fileformats ) class
159
+ in the ` inputs > types ` and ` outputs > types ` dicts of the YAML spec.
160
+
161
+ If the required file-type is not found implemented within fileformats, please see the ` fileformats `
162
+ docs [ https://arcanaframework.github.io/fileformats/developer.html ] for instructions on how to define
163
+ new fileformat types, and see
164
+ [ fileformats-medimage-extras] ( https://github.com/ArcanaFramework/fileformats-medimage-extras/blob/6c2dabe91e95687eebc2639bb6f034cf9595ecfc/fileformats/extras/medimage/nifti.py#L30-L48 )
165
+ for an example on how to implement methods to generate sample data for them. Implementations of
166
+ new fileformats that are specific to FSL, and functions to
167
+ generate sample data for them, should be defined in ` related-packages/fileformats `
168
+ and ` related-packages/fileformats-extras ` , respectively.
169
+
170
+
71
171
## License
72
172
73
173
This project is distributed under the terms of the [ Apache License, Version 2.0] [ license ] .
@@ -92,6 +192,12 @@ This project is distributed under the terms of the [Apache License, Version 2.0]
92
192
93
193
[ fsl-license ] : https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Licence
94
194
95
- [ hatch ] : https://hatch.pypa.io/
96
-
97
195
[ license ] : https://spdx.org/licenses/Apache-2.0.html
196
+
197
+ [ status-docs-badge ] : https://img.shields.io/badge/docs-latest-brightgreen.svg?style=flat
198
+
199
+ [ status-cicd-badge ] : https://github.com/nipype/pydra-fsl/actions/workflows/ci-cd.yaml/badge.svg
200
+
201
+ [ status-docs-link ] : https://nipype.github.io/pydra-fsl/
202
+
203
+ [ status-cicd-link ] : https://github.com/nipype/pydra-fsl/actions/workflows/ci-cd.yaml
0 commit comments