Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
74427cb
Added __print_usage_pydra__ special options for
tclose Aug 22, 2023
121f87c
deleted pydra package GHA workflow (now generated in https://github.c…
tclose Aug 21, 2025
d71093d
added in missing imports to app.py
tclose Aug 21, 2025
4a71da2
added in SequenceDirectoryOut Python type
tclose Aug 21, 2025
a6a1097
touch up
tclose Aug 21, 2025
ce7920a
debugged pydra code generation
tclose Aug 21, 2025
3ebdad6
renamed __print_usage_pydra__ to __print_pydra_code__
tclose Aug 22, 2025
21ec26b
renamed generating methods to print_pydra_code from print_usage_pydra
tclose Aug 22, 2025
6e497b5
dropped flake8 config
tclose Aug 22, 2025
4c48cdd
reverted .gitignore
tclose Aug 22, 2025
49d4788
renamed directions arguments to fibre_directions
tclose Aug 26, 2025
4447c50
added pydra test github action
tclose Aug 27, 2025
f88a4fd
added dev option to pydra-tasks-mrtrix3 install
tclose Aug 27, 2025
f78acd3
updated reference docs to use new "fibre_directions" argument names
tclose Aug 27, 2025
246e062
fixing pylint errors in app.py
tclose Aug 28, 2025
3e0e84f
fixing up pylint errors
tclose Aug 28, 2025
e84cf2d
disable pylint too many public methods for app.Parser
tclose Aug 28, 2025
91a62f6
renamed directions -> fibre_directions in ref docs
tclose Aug 28, 2025
9aa1bc7
run pytest instead of just importing pydra package in GH action
tclose Aug 28, 2025
10fde8b
Merge branch 'dev' into pydra-usage
Lestropie Nov 17, 2025
9a455ea
updated pydra code gen to match new argument-handling syntax
tclose Nov 28, 2025
23fff5b
debugging generation of pydra code after arg parsing refactor merge
tclose Nov 28, 2025
3024e11
fixed up code to pass syntax check
tclose Nov 28, 2025
f4e3bf5
cleaned up app.py import
tclose Nov 28, 2025
d2dfdfb
Renamed pydra CI workflow
tclose Nov 28, 2025
cb6bc45
renamed pydra CI workflow
tclose Nov 28, 2025
24a09ac
Stylistic changes in response to code-review
tclose Dec 1, 2025
08d9393
reverted use of optional kwarg in pydra code-gen type formatting
tclose Dec 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/pydra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: Pydra code generation

on:
pull_request:
types: [opened, synchronize]
branches: [ master, dev]
merge_group:
types: [checks_requested]
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
generate-pydra:
runs-on: ubuntu-latest

env:
QT_SELECT: qt6
SCCACHE_GHA_ENABLED: "true"
SCCACHE_CACHE_SIZE: "2G"

steps:
- uses: actions/checkout@v1
with:
submodules: true

- name: Get latest version
run: echo "MRTRIX3_VERSION=$(git fetch --tags && git describe --tags --abbrev=0)" >> $GITHUB_ENV

- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install clang qt6-base-dev libglvnd-dev zlib1g-dev libfftw3-dev ninja-build python3-numpy libpng-dev

- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.9

- name: Get CMake
uses: lukka/get-cmake@latest
with:
cmakeVersion: '3.16.3'

- name: Print CMake version
run: cmake --version

- name: Make installation dir
run: |
sudo mkdir -p /opt/mrtrix3
sudo chown $USER /opt/mrtrix3

- name: configure
run: >
cmake
-B build
-G Ninja
-D CMAKE_BUILD_TYPE=Release
-D MRTRIX_BUILD_TESTS=ON
-D MRTRIX_STL_DEBUGGING=ON
-D MRTRIX_WARNINGS_AS_ERRORS=ON
-D CMAKE_C_COMPILER=clang
-D CMAKE_CXX_COMPILER=clang++
-D CMAKE_INSTALL_PREFIX=/opt/mrtrix3

- name: Build MRtrix3
run: cmake --build build

- name: Install MRtrix3
run: cmake --install build

- name: Clone pydra-tasks-mrtrix3
run: git clone https://github.com/nipype/pydra-tasks-mrtrix3

- name: Install pydra-tasks-mrtrix3 and fileformats packages
run: pip install -e ./pydra-tasks-mrtrix3[test,dev] -e ./pydra-tasks-mrtrix3/related-packages/fileformats -e ./pydra-tasks-mrtrix3/related-packages/fileformats-extras

- name: Generate Pydra task packages
run: python3 pydra-tasks-mrtrix3/generate.py /opt/mrtrix3/bin pydra-tasks-mrtrix3 3.1.0

- name: Test with pytest
run: pytest -sv pydra-tasks-mrtrix3/pydra/tasks/mrtrix3 --cov pydra.tasks.mrtrix3 --cov-report xml



2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@
*.hdr
*.rste
/python/lib/mrtrix3/_version.py
*.venv
/scripts/mrtrix_bash_completion
/dev/
/compiled_docs/
/.vscode/
.cproject
.DS_store
.idea
.project
.settings
Expand Down
2 changes: 1 addition & 1 deletion cpp/cmd/amp2response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void usage() {
ARGUMENTS
+ Argument ("amps", "the amplitudes image").type_image_in()
+ Argument ("mask", "the mask containing the voxels from which to estimate the response function").type_image_in()
+ Argument ("directions", "a 4D image containing the estimated fibre directions").type_image_in()
+ Argument ("fibre_directions", "a 4D image containing the estimated fibre directions").type_image_in()
+ Argument ("response", "the output zonal spherical harmonic coefficients").type_file_out();

OPTIONS
Expand Down
2 changes: 1 addition & 1 deletion cpp/cmd/peaks2amp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void usage() {
SYNOPSIS = "Extract amplitudes from a peak directions image";

ARGUMENTS
+ Argument ("directions", "the input directions image."
+ Argument ("fibre_directions", "the input directions image."
" Each volume corresponds to the x, y & z"
" component of each direction vector in turn.").type_image_in()

Expand Down
2 changes: 1 addition & 1 deletion cpp/cmd/peaks2fixel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void usage() {
+ Fixel::format_description;

ARGUMENTS
+ Argument ("directions", "the input directions image;"
+ Argument ("fibre_directions", "the input directions image;"
" each volume corresponds to the x, y & z"
" component of each direction vector in turn.").type_image_in()

Expand Down
2 changes: 1 addition & 1 deletion cpp/cmd/sh2amp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void usage() {

ARGUMENTS
+ Argument ("input", "the input spherical harmonic (SH) coefficients image").type_image_in()
+ Argument ("directions", "the set of directions along which the SH functions will be sampled").type_file_in()
+ Argument ("fibre_directions", "the set of directions along which the SH functions will be sampled").type_file_in()
+ Argument ("output", "the output amplitudes image").type_image_out();

OPTIONS
Expand Down
2 changes: 1 addition & 1 deletion cpp/cmd/sh2response.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void usage() {
ARGUMENTS
+ Argument ("SH", "the spherical harmonic decomposition of the diffusion-weighted images").type_image_in()
+ Argument ("mask", "the mask containing the voxels from which to estimate the response function").type_image_in()
+ Argument ("directions", "a 4D image containing the direction vectors along which to estimate the response function").type_image_in()
+ Argument ("fibre_directions", "a 4D image containing the direction vectors along which to estimate the response function").type_image_in()
+ Argument ("response", "the output axially-symmetric spherical harmonic coefficients").type_file_out();

OPTIONS
Expand Down
Loading
Loading