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