Skip to content

Commit

Permalink
Merge branch 'main-arkiev'
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Mar 24, 2024
2 parents 2d2595d + 71947e6 commit 0da818e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 11 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/pythonpackage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
- '--editable git+https://github.com/nipype/pydra.git#egg=pydra'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Revert version to most recent tag on upstream update
if: github.event_name == 'repository_dispatch'
run: git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
Expand Down Expand Up @@ -86,12 +86,12 @@ jobs:
sudo cp /opt/FastSurfer/fastsurfer_env_gpu.yml /fastsurfer/fastsurfer_env_gpu.yml
sudo cp -R /opt/FastSurfer/* /fastsurfer/ && rm -rf /opt/FastSurfer
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Revert version to most recent tag on upstream update
if: github.event_name == 'repository_dispatch'
run: git checkout $(git tag -l | tail -n 1 | awk -F post '{print $1}')
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build dependencies
Expand All @@ -116,7 +116,7 @@ jobs:
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
Expand All @@ -130,7 +130,7 @@ jobs:
git commit -am"added auto-generated version to make new tag for package version"
git tag ${TAG}post${POST}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install build tools
Expand All @@ -139,7 +139,7 @@ jobs:
run: python -m build
- name: Check distributions
run: twine check dist/*
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: distributions
path: dist/
Expand Down
43 changes: 39 additions & 4 deletions pydra/tasks/fastsurfer/v1/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
from pydra.engine import ShellCommandTask
import typing as ty
from pathlib import Path
from fileformats.generic import File
from fileformats.generic import File, Directory
from fileformats.medimage import NiftiGz, MghGz

input_fields = [
(
"subjects_dir",
ty.Any,
Path,
{
"help_string": "Subjects directory",
"argstr": "--sd {subjects_dir}",
Expand Down Expand Up @@ -207,7 +208,41 @@
name="Input", fields=input_fields, bases=(specs.ShellSpec,)
)

output_fields = []
def norm_img_path(subjects_dir: Path):
return Path(subjects_dir) / "FS_outputs" / "mri" / "norm.mgz"

def aparcaseg_img_path(subjects_dir: Path):
return Path(subjects_dir) / "FS_outputs" / "mri" / "aparc+aseg.orig.mgz"

def subject_dir_path(subjects_dir: Path) -> Path:
return Path(subjects_dir) / "FS_outputs"

output_fields = [
(
"subject_dir_output",
Directory,
{
"help_string": "subject directory path",
"callable": subject_dir_path,
},
),
(
"norm_img",
MghGz,
{
"help_string": "norm image",
"callable": norm_img_path,
},
),
(
"aparcaseg_img",
MghGz,
{
"help_string": "aparc+aseg image",
"callable": aparcaseg_img_path,
},
)
]
fastsurfer_output_spec = specs.SpecInfo(
name="Output", fields=output_fields, bases=(specs.ShellOutSpec,)
)
Expand All @@ -219,7 +254,7 @@ class fastsurfer(ShellCommandTask):
-------
>>> from fileformats.generic import File
>>> from pydra.tasks.fastsurfer.auto.fast_surfer import fast_surfer
>>> from pydra.tasks.fastsurfer.v1.fast_surfer import fast_surfer
"""

Expand Down

0 comments on commit 0da818e

Please sign in to comment.