Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/auto-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
"draft": false,
"prerelease": false
}' \
"https://api.github.com/repos/nipype/pydra-#PACKAGE#/releases"
"https://api.github.com/repos/nipype/pydra-tasks-#PACKAGE#/releases"
4 changes: 2 additions & 2 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ jobs:
- name: Install task package
run: |
pip install "./related-packages/fileformats[test]" "./related-packages/fileformats-extras[test]"
python -c "import fileformats.medimage_afni as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
python -c "import fileformats.vendor.afni.medimage as m; print(f'{m.__name__} {m.__version__} @ {m.__file__}')"
- name: Test fileformats with pytest
run: >-
pytest ./related-packages -sv --cov fileformats.medimage_afni
pytest ./related-packages -sv --cov fileformats.vendor.afni.medimage
--cov fileformats.extras.medimage_afni --cov-report xml .

deploy-fileformats:
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

# -- Project information -----------------------------------------------------

project = "pydra-afni"
project = "pydra-tasks-afni"
copyright = "2020, Xihe Xie"
author = "Xihe Xie"

Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ PyYAML>=6.0
fileformats >=0.8
fileformats-medimage >=0.4
fileformats-datascience >= 0.1
fileformats-medimage-afni
fileformats-vendor-afni
traits
nipype2pydra
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/interfaces/afn_ito_nifti.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ inputs:
# from the nipype interface, but you may want to be more specific, particularly
# for file types, where specifying the format also specifies the file that will be
# passed to the field in the automatically generated unittests.
in_file: fileformats.medimage_afni.ThreeD
in_file: fileformats.vendor.afni.medimage.ThreeD
# type=file|default=<undefined>: input file to 3dAFNItoNIFTI
callable_defaults:
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/interfaces/calc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ outputs:
# from the nipype interface, but you may want to be more specific, particularly
# for file types, where specifying the format also specifies the file that will be
# passed to the field in the automatically generated unittests.
out_file: fileformats.medimage_afni.All1
out_file: fileformats.vendor.afni.medimage.All1
# type=file: output file
# type=file|default=<undefined>: output image file name
callables:
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/interfaces/cat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ outputs:
# from the nipype interface, but you may want to be more specific, particularly
# for file types, where specifying the format also specifies the file that will be
# passed to the field in the automatically generated unittests.
out_file: fileformats.medimage_afni.OneD
out_file: fileformats.vendor.afni.medimage.OneD
# type=file: output file
# type=file|default='catout.1d': output (concatenated) file name
callables:
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/interfaces/convert_dset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ outputs:
# from the nipype interface, but you may want to be more specific, particularly
# for file types, where specifying the format also specifies the file that will be
# passed to the field in the automatically generated unittests.
out_file: fileformats.medimage_afni.Dset
out_file: fileformats.vendor.afni.medimage.Dset
# type=file: output file
# type=file|default=<undefined>: output file for ConvertDset
callables:
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/interfaces/deconvolve.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ outputs:
# type=file|default=<undefined>: output statistics file
reml_script: generic/file
# type=file: automatically generated script to run 3dREMLfit
x1D: fileformats.medimage_afni.OneD
x1D: fileformats.vendor.afni.medimage.OneD
# type=file: save out X matrix
# type=file|default=<undefined>: specify name for saved X matrix
callables:
Expand Down
4 changes: 2 additions & 2 deletions nipype-auto-conv/specs/interfaces/eval.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ inputs:
# from the nipype interface, but you may want to be more specific, particularly
# for file types, where specifying the format also specifies the file that will be
# passed to the field in the automatically generated unittests.
in_file_a: fileformats.medimage_afni.OneD
in_file_a: fileformats.vendor.afni.medimage.OneD
# type=file|default=<undefined>: input file to 1deval
in_file_b: generic/file
# type=file|default=<undefined>: operand file to 1deval
Expand All @@ -63,7 +63,7 @@ outputs:
# from the nipype interface, but you may want to be more specific, particularly
# for file types, where specifying the format also specifies the file that will be
# passed to the field in the automatically generated unittests.
out_file: fileformats.medimage_afni.OneD
out_file: fileformats.vendor.afni.medimage.OneD
# type=file: output file
# type=file|default=<undefined>: output image file name
callables:
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/interfaces/notes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ inputs:
# from the nipype interface, but you may want to be more specific, particularly
# for file types, where specifying the format also specifies the file that will be
# passed to the field in the automatically generated unittests.
in_file: fileformats.medimage_afni.Head
in_file: fileformats.vendor.afni.medimage.Head
# type=file|default=<undefined>: input file to 3dNotes
callable_defaults:
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/interfaces/one_d_tool_py.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ inputs:
# from the nipype interface, but you may want to be more specific, particularly
# for file types, where specifying the format also specifies the file that will be
# passed to the field in the automatically generated unittests.
in_file: fileformats.medimage_afni.OneD
in_file: fileformats.vendor.afni.medimage.OneD
# type=file|default=<undefined>: input file to OneDTool
show_cormat_warnings: generic/file
# type=file|default=<undefined>: Write cormat warnings to a file
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/interfaces/remlfit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ inputs:
# type=file|default=<undefined>: filename of 3D mask dataset; only data time series from within the mask will be analyzed; results for voxels outside the mask will be set to zero.
matim: generic/file
# type=file|default=<undefined>: read a standard file as the matrix. You can use only Col as a name in GLTs with these nonstandard matrix input methods, since the other names come from the 'matrix' file. These mutually exclusive options are ignored if 'matrix' is used.
matrix: fileformats.medimage_afni.OneD
matrix: fileformats.vendor.afni.medimage.OneD
# type=file|default=<undefined>: the design matrix file, which should have been output from Deconvolve via the 'x1D' option
slibase: generic/file+list-of
# type=inputmultiobject|default=[]: similar to 'addbase' in concept, BUT each specified file must have an integer multiple of the number of slices in the input dataset(s); then, separate regression matrices are generated for each slice, with the first column of the file appended to the matrix for the first slice of the dataset, the second column of the file appended to the matrix for the first slice of the dataset, and so on. Intended to help model physiological noise in FMRI, or other effects you want to regress out that might change significantly in the inter-slice time intervals. This will slow the program down, and make it use a lot more memory (to hold all the matrix stuff).
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/interfaces/retroicor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ inputs:
# type=file|default=<undefined>: Filename for 1D cardiac phase output
in_file: medimage/nifti1
# type=file|default=<undefined>: input file to 3dretroicor
resp: fileformats.medimage_afni.OneD
resp: fileformats.vendor.afni.medimage.OneD
# type=file|default=<undefined>: 1D respiratory waveform data for correction
respphase: generic/file
# type=file|default=<undefined>: Filename for 1D resp phase output
Expand Down
2 changes: 1 addition & 1 deletion nipype-auto-conv/specs/interfaces/volreg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ outputs:
md1d_file: generic/file
# type=file: max displacement info file
# type=file|default=<undefined>: max displacement output file
oned_file: fileformats.medimage_afni.OneD
oned_file: fileformats.vendor.afni.medimage.OneD
# type=file: movement parameters info file
# type=file|default=<undefined>: 1D movement parameters output file
oned_matrix_save: generic/file
Expand Down
2 changes: 1 addition & 1 deletion pydra/tasks/afni/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from ._version import __version__
except ImportError:
raise RuntimeError(
"pydra-afni has not been properly installed, please run "
"pydra-tasks-afni has not been properly installed, please run "
f"`pip install -e {str(pkg_path)}` to install a development version"
)
if "nipype" not in __version__:
Expand Down
6 changes: 3 additions & 3 deletions pydra/tasks/afni/v25/model/deconvolve.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import attrs
from fileformats.generic import File
from fileformats.medimage import Nifti1
from fileformats.medimage_afni import OneD
from fileformats.vendor.afni.medimage import OneD
import logging
from pydra.tasks.afni.v25.nipype_ports.utils.filemanip import fname_presuffix
import os
Expand Down Expand Up @@ -132,7 +132,7 @@ class Deconvolve(shell.Task["Deconvolve.Outputs"]):

>>> from fileformats.generic import File
>>> from fileformats.medimage import Nifti1
>>> from fileformats.medimage_afni import OneD
>>> from fileformats.vendor.afni.medimage import OneD
>>> from pathlib import Path
>>> from pydra.tasks.afni.v25.model.deconvolve import Deconvolve

Expand Down Expand Up @@ -312,7 +312,7 @@ class Deconvolve(shell.Task["Deconvolve.Outputs"]):
gltsym: list[str] = shell.arg(
help="general linear tests (i.e., contrasts) using symbolic conventions (e.g., '+Label1 -Label2')",
position=-2,
formatter="gltsym_formatter",
formatter=gltsym_formatter,
)
glt_label: list[ty.Any] = shell.arg(
help="general linear test (i.e., contrast) labels",
Expand Down
4 changes: 2 additions & 2 deletions pydra/tasks/afni/v25/model/remlfit.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import attrs
from fileformats.generic import File
from fileformats.medimage import Nifti1
from fileformats.medimage_afni import OneD
from fileformats.vendor.afni.medimage import OneD
import logging
import os
from pathlib import Path
Expand Down Expand Up @@ -138,7 +138,7 @@ class Remlfit(shell.Task["Remlfit.Outputs"]):

>>> from fileformats.generic import File
>>> from fileformats.medimage import Nifti1
>>> from fileformats.medimage_afni import OneD
>>> from fileformats.vendor.afni.medimage import OneD
>>> from pathlib import Path
>>> from pydra.tasks.afni.v25.model.remlfit import Remlfit

Expand Down
2 changes: 1 addition & 1 deletion pydra/tasks/afni/v25/model/tests/test_remlfit.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from fileformats.generic import File
from fileformats.medimage import Nifti1
from fileformats.medimage_afni import OneD
from fileformats.vendor.afni.medimage import OneD
import logging
from nipype2pydra.testing import PassAfterTimeoutWorker
from pydra.tasks.afni.v25.model.remlfit import Remlfit
Expand Down
2 changes: 1 addition & 1 deletion pydra/tasks/afni/v25/preprocess/qwarp.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ class Qwarp(shell.Task["Qwarp.Outputs"]):
allineate_opts: str = shell.arg(
help="add extra options to the 3dAllineate command to be run by 3dQwarp.",
requires=["allineate"],
formatter="allineate_opts_formatter",
formatter=allineate_opts_formatter,
)
nowarp: bool = shell.arg(help="Do not save the _WARP file.", argstr="-nowarp")
iwarp: bool = shell.arg(
Expand Down
2 changes: 1 addition & 1 deletion pydra/tasks/afni/v25/preprocess/qwarp_plus_minus.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class QwarpPlusMinus(shell.Task["QwarpPlusMinus.Outputs"]):
allineate_opts: str = shell.arg(
help="add extra options to the 3dAllineate command to be run by 3dQwarp.",
requires=["allineate"],
formatter="allineate_opts_formatter",
formatter=allineate_opts_formatter,
)
nowarp: bool = shell.arg(help="Do not save the _WARP file.", argstr="-nowarp")
iwarp: bool = shell.arg(
Expand Down
6 changes: 3 additions & 3 deletions pydra/tasks/afni/v25/preprocess/retroicor.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import attrs
from fileformats.generic import File
from fileformats.medimage import Nifti1
from fileformats.medimage_afni import OneD
from fileformats.vendor.afni.medimage import OneD
import logging
from pathlib import Path
from pathlib import Path
Expand Down Expand Up @@ -35,7 +35,7 @@ class Retroicor(shell.Task["Retroicor.Outputs"]):

>>> from fileformats.generic import File
>>> from fileformats.medimage import Nifti1
>>> from fileformats.medimage_afni import OneD
>>> from fileformats.vendor.afni.medimage import OneD
>>> from pathlib import Path
>>> from pydra.tasks.afni.v25.preprocess.retroicor import Retroicor

Expand All @@ -53,7 +53,7 @@ class Retroicor(shell.Task["Retroicor.Outputs"]):

executable = "3dretroicor"
in_file: Nifti1 = shell.arg(
help="input file to 3dretroicor", position=-1, formatter="in_file_formatter"
help="input file to 3dretroicor", position=-1, formatter=in_file_formatter
)
card: File = shell.arg(
help="1D cardiac data file for cardiac correction",
Expand Down
2 changes: 1 addition & 1 deletion pydra/tasks/afni/v25/preprocess/roi_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class ROIStats(shell.Task["ROIStats.Outputs"]):
)
stat: MultiInputObj = shell.arg(
help="Statistics to compute. Options include:\n\n * mean = Compute the mean using only non_zero voxels.\n Implies the opposite for the mean computed\n by default.\n * median = Compute the median of nonzero voxels\n * mode = Compute the mode of nonzero voxels.\n (integral valued sets only)\n * minmax = Compute the min/max of nonzero voxels\n * sum = Compute the sum using only nonzero voxels.\n * voxels = Compute the number of nonzero voxels\n * sigma = Compute the standard deviation of nonzero\n voxels\n\nStatistics that include zero-valued voxels:\n\n * zerominmax = Compute the min/max of all voxels.\n * zerosigma = Compute the standard deviation of all\n voxels.\n * zeromedian = Compute the median of all voxels.\n * zeromode = Compute the mode of all voxels.\n * summary = Only output a summary line with the grand\n mean across all briks in the input dataset.\n This option cannot be used with nomeanout.\n\nMore that one option can be specified.",
formatter="stat_formatter",
formatter=stat_formatter,
)

class Outputs(shell.Outputs):
Expand Down
2 changes: 1 addition & 1 deletion pydra/tasks/afni/v25/preprocess/t_corr_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class TCorrMap(shell.Task["TCorrMap.Outputs"]):
help="", argstr="-Sexpr {sum_expr[0]} {sum_expr[1]}"
)
histogram_bin_numbers: int = shell.arg(help="")
histogram: Path = shell.arg(help="", formatter="histogram_formatter")
histogram: Path = shell.arg(help="", formatter=histogram_formatter)
num_threads: int = shell.arg(help="set number of threads", default=1)
outputtype: ty.Any = shell.arg(help="AFNI output filetype")
out_file: Path = shell.arg(
Expand Down
4 changes: 2 additions & 2 deletions pydra/tasks/afni/v25/preprocess/t_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ class TShift(shell.Task["TShift.Outputs"]):
)
tpattern: ty.Any | None = shell.arg(
help="use specified slice time pattern rather than one in header",
formatter="tpattern_formatter",
formatter=tpattern_formatter,
)
slice_timing: ty.Any | None = shell.arg(
help="time offsets from the volume acquisition onset for each slice",
formatter="slice_timing_formatter",
formatter=slice_timing_formatter,
)
slice_encoding_direction: ty.Any = shell.arg(
help="Direction in which slice_timing is specified (default: k). If negative,slice_timing is defined in reverse order, that is, the first entry corresponds to the slice with the largest index, and the final entry corresponds to slice index zero. Only in effect when slice_timing is passed as list, not when it is passed as file.",
Expand Down
2 changes: 1 addition & 1 deletion pydra/tasks/afni/v25/preprocess/tests/test_retroicor.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from fileformats.generic import File
from fileformats.medimage import Nifti1
from fileformats.medimage_afni import OneD
from fileformats.vendor.afni.medimage import OneD
import logging
from nipype2pydra.testing import PassAfterTimeoutWorker
from pydra.tasks.afni.v25.preprocess.retroicor import Retroicor
Expand Down
2 changes: 1 addition & 1 deletion pydra/tasks/afni/v25/preprocess/volreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class Volreg(shell.Task["Volreg.Outputs"]):
)
in_weight_volume: ty.Any = shell.arg(
help="weights for each voxel specified by a file with an optional volume number (defaults to 0)",
formatter="in_weight_volume_formatter",
formatter=in_weight_volume_formatter,
)
basefile: Nifti1 = shell.arg(
help="base file for registration", argstr="-base {basefile}", position=-6
Expand Down
4 changes: 2 additions & 2 deletions pydra/tasks/afni/v25/utils/afn_ito_nifti.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from fileformats.medimage_afni import ThreeD
from fileformats.vendor.afni.medimage import ThreeD
import logging
import os
from pathlib import Path
Expand All @@ -20,7 +20,7 @@ class AFNItoNIFTI(shell.Task["AFNItoNIFTI.Outputs"]):
Examples
-------

>>> from fileformats.medimage_afni import ThreeD
>>> from fileformats.vendor.afni.medimage import ThreeD
>>> from pathlib import Path
>>> from pydra.tasks.afni.v25.utils.afn_ito_nifti import AFNItoNIFTI

Expand Down
2 changes: 1 addition & 1 deletion pydra/tasks/afni/v25/utils/bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class Bucket(shell.Task["Bucket.Outputs"]):
in_file: list[ty.Any] = shell.arg(
help="List of tuples of input datasets and subbrick selection strings\nas described in more detail in the following afni help string\nInput dataset specified using one of these forms:\n``prefix+view``, ``prefix+view.HEAD``, or ``prefix+view.BRIK``.\nYou can also add a sub-brick selection list after the end of the\ndataset name. This allows only a subset of the sub-bricks to be\nincluded into the output (by default, all of the input dataset\nis copied into the output). A sub-brick selection list looks like\none of the following forms::\n\n fred+orig[5] ==> use only sub-brick #5\n fred+orig[5,9,17] ==> use #5, #9, and #17\n fred+orig[5..8] or [5-8] ==> use #5, #6, #7, and #8\n fred+orig[5..13(2)] or [5-13(2)] ==> use #5, #7, #9, #11, and #13\n\nSub-brick indexes start at 0. You can use the character '$'\nto indicate the last sub-brick in a dataset; for example, you\ncan select every third sub-brick by using the selection list\n``fred+orig[0..$(3)]``\nN.B.: The sub-bricks are output in the order specified, which may\nnot be the order in the original datasets. For example, using\n``fred+orig[0..$(2),1..$(2)]``\nwill cause the sub-bricks in fred+orig to be output into the\nnew dataset in an interleaved fashion. Using ``fred+orig[$..0]``\nwill reverse the order of the sub-bricks in the output.\nN.B.: Bucket datasets have multiple sub-bricks, but do NOT have\na time dimension. You can input sub-bricks from a 3D+time dataset\ninto a bucket dataset. You can use the '3dinfo' program to see\nhow many sub-bricks a 3D+time or a bucket dataset contains.\nN.B.: In non-bucket functional datasets (like the 'fico' datasets\noutput by FIM, or the 'fitt' datasets output by 3dttest), sub-brick\n``[0]`` is the 'intensity' and sub-brick [1] is the statistical parameter\nused as a threshold. Thus, to create a bucket dataset using the\nintensity from dataset A and the threshold from dataset B, and\ncalling the output dataset C, you would type::\n\n 3dbucket -prefix C -fbuc 'A+orig[0]' -fbuc 'B+orig[1]\n\n",
position=-1,
formatter="in_file_formatter",
formatter=in_file_formatter,
)
num_threads: int = shell.arg(help="set number of threads", default=1)
outputtype: ty.Any = shell.arg(help="AFNI output filetype")
Expand Down
2 changes: 1 addition & 1 deletion pydra/tasks/afni/v25/utils/calc.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Calc(shell.Task["Calc.Outputs"]):

executable = "3dcalc"
in_file_a: Nifti1 = shell.arg(
help="input file to 3dcalc", formatter="in_file_a_formatter", position=1
help="input file to 3dcalc", formatter=in_file_a_formatter, position=1
)
in_file_b: File = shell.arg(
help="operand file to 3dcalc", argstr="-b {in_file_b}", position=2
Expand Down
4 changes: 2 additions & 2 deletions pydra/tasks/afni/v25/utils/cat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import attrs
from fileformats.generic import File
from fileformats.medimage_afni import OneD
from fileformats.vendor.afni.medimage import OneD
import logging
from pydra.tasks.afni.v25.nipype_ports.utils.filemanip import split_filename
from pathlib import Path
Expand Down Expand Up @@ -44,7 +44,7 @@ class Cat(shell.Task["Cat.Outputs"]):
-------

>>> from fileformats.generic import File
>>> from fileformats.medimage_afni import OneD
>>> from fileformats.vendor.afni.medimage import OneD
>>> from pathlib import Path
>>> from pydra.tasks.afni.v25.utils.cat import Cat

Expand Down
Loading