diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index c43e4e6..3965435 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -259,7 +259,7 @@ jobs: - name: Generate post-release tag based on Nipype and Nipype2Pydra versions id: post_release_tag run: | - POST=$(python -c "from pydra.tasks.ants.auto._version import *; print(post_release)") + POST=$(python -c "from pydra.tasks.ants.auto._post_release import *; print(post_release)") echo "TAG=${{ steps.latest_tag.outputs.TAG }}post${POST}" >> $GITHUB_OUTPUT - name: Add auto directory to git repo diff --git a/.gitignore b/.gitignore index 0d32122..2a3a1a2 100644 --- a/.gitignore +++ b/.gitignore @@ -165,3 +165,4 @@ cython_debug/ # Generated files /pydra/tasks/ants/_version.py /pydra/tasks/ants/auto +/pydra/tasks/ants/nipype_ports diff --git a/nipype-auto-conv/generate b/nipype-auto-conv/generate index 42f5fcb..3e72ae0 100755 --- a/nipype-auto-conv/generate +++ b/nipype-auto-conv/generate @@ -1,81 +1,3 @@ -#!/usr/bin/env python3 -import sys -import os.path -from warnings import warn -from pathlib import Path -import shutil -from importlib import import_module -from tqdm import tqdm -import yaml -import nipype -import nipype2pydra.utils -from nipype2pydra.task import get_converter - - -SPECS_DIR = Path(__file__).parent / "specs" -PKG_ROOT = Path(__file__).parent.parent -PKG_NAME = "ants" - -if ".dev" in nipype.__version__: - raise RuntimeError( - f"Cannot use a development version of Nipype {nipype.__version__}" - ) - -if ".dev" in nipype2pydra.__version__: - warn( - f"using development version of nipype2pydra ({nipype2pydra.__version__}), " - f"development component will be dropped in {PKG_NAME} package version" - ) - -# Insert specs dir into path so we can load callables modules -sys.path.insert(0, str(SPECS_DIR)) - -auto_init = f"# Auto-generated by {__file__}, do not edit as it will be overwritten\n\n" - -auto_dir = PKG_ROOT / "pydra" / "tasks" / PKG_NAME / "auto" -if auto_dir.exists(): - shutil.rmtree(auto_dir) - -all_interfaces = [] -for fspath in tqdm( - sorted(SPECS_DIR.glob("**/*.yaml")), "converting interfaces from Nipype to Pydra" -): - with open(fspath) as f: - spec = yaml.load(f, Loader=yaml.SafeLoader) - - rel_pkg_path = str(fspath.parent.relative_to(SPECS_DIR)).replace(os.path.sep, ".") - if rel_pkg_path == ".": - rel_pkg_path = fspath.stem - else: - rel_pkg_path += "." + fspath.stem - - callables = import_module(rel_pkg_path + "_callables") - - module_name = nipype2pydra.utils.to_snake_case(spec["task_name"]) - - converter = get_converter( - output_module=f"pydra.tasks.{PKG_NAME}.auto.{module_name}", - callables_module=callables, # type: ignore - **spec, - ) - converter.generate(PKG_ROOT) - auto_init += f"from .{module_name} import {converter.task_name}\n" - all_interfaces.append(converter.task_name) - - -with open(PKG_ROOT / "pydra" / "tasks" / PKG_NAME / "auto" / "_version.py", "w") as f: - f.write( - f"""# Auto-generated by {__file__}, do not edit as it will be overwritten - -nipype_version = "{nipype.__version__.split('.dev')[0]}" -nipype2pydra_version = "{nipype2pydra.__version__.split('.dev')[0]}" -post_release = (nipype_version + nipype2pydra_version).replace(".", "") -""" - ) - -auto_init += ( - "\n\n__all__ = [\n" + "\n".join(f' "{i}",' for i in all_interfaces) + "\n]\n" -) - -with open(PKG_ROOT / "pydra" / "tasks" / PKG_NAME / "auto" / "__init__.py", "w") as f: - f.write(auto_init) +#!/usr/bin/env bash +conv_dir=$(dirname $0) +nipype2pydra convert $conv_dir/specs $conv_dir/.. diff --git a/nipype-auto-conv/specs/affine_initializer.yaml b/nipype-auto-conv/specs/affine_initializer.yaml deleted file mode 100644 index b54afde..0000000 --- a/nipype-auto-conv/specs/affine_initializer.yaml +++ /dev/null @@ -1,145 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.utils.AffineInitializer' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Initialize an affine transform (as in antsBrainExtraction.sh) -# -# >>> from nipype.interfaces.ants import AffineInitializer -# >>> init = AffineInitializer() -# >>> init.inputs.fixed_image = 'fixed1.nii' -# >>> init.inputs.moving_image = 'moving1.nii' -# >>> init.cmdline -# 'antsAffineInitializer 3 fixed1.nii moving1.nii transform.mat 15.000000 0.100000 0 10' -# -# -task_name: AffineInitializer -nipype_name: AffineInitializer -nipype_module: nipype.interfaces.ants.utils -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - fixed_image: medimage/nifti1 - # type=file|default=: reference image - moving_image: medimage/nifti1 - # type=file|default=: moving image - out_file: Path - # type=file: output transform file - # type=file|default='transform.mat': output transform file - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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: generic/file - # type=file: output transform file - # type=file|default='transform.mat': output transform file - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: dimension - fixed_image: - # type=file|default=: reference image - moving_image: - # type=file|default=: moving image - out_file: - # type=file: output transform file - # type=file|default='transform.mat': output transform file - search_factor: - # type=float|default=15.0: increments (degrees) for affine search - radian_fraction: - # type=range|default=0.1: search this arc +/- principal axes - principal_axes: - # type=bool|default=False: whether the rotation is searched around an initial principal axis alignment. - local_search: - # type=int|default=10: determines if a local optimization is run at each search point for the set number of iterations - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - fixed_image: - # type=file|default=: reference image - moving_image: - # type=file|default=: moving image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: antsAffineInitializer 3 fixed1.nii moving1.nii transform.mat 15.000000 0.100000 0 10 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - fixed_image: '"fixed1.nii"' - # type=file|default=: reference image - moving_image: '"moving1.nii"' - # type=file|default=: moving image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/ai.yaml b/nipype-auto-conv/specs/ai.yaml deleted file mode 100644 index 5fda363..0000000 --- a/nipype-auto-conv/specs/ai.yaml +++ /dev/null @@ -1,133 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.utils.AI' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Calculate the optimal linear transform parameters for aligning two images. -# -# Examples -# -------- -# >>> AI( -# ... fixed_image='structural.nii', -# ... moving_image='epi.nii', -# ... metric=('Mattes', 32, 'Regular', 1), -# ... ).cmdline -# 'antsAI -c [10,1e-06,10] -d 3 -m Mattes[structural.nii,epi.nii,32,Regular,1] -# -o initialization.mat -p 0 -s [20,0.12] -t Affine[0.1] -v 0' -# -# >>> AI(fixed_image='structural.nii', -# ... moving_image='epi.nii', -# ... metric=('Mattes', 32, 'Regular', 1), -# ... search_grid=(12, (1, 1, 1)), -# ... ).cmdline -# 'antsAI -c [10,1e-06,10] -d 3 -m Mattes[structural.nii,epi.nii,32,Regular,1] -# -o initialization.mat -p 0 -s [20,0.12] -g [12.0,1x1x1] -t Affine[0.1] -v 0' -# -# -task_name: AI -nipype_name: AI -nipype_module: nipype.interfaces.ants.utils -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - fixed_image: generic/file - # type=file|default=: Image to which the moving_image should be transformed - fixed_image_mask: generic/file - # type=file|default=: fixed mage mask - moving_image: generic/file - # type=file|default=: Image that will be transformed to fixed_image - moving_image_mask: generic/file - # type=file|default=: moving mage mask - output_transform: Path - # type=file: output file name - # type=file|default='initialization.mat': output file name - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_transform: generic/file - # type=file: output file name - # type=file|default='initialization.mat': output file name - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: dimension of output image - verbose: - # type=bool|default=False: enable verbosity - fixed_image: - # type=file|default=: Image to which the moving_image should be transformed - moving_image: - # type=file|default=: Image that will be transformed to fixed_image - fixed_image_mask: - # type=file|default=: fixed mage mask - moving_image_mask: - # type=file|default=: moving mage mask - metric: - # type=tuple|default=('Mattes', 32, 'Regular', 0.2): the metric(s) to use. - transform: - # type=tuple|default=('Affine', 0.1): Several transform options are available - principal_axes: - # type=bool|default=False: align using principal axes - search_factor: - # type=tuple|default=(20, 0.12): search factor - search_grid: - # type=traitcompound|default=None: Translation search grid in mm - convergence: - # type=tuple|default=(10, 1e-06, 10): convergence - output_transform: - # type=file: output file name - # type=file|default='initialization.mat': output file name - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: [] diff --git a/nipype-auto-conv/specs/ants.yaml b/nipype-auto-conv/specs/ants.yaml deleted file mode 100644 index 4a00c3a..0000000 --- a/nipype-auto-conv/specs/ants.yaml +++ /dev/null @@ -1,248 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.registration.ANTS' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# ANTS wrapper for registration of images -# (old, use Registration instead) -# -# Examples -# -------- -# -# >>> from nipype.interfaces.ants import ANTS -# >>> ants = ANTS() -# >>> ants.inputs.dimension = 3 -# >>> ants.inputs.output_transform_prefix = 'MY' -# >>> ants.inputs.metric = ['CC'] -# >>> ants.inputs.fixed_image = ['T1.nii'] -# >>> ants.inputs.moving_image = ['resting.nii'] -# >>> ants.inputs.metric_weight = [1.0] -# >>> ants.inputs.radius = [5] -# >>> ants.inputs.transformation_model = 'SyN' -# >>> ants.inputs.gradient_step_length = 0.25 -# >>> ants.inputs.number_of_iterations = [50, 35, 15] -# >>> ants.inputs.use_histogram_matching = True -# >>> ants.inputs.mi_option = [32, 16000] -# >>> ants.inputs.regularization = 'Gauss' -# >>> ants.inputs.regularization_gradient_field_sigma = 3 -# >>> ants.inputs.regularization_deformation_field_sigma = 0 -# >>> ants.inputs.number_of_affine_iterations = [10000,10000,10000,10000,10000] -# >>> ants.cmdline -# 'ANTS 3 --MI-option 32x16000 --image-metric CC[ T1.nii, resting.nii, 1, 5 ] --number-of-affine-iterations 10000x10000x10000x10000x10000 --number-of-iterations 50x35x15 --output-naming MY --regularization Gauss[3.0,0.0] --transformation-model SyN[0.25] --use-Histogram-Matching 1' -# -task_name: ANTS -nipype_name: ANTS -nipype_module: nipype.interfaces.ants.registration -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - fixed_image: medimage/nifti1+list-of - # type=inputmultiobject|default=[]: image to which the moving image is warped - moving_image: medimage/nifti1+list-of - # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregisteredfunctional) - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - affine_transform: generic/file - # type=file: Affine transform file - inverse_warp_transform: generic/file - # type=file: Inverse warping deformation field - metaheader: generic/file - # type=file: VTK metaheader .mhd file - metaheader_raw: generic/file - # type=file: VTK metaheader .raw file - warp_transform: generic/file - # type=file: Warping deformation field - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - fixed_image: - # type=inputmultiobject|default=[]: image to which the moving image is warped - moving_image: - # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregisteredfunctional) - metric: - # type=list|default=[]: - metric_weight: - # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. - radius: - # type=list|default=[]: radius of the region (i.e. number of layers around a voxel/pixel) that is used for computing cross correlation - output_transform_prefix: - # type=str|default='out': - transformation_model: - # type=enum|default='Diff'|allowed['Diff','Elast','Exp','Greedy Exp','SyN']: - gradient_step_length: - # type=float|default=0.0: - number_of_time_steps: - # type=int|default=0: - delta_time: - # type=float|default=0.0: - symmetry_type: - # type=float|default=0.0: - use_histogram_matching: - # type=bool|default=True: - number_of_iterations: - # type=list|default=[]: - smoothing_sigmas: - # type=list|default=[]: - subsampling_factors: - # type=list|default=[]: - affine_gradient_descent_option: - # type=list|default=[]: - mi_option: - # type=list|default=[]: - regularization: - # type=enum|default='Gauss'|allowed['DMFFD','Gauss']: - regularization_gradient_field_sigma: - # type=float|default=0.0: - regularization_deformation_field_sigma: - # type=float|default=0.0: - number_of_affine_iterations: - # type=list|default=[]: - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - output_transform_prefix: '"MY"' - # type=str|default='out': - metric: '["CC"]' - # type=list|default=[]: - fixed_image: - # type=inputmultiobject|default=[]: image to which the moving image is warped - moving_image: - # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregisteredfunctional) - metric_weight: '[1.0]' - # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. - radius: '[5]' - # type=list|default=[]: radius of the region (i.e. number of layers around a voxel/pixel) that is used for computing cross correlation - transformation_model: '"SyN"' - # type=enum|default='Diff'|allowed['Diff','Elast','Exp','Greedy Exp','SyN']: - gradient_step_length: '0.25' - # type=float|default=0.0: - number_of_iterations: '[50, 35, 15]' - # type=list|default=[]: - use_histogram_matching: 'True' - # type=bool|default=True: - mi_option: '[32, 16000]' - # type=list|default=[]: - regularization: '"Gauss"' - # type=enum|default='Gauss'|allowed['DMFFD','Gauss']: - regularization_gradient_field_sigma: '3' - # type=float|default=0.0: - regularization_deformation_field_sigma: '0' - # type=float|default=0.0: - number_of_affine_iterations: '[10000,10000,10000,10000,10000]' - # type=list|default=[]: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: ANTS 3 --MI-option 32x16000 --image-metric CC[ T1.nii, resting.nii, 1, 5 ] --number-of-affine-iterations 10000x10000x10000x10000x10000 --number-of-iterations 50x35x15 --output-naming MY --regularization Gauss[3.0,0.0] --transformation-model SyN[0.25] --use-Histogram-Matching 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - output_transform_prefix: '"MY"' - # type=str|default='out': - metric: '["CC"]' - # type=list|default=[]: - fixed_image: '["T1.nii"]' - # type=inputmultiobject|default=[]: image to which the moving image is warped - moving_image: '["resting.nii"]' - # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregisteredfunctional) - metric_weight: '[1.0]' - # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. - radius: '[5]' - # type=list|default=[]: radius of the region (i.e. number of layers around a voxel/pixel) that is used for computing cross correlation - transformation_model: '"SyN"' - # type=enum|default='Diff'|allowed['Diff','Elast','Exp','Greedy Exp','SyN']: - gradient_step_length: '0.25' - # type=float|default=0.0: - number_of_iterations: '[50, 35, 15]' - # type=list|default=[]: - use_histogram_matching: 'True' - # type=bool|default=True: - mi_option: '[32, 16000]' - # type=list|default=[]: - regularization: '"Gauss"' - # type=enum|default='Gauss'|allowed['DMFFD','Gauss']: - regularization_gradient_field_sigma: '3' - # type=float|default=0.0: - regularization_deformation_field_sigma: '0' - # type=float|default=0.0: - number_of_affine_iterations: '[10000,10000,10000,10000,10000]' - # type=list|default=[]: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/ants_introduction.yaml b/nipype-auto-conv/specs/ants_introduction.yaml deleted file mode 100644 index f016eb4..0000000 --- a/nipype-auto-conv/specs/ants_introduction.yaml +++ /dev/null @@ -1,161 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.legacy.antsIntroduction' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# Uses ANTS to generate matrices to warp data from one space to another. -# -# Examples -# -------- -# -# >>> from nipype.interfaces.ants.legacy import antsIntroduction -# >>> warp = antsIntroduction() -# >>> warp.inputs.reference_image = 'Template_6.nii' -# >>> warp.inputs.input_image = 'structural.nii' -# >>> warp.inputs.max_iterations = [30,90,20] -# >>> warp.cmdline -# 'antsIntroduction.sh -d 3 -i structural.nii -m 30x90x20 -o ants_ -r Template_6.nii -t GR' -# -# -task_name: antsIntroduction -nipype_name: antsIntroduction -nipype_module: nipype.interfaces.ants.legacy -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - input_image: medimage/nifti1 - # type=file|default=: input image to warp to template - reference_image: medimage/nifti1 - # type=file|default=: template file to warp to - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - affine_transformation: generic/file - # type=file: affine (prefix_Affine.txt) - input_file: generic/file - # type=file: input image (prefix_repaired.nii) - inverse_warp_field: generic/file - # type=file: inverse warp field (prefix_InverseWarp.nii) - output_file: generic/file - # type=file: output image (prefix_deformed.nii) - warp_field: generic/file - # type=file: warp field (prefix_Warp.nii) - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - reference_image: - # type=file|default=: template file to warp to - input_image: - # type=file|default=: input image to warp to template - force_proceed: - # type=bool|default=False: force script to proceed even if headers may be incompatible - inverse_warp_template_labels: - # type=bool|default=False: Applies inverse warp to the template labels to estimate label positions in target space (use for template-based segmentation) - max_iterations: - # type=list|default=[]: maximum number of iterations (must be list of integers in the form [J,K,L...]: J = coarsest resolution iterations, K = middle resolution iterations, L = fine resolution iterations - bias_field_correction: - # type=bool|default=False: Applies bias field correction to moving image - similarity_metric: - # type=enum|default='PR'|allowed['CC','MI','MSQ','PR']: Type of similartiy metric used for registration (CC = cross correlation, MI = mutual information, PR = probability mapping, MSQ = mean square difference) - transformation_model: - # type=enum|default='GR'|allowed['DD','EL','EX','GR','RA','RI','S2','SY']: Type of transofmration model used for registration (EL = elastic transformation model, SY = SyN with time, arbitrary number of time points, S2 = SyN with time optimized for 2 time points, GR = greedy SyN, EX = exponential, DD = diffeomorphic demons style exponential mapping, RI = purely rigid, RA = affine rigid - out_prefix: - # type=str|default='ants_': Prefix that is prepended to all output files (default = ants_) - quality_check: - # type=bool|default=False: Perform a quality check of the result - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - reference_image: - # type=file|default=: template file to warp to - input_image: - # type=file|default=: input image to warp to template - max_iterations: '[30,90,20]' - # type=list|default=[]: maximum number of iterations (must be list of integers in the form [J,K,L...]: J = coarsest resolution iterations, K = middle resolution iterations, L = fine resolution iterations - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: antsIntroduction.sh -d 3 -i structural.nii -m 30x90x20 -o ants_ -r Template_6.nii -t GR - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - reference_image: '"Template_6.nii"' - # type=file|default=: template file to warp to - input_image: '"structural.nii"' - # type=file|default=: input image to warp to template - max_iterations: '[30,90,20]' - # type=list|default=[]: maximum number of iterations (must be list of integers in the form [J,K,L...]: J = coarsest resolution iterations, K = middle resolution iterations, L = fine resolution iterations - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/apply_transforms.yaml b/nipype-auto-conv/specs/apply_transforms.yaml deleted file mode 100644 index fdcb2a7..0000000 --- a/nipype-auto-conv/specs/apply_transforms.yaml +++ /dev/null @@ -1,394 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.resampling.ApplyTransforms' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# ApplyTransforms, applied to an input image, transforms it according to a -# reference image and a transform (or a set of transforms). -# -# Examples -# -------- -# -# >>> from nipype.interfaces.ants import ApplyTransforms -# >>> at = ApplyTransforms() -# >>> at.inputs.input_image = 'moving1.nii' -# >>> at.inputs.reference_image = 'fixed1.nii' -# >>> at.inputs.transforms = 'identity' -# >>> at.cmdline -# 'antsApplyTransforms --default-value 0 --float 0 --input moving1.nii --interpolation Linear --output moving1_trans.nii --reference-image fixed1.nii --transform identity' -# -# >>> at = ApplyTransforms() -# >>> at.inputs.dimension = 3 -# >>> at.inputs.input_image = 'moving1.nii' -# >>> at.inputs.reference_image = 'fixed1.nii' -# >>> at.inputs.output_image = 'deformed_moving1.nii' -# >>> at.inputs.interpolation = 'Linear' -# >>> at.inputs.default_value = 0 -# >>> at.inputs.transforms = ['ants_Warp.nii.gz', 'trans.mat'] -# >>> at.inputs.invert_transform_flags = [False, True] -# >>> at.cmdline -# 'antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii --interpolation Linear --output deformed_moving1.nii --reference-image fixed1.nii --transform ants_Warp.nii.gz --transform [ trans.mat, 1 ]' -# -# >>> at1 = ApplyTransforms() -# >>> at1.inputs.dimension = 3 -# >>> at1.inputs.input_image = 'moving1.nii' -# >>> at1.inputs.reference_image = 'fixed1.nii' -# >>> at1.inputs.output_image = 'deformed_moving1.nii' -# >>> at1.inputs.interpolation = 'BSpline' -# >>> at1.inputs.interpolation_parameters = (5,) -# >>> at1.inputs.default_value = 0 -# >>> at1.inputs.transforms = ['ants_Warp.nii.gz', 'trans.mat'] -# >>> at1.inputs.invert_transform_flags = [False, False] -# >>> at1.cmdline -# 'antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii --interpolation BSpline[ 5 ] --output deformed_moving1.nii --reference-image fixed1.nii --transform ants_Warp.nii.gz --transform trans.mat' -# -# Identity transforms may be used as part of a chain: -# -# >>> at2 = ApplyTransforms() -# >>> at2.inputs.dimension = 3 -# >>> at2.inputs.input_image = 'moving1.nii' -# >>> at2.inputs.reference_image = 'fixed1.nii' -# >>> at2.inputs.output_image = 'deformed_moving1.nii' -# >>> at2.inputs.interpolation = 'BSpline' -# >>> at2.inputs.interpolation_parameters = (5,) -# >>> at2.inputs.default_value = 0 -# >>> at2.inputs.transforms = ['identity', 'ants_Warp.nii.gz', 'trans.mat'] -# >>> at2.cmdline -# 'antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii --interpolation BSpline[ 5 ] --output deformed_moving1.nii --reference-image fixed1.nii --transform identity --transform ants_Warp.nii.gz --transform trans.mat' -# -task_name: ApplyTransforms -nipype_name: ApplyTransforms -nipype_module: nipype.interfaces.ants.resampling -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - input_image: medimage/nifti1 - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: medimage/nifti1 - # type=file|default=: reference image space that you wish to warp INTO - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_image: medimage/nifti1 - # type=file: Warped image - # type=str|default='': output file name - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - output_image: '"deformed_moving1.nii"' - # type=file: Warped image - # type=str|default='': output file name - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. - input_image_type: - # type=enum|default=0|allowed[0,1,2,3]: Option specifying the input image type of scalar (default), vector, tensor, or time series. - input_image: - # type=file|default=: image to apply transformation to (generally a coregistered functional) - output_image: - # type=file: Warped image - # type=str|default='': output file name - out_postfix: - # type=str|default='_trans': Postfix that is appended to all output files (default = _trans) - reference_image: - # type=file|default=: reference image space that you wish to warp INTO - interpolation: - # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: - interpolation_parameters: - # type=traitcompound|default=None: - transforms: - # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. - invert_transform_flags: - # type=inputmultiobject|default=[]: - default_value: - # type=float|default=0.0: - print_out_composite_warp_file: - # type=bool|default=False: output a composite warp file instead of a transformed image - float: - # type=bool|default=False: Use float instead of double for computations. - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: - # type=file|default=: reference image space that you wish to warp INTO - transforms: '"identity"' - # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. - input_image: - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: - # type=file|default=: reference image space that you wish to warp INTO - output_image: '"deformed_moving1.nii"' - # type=file: Warped image - # type=str|default='': output file name - interpolation: '"Linear"' - # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: - default_value: '0' - # type=float|default=0.0: - transforms: '["ants_Warp.nii.gz", "trans.mat"]' - # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. - invert_transform_flags: '[False, True]' - # type=inputmultiobject|default=[]: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. - input_image: - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: - # type=file|default=: reference image space that you wish to warp INTO - output_image: '"deformed_moving1.nii"' - # type=file: Warped image - # type=str|default='': output file name - interpolation: '"BSpline"' - # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: - interpolation_parameters: (5,) - # type=traitcompound|default=None: - default_value: '0' - # type=float|default=0.0: - transforms: '["ants_Warp.nii.gz", "trans.mat"]' - # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. - invert_transform_flags: '[False, False]' - # type=inputmultiobject|default=[]: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. - input_image: - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: - # type=file|default=: reference image space that you wish to warp INTO - output_image: '"deformed_moving1.nii"' - # type=file: Warped image - # type=str|default='': output file name - interpolation: '"BSpline"' - # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: - interpolation_parameters: (5,) - # type=traitcompound|default=None: - default_value: '0' - # type=float|default=0.0: - transforms: '["identity", "ants_Warp.nii.gz", "trans.mat"]' - # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: antsApplyTransforms --default-value 0 --float 0 --input moving1.nii --interpolation Linear --output moving1_trans.nii --reference-image fixed1.nii --transform identity - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"moving1.nii"' - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: '"fixed1.nii"' - # type=file|default=: reference image space that you wish to warp INTO - transforms: '"identity"' - # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii --interpolation Linear --output deformed_moving1.nii --reference-image fixed1.nii --transform ants_Warp.nii.gz --transform [ trans.mat, 1 ] - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. - input_image: '"moving1.nii"' - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: '"fixed1.nii"' - # type=file|default=: reference image space that you wish to warp INTO - output_image: '"deformed_moving1.nii"' - # type=file: Warped image - # type=str|default='': output file name - interpolation: '"Linear"' - # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: - default_value: '0' - # type=float|default=0.0: - transforms: '["ants_Warp.nii.gz", "trans.mat"]' - # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. - invert_transform_flags: '[False, True]' - # type=inputmultiobject|default=[]: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii --interpolation BSpline[ 5 ] --output deformed_moving1.nii --reference-image fixed1.nii --transform ants_Warp.nii.gz --transform trans.mat - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. - input_image: '"moving1.nii"' - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: '"fixed1.nii"' - # type=file|default=: reference image space that you wish to warp INTO - output_image: '"deformed_moving1.nii"' - # type=file: Warped image - # type=str|default='': output file name - interpolation: '"BSpline"' - # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: - interpolation_parameters: (5,) - # type=traitcompound|default=None: - default_value: '0' - # type=float|default=0.0: - transforms: '["ants_Warp.nii.gz", "trans.mat"]' - # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. - invert_transform_flags: '[False, False]' - # type=inputmultiobject|default=[]: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii --interpolation BSpline[ 5 ] --output deformed_moving1.nii --reference-image fixed1.nii --transform identity --transform ants_Warp.nii.gz --transform trans.mat - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. - input_image: '"moving1.nii"' - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: '"fixed1.nii"' - # type=file|default=: reference image space that you wish to warp INTO - output_image: '"deformed_moving1.nii"' - # type=file: Warped image - # type=str|default='': output file name - interpolation: '"BSpline"' - # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: - interpolation_parameters: (5,) - # type=traitcompound|default=None: - default_value: '0' - # type=float|default=0.0: - transforms: '["identity", "ants_Warp.nii.gz", "trans.mat"]' - # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/atropos.yaml b/nipype-auto-conv/specs/atropos.yaml deleted file mode 100644 index 1dd546e..0000000 --- a/nipype-auto-conv/specs/atropos.yaml +++ /dev/null @@ -1,583 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.segmentation.Atropos' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# A multivariate n-class segmentation algorithm. -# -# A finite mixture modeling (FMM) segmentation approach with possibilities for -# specifying prior constraints. These prior constraints include the specification -# of a prior label image, prior probability images (one for each class), and/or an -# MRF prior to enforce spatial smoothing of the labels. Similar algorithms include -# FAST and SPM. -# -# Examples -# -------- -# >>> from nipype.interfaces.ants import Atropos -# >>> at = Atropos( -# ... dimension=3, intensity_images='structural.nii', mask_image='mask.nii', -# ... number_of_tissue_classes=2, likelihood_model='Gaussian', save_posteriors=True, -# ... mrf_smoothing_factor=0.2, mrf_radius=[1, 1, 1], icm_use_synchronous_update=True, -# ... maximum_number_of_icm_terations=1, n_iterations=5, convergence_threshold=0.000001, -# ... posterior_formulation='Socrates', use_mixture_model_proportions=True) -# >>> at.inputs.initialization = 'Random' -# >>> at.cmdline -# 'Atropos --image-dimensionality 3 --icm [1,1] -# --initialization Random[2] --intensity-image structural.nii -# --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] -# --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] -# --use-random-seed 1' -# -# >>> at = Atropos( -# ... dimension=3, intensity_images='structural.nii', mask_image='mask.nii', -# ... number_of_tissue_classes=2, likelihood_model='Gaussian', save_posteriors=True, -# ... mrf_smoothing_factor=0.2, mrf_radius=[1, 1, 1], icm_use_synchronous_update=True, -# ... maximum_number_of_icm_terations=1, n_iterations=5, convergence_threshold=0.000001, -# ... posterior_formulation='Socrates', use_mixture_model_proportions=True) -# >>> at.inputs.initialization = 'KMeans' -# >>> at.inputs.kmeans_init_centers = [100, 200] -# >>> at.cmdline -# 'Atropos --image-dimensionality 3 --icm [1,1] -# --initialization KMeans[2,100,200] --intensity-image structural.nii -# --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] -# --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] -# --use-random-seed 1' -# -# >>> at = Atropos( -# ... dimension=3, intensity_images='structural.nii', mask_image='mask.nii', -# ... number_of_tissue_classes=2, likelihood_model='Gaussian', save_posteriors=True, -# ... mrf_smoothing_factor=0.2, mrf_radius=[1, 1, 1], icm_use_synchronous_update=True, -# ... maximum_number_of_icm_terations=1, n_iterations=5, convergence_threshold=0.000001, -# ... posterior_formulation='Socrates', use_mixture_model_proportions=True) -# >>> at.inputs.initialization = 'PriorProbabilityImages' -# >>> at.inputs.prior_image = 'BrainSegmentationPrior%02d.nii.gz' -# >>> at.inputs.prior_weighting = 0.8 -# >>> at.inputs.prior_probability_threshold = 0.0000001 -# >>> at.cmdline -# 'Atropos --image-dimensionality 3 --icm [1,1] -# --initialization PriorProbabilityImages[2,BrainSegmentationPrior%02d.nii.gz,0.8,1e-07] -# --intensity-image structural.nii --likelihood-model Gaussian --mask-image mask.nii -# --mrf [0.2,1x1x1] --convergence [5,1e-06] -# --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] -# --posterior-formulation Socrates[1] --use-random-seed 1' -# -# >>> at = Atropos( -# ... dimension=3, intensity_images='structural.nii', mask_image='mask.nii', -# ... number_of_tissue_classes=2, likelihood_model='Gaussian', save_posteriors=True, -# ... mrf_smoothing_factor=0.2, mrf_radius=[1, 1, 1], icm_use_synchronous_update=True, -# ... maximum_number_of_icm_terations=1, n_iterations=5, convergence_threshold=0.000001, -# ... posterior_formulation='Socrates', use_mixture_model_proportions=True) -# >>> at.inputs.initialization = 'PriorLabelImage' -# >>> at.inputs.prior_image = 'segmentation0.nii.gz' -# >>> at.inputs.number_of_tissue_classes = 2 -# >>> at.inputs.prior_weighting = 0.8 -# >>> at.cmdline -# 'Atropos --image-dimensionality 3 --icm [1,1] -# --initialization PriorLabelImage[2,segmentation0.nii.gz,0.8] --intensity-image structural.nii -# --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] -# --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] -# --use-random-seed 1' -# -# -task_name: Atropos -nipype_name: Atropos -nipype_module: nipype.interfaces.ants.segmentation -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - intensity_images: medimage/nifti1+list-of - # type=inputmultiobject|default=[]: - mask_image: medimage/nifti1 - # type=file|default=: - out_classified_image_name: Path - # type=file|default=: - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - out_classified_image_name: out_classified_image_name_default - # type=file|default=: - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - classified_image: generic/file - # type=file: - posteriors: generic/file+list-of - # type=outputmultiobject: - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) - intensity_images: - # type=inputmultiobject|default=[]: - mask_image: - # type=file|default=: - initialization: - # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: - kmeans_init_centers: - # type=list|default=[]: - prior_image: - # type=traitcompound|default=None: either a string pattern (e.g., 'prior%02d.nii') or an existing vector-image file. - number_of_tissue_classes: - # type=int|default=0: - prior_weighting: - # type=float|default=0.0: - prior_probability_threshold: - # type=float|default=0.0: - likelihood_model: - # type=str|default='': - mrf_smoothing_factor: - # type=float|default=0.0: - mrf_radius: - # type=list|default=[]: - icm_use_synchronous_update: - # type=bool|default=False: - maximum_number_of_icm_terations: - # type=int|default=0: - n_iterations: - # type=int|default=0: - convergence_threshold: - # type=float|default=0.0: - posterior_formulation: - # type=str|default='': - use_random_seed: - # type=bool|default=True: use random seed value over constant - use_mixture_model_proportions: - # type=bool|default=False: - out_classified_image_name: - # type=file|default=: - save_posteriors: - # type=bool|default=False: - output_posteriors_name_template: - # type=str|default='POSTERIOR_%02d.nii.gz': - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - initialization: '"Random"' - # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) - intensity_images: - # type=inputmultiobject|default=[]: - mask_image: - # type=file|default=: - number_of_tissue_classes: '2' - # type=int|default=0: - likelihood_model: '"Gaussian"' - # type=str|default='': - save_posteriors: 'True' - # type=bool|default=False: - mrf_smoothing_factor: '0.2' - # type=float|default=0.0: - mrf_radius: '[1, 1, 1]' - # type=list|default=[]: - icm_use_synchronous_update: 'True' - # type=bool|default=False: - maximum_number_of_icm_terations: '1' - # type=int|default=0: - n_iterations: '5' - # type=int|default=0: - convergence_threshold: '0.000001' - # type=float|default=0.0: - posterior_formulation: '"Socrates"' - # type=str|default='': - use_mixture_model_proportions: 'True' - # type=bool|default=False: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - initialization: '"KMeans"' - # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: - kmeans_init_centers: '[100, 200]' - # type=list|default=[]: - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) - intensity_images: - # type=inputmultiobject|default=[]: - mask_image: - # type=file|default=: - number_of_tissue_classes: '2' - # type=int|default=0: - likelihood_model: '"Gaussian"' - # type=str|default='': - save_posteriors: 'True' - # type=bool|default=False: - mrf_smoothing_factor: '0.2' - # type=float|default=0.0: - mrf_radius: '[1, 1, 1]' - # type=list|default=[]: - icm_use_synchronous_update: 'True' - # type=bool|default=False: - maximum_number_of_icm_terations: '1' - # type=int|default=0: - n_iterations: '5' - # type=int|default=0: - convergence_threshold: '0.000001' - # type=float|default=0.0: - posterior_formulation: '"Socrates"' - # type=str|default='': - use_mixture_model_proportions: 'True' - # type=bool|default=False: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - initialization: '"PriorProbabilityImages"' - # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: - prior_image: '"BrainSegmentationPrior%02d.nii.gz"' - # type=traitcompound|default=None: either a string pattern (e.g., 'prior%02d.nii') or an existing vector-image file. - prior_weighting: '0.8' - # type=float|default=0.0: - prior_probability_threshold: '0.0000001' - # type=float|default=0.0: - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) - intensity_images: - # type=inputmultiobject|default=[]: - mask_image: - # type=file|default=: - number_of_tissue_classes: '2' - # type=int|default=0: - likelihood_model: '"Gaussian"' - # type=str|default='': - save_posteriors: 'True' - # type=bool|default=False: - mrf_smoothing_factor: '0.2' - # type=float|default=0.0: - mrf_radius: '[1, 1, 1]' - # type=list|default=[]: - icm_use_synchronous_update: 'True' - # type=bool|default=False: - maximum_number_of_icm_terations: '1' - # type=int|default=0: - n_iterations: '5' - # type=int|default=0: - convergence_threshold: '0.000001' - # type=float|default=0.0: - posterior_formulation: '"Socrates"' - # type=str|default='': - use_mixture_model_proportions: 'True' - # type=bool|default=False: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - initialization: '"PriorLabelImage"' - # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: - prior_image: '"segmentation0.nii.gz"' - # type=traitcompound|default=None: either a string pattern (e.g., 'prior%02d.nii') or an existing vector-image file. - number_of_tissue_classes: '2' - # type=int|default=0: - prior_weighting: '0.8' - # type=float|default=0.0: - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) - intensity_images: - # type=inputmultiobject|default=[]: - mask_image: - # type=file|default=: - likelihood_model: '"Gaussian"' - # type=str|default='': - save_posteriors: 'True' - # type=bool|default=False: - mrf_smoothing_factor: '0.2' - # type=float|default=0.0: - mrf_radius: '[1, 1, 1]' - # type=list|default=[]: - icm_use_synchronous_update: 'True' - # type=bool|default=False: - maximum_number_of_icm_terations: '1' - # type=int|default=0: - n_iterations: '5' - # type=int|default=0: - convergence_threshold: '0.000001' - # type=float|default=0.0: - posterior_formulation: '"Socrates"' - # type=str|default='': - use_mixture_model_proportions: 'True' - # type=bool|default=False: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: Atropos --image-dimensionality 3 --icm [1,1] --initialization Random[2] --intensity-image structural.nii --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] --use-random-seed 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - initialization: '"Random"' - # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) - intensity_images: '"structural.nii"' - # type=inputmultiobject|default=[]: - mask_image: '"mask.nii"' - # type=file|default=: - number_of_tissue_classes: '2' - # type=int|default=0: - likelihood_model: '"Gaussian"' - # type=str|default='': - save_posteriors: 'True' - # type=bool|default=False: - mrf_smoothing_factor: '0.2' - # type=float|default=0.0: - mrf_radius: '[1, 1, 1]' - # type=list|default=[]: - icm_use_synchronous_update: 'True' - # type=bool|default=False: - maximum_number_of_icm_terations: '1' - # type=int|default=0: - n_iterations: '5' - # type=int|default=0: - convergence_threshold: '0.000001' - # type=float|default=0.0: - posterior_formulation: '"Socrates"' - # type=str|default='': - use_mixture_model_proportions: 'True' - # type=bool|default=False: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: Atropos --image-dimensionality 3 --icm [1,1] --initialization KMeans[2,100,200] --intensity-image structural.nii --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] --use-random-seed 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - initialization: '"KMeans"' - # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: - kmeans_init_centers: '[100, 200]' - # type=list|default=[]: - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) - intensity_images: '"structural.nii"' - # type=inputmultiobject|default=[]: - mask_image: '"mask.nii"' - # type=file|default=: - number_of_tissue_classes: '2' - # type=int|default=0: - likelihood_model: '"Gaussian"' - # type=str|default='': - save_posteriors: 'True' - # type=bool|default=False: - mrf_smoothing_factor: '0.2' - # type=float|default=0.0: - mrf_radius: '[1, 1, 1]' - # type=list|default=[]: - icm_use_synchronous_update: 'True' - # type=bool|default=False: - maximum_number_of_icm_terations: '1' - # type=int|default=0: - n_iterations: '5' - # type=int|default=0: - convergence_threshold: '0.000001' - # type=float|default=0.0: - posterior_formulation: '"Socrates"' - # type=str|default='': - use_mixture_model_proportions: 'True' - # type=bool|default=False: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: Atropos --image-dimensionality 3 --icm [1,1] --initialization PriorProbabilityImages[2,BrainSegmentationPrior%02d.nii.gz,0.8,1e-07] --intensity-image structural.nii --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] --use-random-seed 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - initialization: '"PriorProbabilityImages"' - # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: - prior_image: '"BrainSegmentationPrior%02d.nii.gz"' - # type=traitcompound|default=None: either a string pattern (e.g., 'prior%02d.nii') or an existing vector-image file. - prior_weighting: '0.8' - # type=float|default=0.0: - prior_probability_threshold: '0.0000001' - # type=float|default=0.0: - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) - intensity_images: '"structural.nii"' - # type=inputmultiobject|default=[]: - mask_image: '"mask.nii"' - # type=file|default=: - number_of_tissue_classes: '2' - # type=int|default=0: - likelihood_model: '"Gaussian"' - # type=str|default='': - save_posteriors: 'True' - # type=bool|default=False: - mrf_smoothing_factor: '0.2' - # type=float|default=0.0: - mrf_radius: '[1, 1, 1]' - # type=list|default=[]: - icm_use_synchronous_update: 'True' - # type=bool|default=False: - maximum_number_of_icm_terations: '1' - # type=int|default=0: - n_iterations: '5' - # type=int|default=0: - convergence_threshold: '0.000001' - # type=float|default=0.0: - posterior_formulation: '"Socrates"' - # type=str|default='': - use_mixture_model_proportions: 'True' - # type=bool|default=False: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: Atropos --image-dimensionality 3 --icm [1,1] --initialization PriorLabelImage[2,segmentation0.nii.gz,0.8] --intensity-image structural.nii --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] --use-random-seed 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - initialization: '"PriorLabelImage"' - # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: - prior_image: '"segmentation0.nii.gz"' - # type=traitcompound|default=None: either a string pattern (e.g., 'prior%02d.nii') or an existing vector-image file. - number_of_tissue_classes: '2' - # type=int|default=0: - prior_weighting: '0.8' - # type=float|default=0.0: - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) - intensity_images: '"structural.nii"' - # type=inputmultiobject|default=[]: - mask_image: '"mask.nii"' - # type=file|default=: - likelihood_model: '"Gaussian"' - # type=str|default='': - save_posteriors: 'True' - # type=bool|default=False: - mrf_smoothing_factor: '0.2' - # type=float|default=0.0: - mrf_radius: '[1, 1, 1]' - # type=list|default=[]: - icm_use_synchronous_update: 'True' - # type=bool|default=False: - maximum_number_of_icm_terations: '1' - # type=int|default=0: - n_iterations: '5' - # type=int|default=0: - convergence_threshold: '0.000001' - # type=float|default=0.0: - posterior_formulation: '"Socrates"' - # type=str|default='': - use_mixture_model_proportions: 'True' - # type=bool|default=False: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/average_images.yaml b/nipype-auto-conv/specs/average_images.yaml deleted file mode 100644 index 58f077a..0000000 --- a/nipype-auto-conv/specs/average_images.yaml +++ /dev/null @@ -1,146 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.utils.AverageImages' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Examples -# -------- -# >>> from nipype.interfaces.ants import AverageImages -# >>> avg = AverageImages() -# >>> avg.inputs.dimension = 3 -# >>> avg.inputs.output_average_image = "average.nii.gz" -# >>> avg.inputs.normalize = True -# >>> avg.inputs.images = ['rc1s1.nii', 'rc1s1.nii'] -# >>> avg.cmdline -# 'AverageImages 3 average.nii.gz 1 rc1s1.nii rc1s1.nii' -# -task_name: AverageImages -nipype_name: AverageImages -nipype_module: nipype.interfaces.ants.utils -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - images: medimage/nifti1+list-of - # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregistered functional) - output_average_image: Path - # type=file: average image file - # type=file|default='average.nii': the name of the resulting image. - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_average_image: medimage/nifti-gz - # type=file: average image file - # type=file|default='average.nii': the name of the resulting image. - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - output_average_image: - # type=file: average image file - # type=file|default='average.nii': the name of the resulting image. - normalize: - # type=bool|default=False: Normalize: if true, the 2nd image is divided by its mean. This will select the largest image to average into. - images: - # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregistered functional) - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - output_average_image: '"average.nii.gz"' - # type=file: average image file - # type=file|default='average.nii': the name of the resulting image. - normalize: 'True' - # type=bool|default=False: Normalize: if true, the 2nd image is divided by its mean. This will select the largest image to average into. - images: - # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregistered functional) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: AverageImages 3 average.nii.gz 1 rc1s1.nii rc1s1.nii - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - output_average_image: '"average.nii.gz"' - # type=file: average image file - # type=file|default='average.nii': the name of the resulting image. - normalize: 'True' - # type=bool|default=False: Normalize: if true, the 2nd image is divided by its mean. This will select the largest image to average into. - images: '["rc1s1.nii", "rc1s1.nii"]' - # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregistered functional) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/brain_extraction.yaml b/nipype-auto-conv/specs/brain_extraction.yaml deleted file mode 100644 index 48d94c0..0000000 --- a/nipype-auto-conv/specs/brain_extraction.yaml +++ /dev/null @@ -1,197 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.segmentation.BrainExtraction' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Atlas-based brain extraction. -# -# Examples -# -------- -# >>> from nipype.interfaces.ants.segmentation import BrainExtraction -# >>> brainextraction = BrainExtraction() -# >>> brainextraction.inputs.dimension = 3 -# >>> brainextraction.inputs.anatomical_image ='T1.nii.gz' -# >>> brainextraction.inputs.brain_template = 'study_template.nii.gz' -# >>> brainextraction.inputs.brain_probability_mask ='ProbabilityMaskOfStudyTemplate.nii.gz' -# >>> brainextraction.cmdline -# 'antsBrainExtraction.sh -a T1.nii.gz -m ProbabilityMaskOfStudyTemplate.nii.gz -# -e study_template.nii.gz -d 3 -s nii.gz -o highres001_' -# -# -task_name: BrainExtraction -nipype_name: BrainExtraction -nipype_module: nipype.interfaces.ants.segmentation -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - anatomical_image: medimage/nifti-gz - # type=file|default=: Structural image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. - brain_probability_mask: medimage/nifti-gz - # type=file|default=: Brain probability mask created using e.g. LPBA40 data set which have brain masks defined, and warped to anatomical template and averaged resulting in a probability image. - brain_template: medimage/nifti-gz - # type=file|default=: Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. - extraction_registration_mask: generic/file - # type=file|default=: Mask (defined in the template space) used during registration for brain extraction. To limit the metric computation to a specific region. - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - BrainExtractionBrain: generic/file - # type=file: brain extraction image - BrainExtractionCSF: generic/file - # type=file: segmentation mask with only CSF - BrainExtractionGM: generic/file - # type=file: segmentation mask with only grey matter - BrainExtractionInitialAffine: generic/file - # type=file: - BrainExtractionInitialAffineFixed: generic/file - # type=file: - BrainExtractionInitialAffineMoving: generic/file - # type=file: - BrainExtractionLaplacian: generic/file - # type=file: - BrainExtractionMask: generic/file - # type=file: brain extraction mask - BrainExtractionPrior0GenericAffine: generic/file - # type=file: - BrainExtractionPrior1InverseWarp: generic/file - # type=file: - BrainExtractionPrior1Warp: generic/file - # type=file: - BrainExtractionPriorWarped: generic/file - # type=file: - BrainExtractionSegmentation: generic/file - # type=file: segmentation mask with CSF, GM, and WM - BrainExtractionTemplateLaplacian: generic/file - # type=file: - BrainExtractionTmp: generic/file - # type=file: - BrainExtractionWM: generic/file - # type=file: segmenration mask with only white matter - N4Corrected0: generic/file - # type=file: N4 bias field corrected image - N4Truncated0: generic/file - # type=file: - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - anatomical_image: - # type=file|default=: Structural image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. - brain_template: - # type=file|default=: Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. - brain_probability_mask: - # type=file|default=: Brain probability mask created using e.g. LPBA40 data set which have brain masks defined, and warped to anatomical template and averaged resulting in a probability image. - out_prefix: - # type=str|default='highres001_': Prefix that is prepended to all output files - extraction_registration_mask: - # type=file|default=: Mask (defined in the template space) used during registration for brain extraction. To limit the metric computation to a specific region. - image_suffix: - # type=str|default='nii.gz': any of standard ITK formats, nii.gz is default - use_random_seeding: - # type=enum|default=0|allowed[0,1]: Use random number generated from system clock in Atropos (default = 1) - keep_temporary_files: - # type=int|default=0: Keep brain extraction/segmentation warps, etc (default = 0). - use_floatingpoint_precision: - # type=enum|default=0|allowed[0,1]: Use floating point precision in registrations (default = 0) - debug: - # type=bool|default=False: If > 0, runs a faster version of the script. Only for testing. Implies -u 0. Requires single thread computation for complete reproducibility. - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - anatomical_image: - # type=file|default=: Structural image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. - brain_template: - # type=file|default=: Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. - brain_probability_mask: - # type=file|default=: Brain probability mask created using e.g. LPBA40 data set which have brain masks defined, and warped to anatomical template and averaged resulting in a probability image. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: antsBrainExtraction.sh -a T1.nii.gz -m ProbabilityMaskOfStudyTemplate.nii.gz -e study_template.nii.gz -d 3 -s nii.gz -o highres001_ - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - anatomical_image: '"T1.nii.gz"' - # type=file|default=: Structural image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. - brain_template: '"study_template.nii.gz"' - # type=file|default=: Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. - brain_probability_mask: '"ProbabilityMaskOfStudyTemplate.nii.gz"' - # type=file|default=: Brain probability mask created using e.g. LPBA40 data set which have brain masks defined, and warped to anatomical template and averaged resulting in a probability image. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/classes/nipype.interfaces.ants.base.Info.yaml b/nipype-auto-conv/specs/classes/nipype.interfaces.ants.base.Info.yaml new file mode 100644 index 0000000..0979499 --- /dev/null +++ b/nipype-auto-conv/specs/classes/nipype.interfaces.ants.base.Info.yaml @@ -0,0 +1,11 @@ +# name of the converted workflow constructor function +name: Info +# name of the nipype workflow constructor +nipype_name: Info +# name of the nipype module the function is found within, e.g. mriqc.workflows.anatomical.base +nipype_module: nipype.interfaces.ants.base +# the names of the nested interfaces that are defined in other modules and need to be imported +external_nested_interfaces: null +# a list of tuples where the first element is a regular expression to find in the code and the second +# element is the replacement string +find_replace: null diff --git a/nipype-auto-conv/specs/classes/nipype.interfaces.base.core.PackageInfo.yaml b/nipype-auto-conv/specs/classes/nipype.interfaces.base.core.PackageInfo.yaml new file mode 100644 index 0000000..818a558 --- /dev/null +++ b/nipype-auto-conv/specs/classes/nipype.interfaces.base.core.PackageInfo.yaml @@ -0,0 +1,20 @@ +# name of the converted workflow constructor function +name: PackageInfo +# name of the nipype workflow constructor +nipype_name: PackageInfo +# name of the nipype module the function is found within, e.g. mriqc.workflows.anatomical.base +nipype_module: nipype.interfaces.base.core +# the names of the nested interfaces that are defined in other modules and need to be imported +external_nested_interfaces: null +# a list of tuples where the first element is a regular expression to find in the code and the second +# element is the replacement string +find_replace: + - ["import logging", "import logging\\nimport subprocess as sp"] + - [ + "\\n(\\s+)clout = CommandLine\\(\\s*command=([^,]+).+?\\).run\\(\\)", + "\\n\\1raw_info = sp.check_output(\\2, shell=True).decode('utf-8')", + ] + - ["raw_info = clout\\.runtime\\.stdout", ""] +imports: + - module: subprocess + alias: sp diff --git a/nipype-auto-conv/specs/compose_multi_transform.yaml b/nipype-auto-conv/specs/compose_multi_transform.yaml deleted file mode 100644 index 5f20948..0000000 --- a/nipype-auto-conv/specs/compose_multi_transform.yaml +++ /dev/null @@ -1,140 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.utils.ComposeMultiTransform' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Take a set of transformations and convert them to a single transformation matrix/warpfield. -# -# Examples -# -------- -# >>> from nipype.interfaces.ants import ComposeMultiTransform -# >>> compose_transform = ComposeMultiTransform() -# >>> compose_transform.inputs.dimension = 3 -# >>> compose_transform.inputs.transforms = ['struct_to_template.mat', 'func_to_struct.mat'] -# >>> compose_transform.cmdline -# 'ComposeMultiTransform 3 struct_to_template_composed.mat -# struct_to_template.mat func_to_struct.mat' -# -# -task_name: ComposeMultiTransform -nipype_name: ComposeMultiTransform -nipype_module: nipype.interfaces.ants.utils -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_transform: Path - # type=file: Composed transform file - # type=file|default=: the name of the resulting transform. - reference_image: generic/file - # type=file|default=: Reference image (only necessary when output is warpfield) - transforms: datascience/text-matrix+list-of - # type=inputmultiobject|default=[]: transforms to average - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_transform: generic/file - # type=file: Composed transform file - # type=file|default=: the name of the resulting transform. - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - output_transform: - # type=file: Composed transform file - # type=file|default=: the name of the resulting transform. - reference_image: - # type=file|default=: Reference image (only necessary when output is warpfield) - transforms: - # type=inputmultiobject|default=[]: transforms to average - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - transforms: - # type=inputmultiobject|default=[]: transforms to average - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: ComposeMultiTransform 3 struct_to_template_composed.mat struct_to_template.mat func_to_struct.mat - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - transforms: '["struct_to_template.mat", "func_to_struct.mat"]' - # type=inputmultiobject|default=[]: transforms to average - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/convert_scalar_image_to_rgb.yaml b/nipype-auto-conv/specs/convert_scalar_image_to_rgb.yaml deleted file mode 100644 index 9676fe6..0000000 --- a/nipype-auto-conv/specs/convert_scalar_image_to_rgb.yaml +++ /dev/null @@ -1,161 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.visualization.ConvertScalarImageToRGB' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Convert scalar images to RGB. -# -# Examples -# -------- -# >>> from nipype.interfaces.ants.visualization import ConvertScalarImageToRGB -# >>> converter = ConvertScalarImageToRGB() -# >>> converter.inputs.dimension = 3 -# >>> converter.inputs.input_image = 'T1.nii.gz' -# >>> converter.inputs.colormap = 'jet' -# >>> converter.inputs.minimum_input = 0 -# >>> converter.inputs.maximum_input = 6 -# >>> converter.cmdline -# 'ConvertScalarImageToRGB 3 T1.nii.gz rgb.nii.gz none jet none 0 6 0 255' -# -# -task_name: ConvertScalarImageToRGB -nipype_name: ConvertScalarImageToRGB -nipype_module: nipype.interfaces.ants.visualization -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - input_image: medimage/nifti-gz - # type=file|default=: Main input is a 3-D grayscale image. - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_image: generic/file - # type=file: converted RGB image - # type=str|default='rgb.nii.gz': rgb output image - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - input_image: - # type=file|default=: Main input is a 3-D grayscale image. - output_image: - # type=file: converted RGB image - # type=str|default='rgb.nii.gz': rgb output image - mask_image: - # type=traitcompound|default='none': mask image - colormap: - # type=enum|default='grey'|allowed['autumn','blue','cool','copper','custom','green','grey','hot','hsv','jet','overunder','red','spring','summer','winter']: Select a colormap - custom_color_map_file: - # type=str|default='none': custom color map file - minimum_input: - # type=int|default=0: minimum input - maximum_input: - # type=int|default=0: maximum input - minimum_RGB_output: - # type=int|default=0: - maximum_RGB_output: - # type=int|default=255: - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - input_image: - # type=file|default=: Main input is a 3-D grayscale image. - colormap: '"jet"' - # type=enum|default='grey'|allowed['autumn','blue','cool','copper','custom','green','grey','hot','hsv','jet','overunder','red','spring','summer','winter']: Select a colormap - minimum_input: '0' - # type=int|default=0: minimum input - maximum_input: '6' - # type=int|default=0: maximum input - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: ConvertScalarImageToRGB 3 T1.nii.gz rgb.nii.gz none jet none 0 6 0 255 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - input_image: '"T1.nii.gz"' - # type=file|default=: Main input is a 3-D grayscale image. - colormap: '"jet"' - # type=enum|default='grey'|allowed['autumn','blue','cool','copper','custom','green','grey','hot','hsv','jet','overunder','red','spring','summer','winter']: Select a colormap - minimum_input: '0' - # type=int|default=0: minimum input - maximum_input: '6' - # type=int|default=0: maximum input - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/cortical_thickness.yaml b/nipype-auto-conv/specs/cortical_thickness.yaml deleted file mode 100644 index 71761ea..0000000 --- a/nipype-auto-conv/specs/cortical_thickness.yaml +++ /dev/null @@ -1,225 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.segmentation.CorticalThickness' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Examples -# -------- -# >>> from nipype.interfaces.ants.segmentation import CorticalThickness -# >>> corticalthickness = CorticalThickness() -# >>> corticalthickness.inputs.dimension = 3 -# >>> corticalthickness.inputs.anatomical_image ='T1.nii.gz' -# >>> corticalthickness.inputs.brain_template = 'study_template.nii.gz' -# >>> corticalthickness.inputs.brain_probability_mask ='ProbabilityMaskOfStudyTemplate.nii.gz' -# >>> corticalthickness.inputs.segmentation_priors = ['BrainSegmentationPrior01.nii.gz', -# ... 'BrainSegmentationPrior02.nii.gz', -# ... 'BrainSegmentationPrior03.nii.gz', -# ... 'BrainSegmentationPrior04.nii.gz'] -# >>> corticalthickness.inputs.t1_registration_template = 'brain_study_template.nii.gz' -# >>> corticalthickness.cmdline -# 'antsCorticalThickness.sh -a T1.nii.gz -m ProbabilityMaskOfStudyTemplate.nii.gz -# -e study_template.nii.gz -d 3 -s nii.gz -o antsCT_ -# -p nipype_priors/BrainSegmentationPrior%02d.nii.gz -t brain_study_template.nii.gz' -# -# -task_name: CorticalThickness -nipype_name: CorticalThickness -nipype_module: nipype.interfaces.ants.segmentation -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - anatomical_image: medimage/nifti-gz - # type=file|default=: Structural *intensity* image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. - brain_probability_mask: medimage/nifti-gz - # type=file|default=: brain probability mask in template space - brain_template: medimage/nifti-gz - # type=file|default=: Anatomical *intensity* template (possibly created using a population data set with buildtemplateparallel.sh in ANTs). This template is *not* skull-stripped. - cortical_label_image: generic/file - # type=file|default=: Cortical ROI labels to use as a prior for ATITH. - extraction_registration_mask: generic/file - # type=file|default=: Mask (defined in the template space) used during registration for brain extraction. - segmentation_priors: medimage/nifti-gz+list-of - # type=inputmultiobject|default=[]: - t1_registration_template: medimage/nifti-gz - # type=file|default=: Anatomical *intensity* template (assumed to be skull-stripped). A common case would be where this would be the same template as specified in the -e option which is not skull stripped. - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - BrainExtractionMask: generic/file - # type=file: brain extraction mask - BrainSegmentation: generic/file - # type=file: brain segmentation image - BrainSegmentationN4: generic/file - # type=file: N4 corrected image - BrainSegmentationPosteriors: generic/file+list-of - # type=outputmultiobject: Posterior probability images - BrainVolumes: generic/file - # type=file: Brain volumes as text - CorticalThickness: generic/file - # type=file: cortical thickness file - CorticalThicknessNormedToTemplate: generic/file - # type=file: Normalized cortical thickness - ExtractedBrainN4: generic/file - # type=file: extracted brain from N4 image - SubjectToTemplate0GenericAffine: generic/file - # type=file: Template to subject inverse affine - SubjectToTemplate1Warp: generic/file - # type=file: Template to subject inverse warp - SubjectToTemplateLogJacobian: generic/file - # type=file: Template to subject log jacobian - TemplateToSubject0Warp: generic/file - # type=file: Template to subject warp - TemplateToSubject1GenericAffine: generic/file - # type=file: Template to subject affine - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - anatomical_image: - # type=file|default=: Structural *intensity* image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. - brain_template: - # type=file|default=: Anatomical *intensity* template (possibly created using a population data set with buildtemplateparallel.sh in ANTs). This template is *not* skull-stripped. - brain_probability_mask: - # type=file|default=: brain probability mask in template space - segmentation_priors: - # type=inputmultiobject|default=[]: - out_prefix: - # type=str|default='antsCT_': Prefix that is prepended to all output files - image_suffix: - # type=str|default='nii.gz': any of standard ITK formats, nii.gz is default - t1_registration_template: - # type=file|default=: Anatomical *intensity* template (assumed to be skull-stripped). A common case would be where this would be the same template as specified in the -e option which is not skull stripped. - extraction_registration_mask: - # type=file|default=: Mask (defined in the template space) used during registration for brain extraction. - keep_temporary_files: - # type=int|default=0: Keep brain extraction/segmentation warps, etc (default = 0). - max_iterations: - # type=int|default=0: ANTS registration max iterations (default = 100x100x70x20) - prior_segmentation_weight: - # type=float|default=0.0: Atropos spatial prior *probability* weight for the segmentation - segmentation_iterations: - # type=int|default=0: N4 -> Atropos -> N4 iterations during segmentation (default = 3) - posterior_formulation: - # type=str|default='': Atropos posterior formulation and whether or not to use mixture model proportions. e.g 'Socrates[1]' (default) or 'Aristotle[1]'. Choose the latter if you want use the distance priors (see also the -l option for label propagation control). - use_floatingpoint_precision: - # type=enum|default=0|allowed[0,1]: Use floating point precision in registrations (default = 0) - use_random_seeding: - # type=enum|default=0|allowed[0,1]: Use random number generated from system clock in Atropos (default = 1) - b_spline_smoothing: - # type=bool|default=False: Use B-spline SyN for registrations and B-spline exponential mapping in DiReCT. - cortical_label_image: - # type=file|default=: Cortical ROI labels to use as a prior for ATITH. - label_propagation: - # type=str|default='': Incorporate a distance prior one the posterior formulation. Should be of the form 'label[lambda,boundaryProbability]' where label is a value of 1,2,3,... denoting label ID. The label probability for anything outside the current label = boundaryProbability * exp( -lambda * distanceFromBoundary ) Intuitively, smaller lambda values will increase the spatial capture range of the distance prior. To apply to all label values, simply omit specifying the label, i.e. -l [lambda,boundaryProbability]. - quick_registration: - # type=bool|default=False: If = 1, use antsRegistrationSyNQuick.sh as the basis for registration during brain extraction, brain segmentation, and (optional) normalization to a template. Otherwise use antsRegistrationSyN.sh (default = 0). - debug: - # type=bool|default=False: If > 0, runs a faster version of the script. Only for testing. Implies -u 0. Requires single thread computation for complete reproducibility. - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - anatomical_image: - # type=file|default=: Structural *intensity* image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. - brain_template: - # type=file|default=: Anatomical *intensity* template (possibly created using a population data set with buildtemplateparallel.sh in ANTs). This template is *not* skull-stripped. - brain_probability_mask: - # type=file|default=: brain probability mask in template space - segmentation_priors: - # type=inputmultiobject|default=[]: - t1_registration_template: - # type=file|default=: Anatomical *intensity* template (assumed to be skull-stripped). A common case would be where this would be the same template as specified in the -e option which is not skull stripped. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: antsCorticalThickness.sh -a T1.nii.gz -m ProbabilityMaskOfStudyTemplate.nii.gz -e study_template.nii.gz -d 3 -s nii.gz -o antsCT_ -p nipype_priors/BrainSegmentationPrior%02d.nii.gz -t brain_study_template.nii.gz - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - anatomical_image: '"T1.nii.gz"' - # type=file|default=: Structural *intensity* image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. - brain_template: '"study_template.nii.gz"' - # type=file|default=: Anatomical *intensity* template (possibly created using a population data set with buildtemplateparallel.sh in ANTs). This template is *not* skull-stripped. - brain_probability_mask: '"ProbabilityMaskOfStudyTemplate.nii.gz"' - # type=file|default=: brain probability mask in template space - segmentation_priors: '["BrainSegmentationPrior01.nii.gz","BrainSegmentationPrior02.nii.gz","BrainSegmentationPrior03.nii.gz","BrainSegmentationPrior04.nii.gz"]' - # type=inputmultiobject|default=[]: - t1_registration_template: '"brain_study_template.nii.gz"' - # type=file|default=: Anatomical *intensity* template (assumed to be skull-stripped). A common case would be where this would be the same template as specified in the -e option which is not skull stripped. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/create_jacobian_determinant_image.yaml b/nipype-auto-conv/specs/create_jacobian_determinant_image.yaml deleted file mode 100644 index 8dc42b0..0000000 --- a/nipype-auto-conv/specs/create_jacobian_determinant_image.yaml +++ /dev/null @@ -1,138 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.utils.CreateJacobianDeterminantImage' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Examples -# -------- -# >>> from nipype.interfaces.ants import CreateJacobianDeterminantImage -# >>> jacobian = CreateJacobianDeterminantImage() -# >>> jacobian.inputs.imageDimension = 3 -# >>> jacobian.inputs.deformationField = 'ants_Warp.nii.gz' -# >>> jacobian.inputs.outputImage = 'out_name.nii.gz' -# >>> jacobian.cmdline -# 'CreateJacobianDeterminantImage 3 ants_Warp.nii.gz out_name.nii.gz' -# -task_name: CreateJacobianDeterminantImage -nipype_name: CreateJacobianDeterminantImage -nipype_module: nipype.interfaces.ants.utils -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - deformationField: medimage/nifti-gz - # type=file|default=: deformation transformation file - outputImage: medimage/nifti-gz - # type=file|default=: output filename - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - jacobian_image: generic/file - # type=file: jacobian image - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - imageDimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - deformationField: - # type=file|default=: deformation transformation file - outputImage: - # type=file|default=: output filename - doLogJacobian: - # type=enum|default=0|allowed[0,1]: return the log jacobian - useGeometric: - # type=enum|default=0|allowed[0,1]: return the geometric jacobian - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - imageDimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - deformationField: - # type=file|default=: deformation transformation file - outputImage: - # type=file|default=: output filename - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: CreateJacobianDeterminantImage 3 ants_Warp.nii.gz out_name.nii.gz - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - imageDimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - deformationField: '"ants_Warp.nii.gz"' - # type=file|default=: deformation transformation file - outputImage: '"out_name.nii.gz"' - # type=file|default=: output filename - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/create_tiled_mosaic.yaml b/nipype-auto-conv/specs/create_tiled_mosaic.yaml deleted file mode 100644 index e5452ee..0000000 --- a/nipype-auto-conv/specs/create_tiled_mosaic.yaml +++ /dev/null @@ -1,186 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.visualization.CreateTiledMosaic' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# The program CreateTiledMosaic in conjunction with ConvertScalarImageToRGB -# provides useful functionality for common image analysis tasks. The basic -# usage of CreateTiledMosaic is to tile a 3-D image volume slice-wise into -# a 2-D image. -# -# Examples -# -------- -# -# >>> from nipype.interfaces.ants.visualization import CreateTiledMosaic -# >>> mosaic_slicer = CreateTiledMosaic() -# >>> mosaic_slicer.inputs.input_image = 'T1.nii.gz' -# >>> mosaic_slicer.inputs.rgb_image = 'rgb.nii.gz' -# >>> mosaic_slicer.inputs.mask_image = 'mask.nii.gz' -# >>> mosaic_slicer.inputs.output_image = 'output.png' -# >>> mosaic_slicer.inputs.alpha_value = 0.5 -# >>> mosaic_slicer.inputs.direction = 2 -# >>> mosaic_slicer.inputs.pad_or_crop = '[ -15x -50 , -15x -30 ,0]' -# >>> mosaic_slicer.inputs.slices = '[2 ,100 ,160]' -# >>> mosaic_slicer.cmdline -# 'CreateTiledMosaic -a 0.50 -d 2 -i T1.nii.gz -x mask.nii.gz -o output.png -p [ -15x -50 , -15x -30 ,0] -r rgb.nii.gz -s [2 ,100 ,160]' -# -task_name: CreateTiledMosaic -nipype_name: CreateTiledMosaic -nipype_module: nipype.interfaces.ants.visualization -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - input_image: medimage/nifti-gz - # type=file|default=: Main input is a 3-D grayscale image. - mask_image: medimage/nifti-gz - # type=file|default=: Specifies the ROI of the RGB voxels used. - rgb_image: medimage/nifti-gz - # type=file|default=: An optional Rgb image can be added as an overlay.It must have the same imagegeometry as the input grayscale image. - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_image: image/png - # type=file: image file - # type=str|default='output.png': The output consists of the tiled mosaic image. - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: Main input is a 3-D grayscale image. - rgb_image: - # type=file|default=: An optional Rgb image can be added as an overlay.It must have the same imagegeometry as the input grayscale image. - mask_image: - # type=file|default=: Specifies the ROI of the RGB voxels used. - alpha_value: - # type=float|default=0.0: If an Rgb image is provided, render the overlay using the specified alpha parameter. - output_image: - # type=file: image file - # type=str|default='output.png': The output consists of the tiled mosaic image. - tile_geometry: - # type=str|default='': The tile geometry specifies the number of rows and columnsin the output image. For example, if the user specifies "5x10", then 5 rows by 10 columns of slices are rendered. If R < 0 and C > 0 (or vice versa), the negative value is selectedbased on direction. - direction: - # type=int|default=0: Specifies the direction of the slices. If no direction is specified, the direction with the coarsest spacing is chosen. - pad_or_crop: - # type=str|default='': argument passed to -p flag:[padVoxelWidth,][lowerPadding[0]xlowerPadding[1],upperPadding[0]xupperPadding[1],constantValue]The user can specify whether to pad or crop a specified voxel-width boundary of each individual slice. For this program, cropping is simply padding with negative voxel-widths.If one pads (+), the user can also specify a constant pad value (default = 0). If a mask is specified, the user can use the mask to define the region, by using the keyword "mask" plus an offset, e.g. "-p mask+3". - slices: - # type=str|default='': Number of slices to increment Slice1xSlice2xSlice3[numberOfSlicesToIncrement,,] - flip_slice: - # type=str|default='': flipXxflipY - permute_axes: - # type=bool|default=False: doPermute - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: Main input is a 3-D grayscale image. - rgb_image: - # type=file|default=: An optional Rgb image can be added as an overlay.It must have the same imagegeometry as the input grayscale image. - mask_image: - # type=file|default=: Specifies the ROI of the RGB voxels used. - output_image: '"output.png"' - # type=file: image file - # type=str|default='output.png': The output consists of the tiled mosaic image. - alpha_value: '0.5' - # type=float|default=0.0: If an Rgb image is provided, render the overlay using the specified alpha parameter. - direction: '2' - # type=int|default=0: Specifies the direction of the slices. If no direction is specified, the direction with the coarsest spacing is chosen. - pad_or_crop: '"[ -15x -50 , -15x -30 ,0]"' - # type=str|default='': argument passed to -p flag:[padVoxelWidth,][lowerPadding[0]xlowerPadding[1],upperPadding[0]xupperPadding[1],constantValue]The user can specify whether to pad or crop a specified voxel-width boundary of each individual slice. For this program, cropping is simply padding with negative voxel-widths.If one pads (+), the user can also specify a constant pad value (default = 0). If a mask is specified, the user can use the mask to define the region, by using the keyword "mask" plus an offset, e.g. "-p mask+3". - slices: '"[2 ,100 ,160]"' - # type=str|default='': Number of slices to increment Slice1xSlice2xSlice3[numberOfSlicesToIncrement,,] - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: CreateTiledMosaic -a 0.50 -d 2 -i T1.nii.gz -x mask.nii.gz -o output.png -p [ -15x -50 , -15x -30 ,0] -r rgb.nii.gz -s [2 ,100 ,160] - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"T1.nii.gz"' - # type=file|default=: Main input is a 3-D grayscale image. - rgb_image: '"rgb.nii.gz"' - # type=file|default=: An optional Rgb image can be added as an overlay.It must have the same imagegeometry as the input grayscale image. - mask_image: '"mask.nii.gz"' - # type=file|default=: Specifies the ROI of the RGB voxels used. - output_image: '"output.png"' - # type=file: image file - # type=str|default='output.png': The output consists of the tiled mosaic image. - alpha_value: '0.5' - # type=float|default=0.0: If an Rgb image is provided, render the overlay using the specified alpha parameter. - direction: '2' - # type=int|default=0: Specifies the direction of the slices. If no direction is specified, the direction with the coarsest spacing is chosen. - pad_or_crop: '"[ -15x -50 , -15x -30 ,0]"' - # type=str|default='': argument passed to -p flag:[padVoxelWidth,][lowerPadding[0]xlowerPadding[1],upperPadding[0]xupperPadding[1],constantValue]The user can specify whether to pad or crop a specified voxel-width boundary of each individual slice. For this program, cropping is simply padding with negative voxel-widths.If one pads (+), the user can also specify a constant pad value (default = 0). If a mask is specified, the user can use the mask to define the region, by using the keyword "mask" plus an offset, e.g. "-p mask+3". - slices: '"[2 ,100 ,160]"' - # type=str|default='': Number of slices to increment Slice1xSlice2xSlice3[numberOfSlicesToIncrement,,] - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/denoise_image.yaml b/nipype-auto-conv/specs/denoise_image.yaml deleted file mode 100644 index bc578fd..0000000 --- a/nipype-auto-conv/specs/denoise_image.yaml +++ /dev/null @@ -1,245 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.segmentation.DenoiseImage' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Examples -# -------- -# >>> import copy -# >>> from nipype.interfaces.ants import DenoiseImage -# >>> denoise = DenoiseImage() -# >>> denoise.inputs.dimension = 3 -# >>> denoise.inputs.input_image = 'im1.nii' -# >>> denoise.cmdline -# 'DenoiseImage -d 3 -i im1.nii -n Gaussian -o im1_noise_corrected.nii -s 1' -# -# >>> denoise_2 = copy.deepcopy(denoise) -# >>> denoise_2.inputs.output_image = 'output_corrected_image.nii.gz' -# >>> denoise_2.inputs.noise_model = 'Rician' -# >>> denoise_2.inputs.shrink_factor = 2 -# >>> denoise_2.cmdline -# 'DenoiseImage -d 3 -i im1.nii -n Rician -o output_corrected_image.nii.gz -s 2' -# -# >>> denoise_3 = DenoiseImage() -# >>> denoise_3.inputs.input_image = 'im1.nii' -# >>> denoise_3.inputs.save_noise = True -# >>> denoise_3.cmdline -# 'DenoiseImage -i im1.nii -n Gaussian -o [ im1_noise_corrected.nii, im1_noise.nii ] -s 1' -# -# -task_name: DenoiseImage -nipype_name: DenoiseImage -nipype_module: nipype.interfaces.ants.segmentation -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - input_image: medimage/nifti1 - # type=file|default=: A scalar image is expected as input for noise correction. - noise_image: Path - # type=file: - # type=file|default=: Filename for the estimated noise. - output_image: Path - # type=file: - # type=file|default=: The output consists of the noise corrected version of the input image. - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - noise_image: generic/file - # type=file: - # type=file|default=: Filename for the estimated noise. - output_image: medimage/nifti-gz - # type=file: - # type=file|default=: The output consists of the noise corrected version of the input image. - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, the program tries to infer the dimensionality from the input image. - input_image: - # type=file|default=: A scalar image is expected as input for noise correction. - noise_model: - # type=enum|default='Gaussian'|allowed['Gaussian','Rician']: Employ a Rician or Gaussian noise model. - shrink_factor: - # type=int|default=1: Running noise correction on large images can be time consuming. To lessen computation time, the input image can be resampled. The shrink factor, specified as a single integer, describes this resampling. Shrink factor = 1 is the default. - output_image: - # type=file: - # type=file|default=: The output consists of the noise corrected version of the input image. - save_noise: - # type=bool|default=False: True if the estimated noise should be saved to file. - noise_image: - # type=file: - # type=file|default=: Filename for the estimated noise. - verbose: - # type=bool|default=False: Verbose output. - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, the program tries to infer the dimensionality from the input image. - input_image: - # type=file|default=: A scalar image is expected as input for noise correction. - imports: &id001 - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - - module: copy - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - output_image: '"output_corrected_image.nii.gz"' - # type=file: - # type=file|default=: The output consists of the noise corrected version of the input image. - noise_model: '"Rician"' - # type=enum|default='Gaussian'|allowed['Gaussian','Rician']: Employ a Rician or Gaussian noise model. - shrink_factor: '2' - # type=int|default=1: Running noise correction on large images can be time consuming. To lessen computation time, the input image can be resampled. The shrink factor, specified as a single integer, describes this resampling. Shrink factor = 1 is the default. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: A scalar image is expected as input for noise correction. - save_noise: 'True' - # type=bool|default=False: True if the estimated noise should be saved to file. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: DenoiseImage -d 3 -i im1.nii -n Gaussian -o im1_noise_corrected.nii -s 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, the program tries to infer the dimensionality from the input image. - input_image: '"im1.nii"' - # type=file|default=: A scalar image is expected as input for noise correction. - imports: *id001 - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: DenoiseImage -d 3 -i im1.nii -n Rician -o output_corrected_image.nii.gz -s 2 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - output_image: '"output_corrected_image.nii.gz"' - # type=file: - # type=file|default=: The output consists of the noise corrected version of the input image. - noise_model: '"Rician"' - # type=enum|default='Gaussian'|allowed['Gaussian','Rician']: Employ a Rician or Gaussian noise model. - shrink_factor: '2' - # type=int|default=1: Running noise correction on large images can be time consuming. To lessen computation time, the input image can be resampled. The shrink factor, specified as a single integer, describes this resampling. Shrink factor = 1 is the default. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: DenoiseImage -i im1.nii -n Gaussian -o [ im1_noise_corrected.nii, im1_noise.nii ] -s 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"im1.nii"' - # type=file|default=: A scalar image is expected as input for noise correction. - save_noise: 'True' - # type=bool|default=False: True if the estimated noise should be saved to file. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/gen_warp_fields.yaml b/nipype-auto-conv/specs/gen_warp_fields.yaml deleted file mode 100644 index 9c15214..0000000 --- a/nipype-auto-conv/specs/gen_warp_fields.yaml +++ /dev/null @@ -1,107 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.legacy.GenWarpFields' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -task_name: GenWarpFields -nipype_name: GenWarpFields -nipype_module: nipype.interfaces.ants.legacy -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - input_image: generic/file - # type=file|default=: input image to warp to template - reference_image: generic/file - # type=file|default=: template file to warp to - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - affine_transformation: generic/file - # type=file: affine (prefix_Affine.txt) - input_file: generic/file - # type=file: input image (prefix_repaired.nii) - inverse_warp_field: generic/file - # type=file: inverse warp field (prefix_InverseWarp.nii) - output_file: generic/file - # type=file: output image (prefix_deformed.nii) - warp_field: generic/file - # type=file: warp field (prefix_Warp.nii) - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - reference_image: - # type=file|default=: template file to warp to - input_image: - # type=file|default=: input image to warp to template - force_proceed: - # type=bool|default=False: force script to proceed even if headers may be incompatible - inverse_warp_template_labels: - # type=bool|default=False: Applies inverse warp to the template labels to estimate label positions in target space (use for template-based segmentation) - max_iterations: - # type=list|default=[]: maximum number of iterations (must be list of integers in the form [J,K,L...]: J = coarsest resolution iterations, K = middle resolution iterations, L = fine resolution iterations - bias_field_correction: - # type=bool|default=False: Applies bias field correction to moving image - similarity_metric: - # type=enum|default='PR'|allowed['CC','MI','MSQ','PR']: Type of similartiy metric used for registration (CC = cross correlation, MI = mutual information, PR = probability mapping, MSQ = mean square difference) - transformation_model: - # type=enum|default='GR'|allowed['DD','EL','EX','GR','RA','RI','S2','SY']: Type of transofmration model used for registration (EL = elastic transformation model, SY = SyN with time, arbitrary number of time points, S2 = SyN with time optimized for 2 time points, GR = greedy SyN, EX = exponential, DD = diffeomorphic demons style exponential mapping, RI = purely rigid, RA = affine rigid - out_prefix: - # type=str|default='ants_': Prefix that is prepended to all output files (default = ants_) - quality_check: - # type=bool|default=False: Perform a quality check of the result - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: [] diff --git a/nipype-auto-conv/specs/image_math.yaml b/nipype-auto-conv/specs/image_math.yaml deleted file mode 100644 index eb9bac5..0000000 --- a/nipype-auto-conv/specs/image_math.yaml +++ /dev/null @@ -1,310 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.utils.ImageMath' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Operations over images. -# -# Examples -# -------- -# >>> ImageMath( -# ... op1='structural.nii', -# ... operation='+', -# ... op2='2').cmdline -# 'ImageMath 3 structural_maths.nii + structural.nii 2' -# -# >>> ImageMath( -# ... op1='structural.nii', -# ... operation='Project', -# ... op2='1 2').cmdline -# 'ImageMath 3 structural_maths.nii Project structural.nii 1 2' -# -# >>> ImageMath( -# ... op1='structural.nii', -# ... operation='G', -# ... op2='4').cmdline -# 'ImageMath 3 structural_maths.nii G structural.nii 4' -# -# >>> ImageMath( -# ... op1='structural.nii', -# ... operation='TruncateImageIntensity', -# ... op2='0.005 0.999 256').cmdline -# 'ImageMath 3 structural_maths.nii TruncateImageIntensity structural.nii 0.005 0.999 256' -# -# By default, Nipype copies headers from the first input image (``op1``) -# to the output image. -# For some operations, as the ``PadImage`` operation, the header cannot be copied from inputs to -# outputs, and so ``copy_header`` option is automatically set to ``False``. -# -# >>> pad = ImageMath( -# ... op1='structural.nii', -# ... operation='PadImage') -# >>> pad.inputs.copy_header -# False -# -# While the operation is set to ``PadImage``, -# setting ``copy_header = True`` will have no effect. -# -# >>> pad.inputs.copy_header = True -# >>> pad.inputs.copy_header -# False -# -# For any other operation, ``copy_header`` can be enabled/disabled normally: -# -# >>> pad.inputs.operation = "ME" -# >>> pad.inputs.copy_header = True -# >>> pad.inputs.copy_header -# True -# -# -task_name: ImageMath -nipype_name: ImageMath -nipype_module: nipype.interfaces.ants.utils -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - op1: medimage/nifti1 - # type=file|default=: first operator - output_image: Path - # type=file: output image file - # type=file|default=: output image file - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_image: generic/file - # type=file: output image file - # type=file|default=: output image file - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=int|default=3: dimension of output image - output_image: - # type=file: output image file - # type=file|default=: output image file - operation: - # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations - op1: - # type=file|default=: first operator - op2: - # type=traitcompound|default=None: second operator - args: - # type=str|default='': Additional parameters to the command - copy_header: - # type=bool|default=True: copy headers of the original image into the output (corrected) file - num_threads: - # type=int|default=1: Number of ITK threads to use - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - op1: - # type=file|default=: first operator - operation: '"+"' - # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations - op2: '"2"' - # type=traitcompound|default=None: second operator - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - op1: - # type=file|default=: first operator - operation: '"Project"' - # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations - op2: '"1 2"' - # type=traitcompound|default=None: second operator - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - op1: - # type=file|default=: first operator - operation: '"G"' - # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations - op2: '"4"' - # type=traitcompound|default=None: second operator - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - op1: - # type=file|default=: first operator - operation: '"TruncateImageIntensity"' - # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations - op2: '"0.005 0.999 256"' - # type=traitcompound|default=None: second operator - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: ImageMath 3 structural_maths.nii + structural.nii 2 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - op1: '"structural.nii"' - # type=file|default=: first operator - operation: '"+"' - # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations - op2: '"2"' - # type=traitcompound|default=None: second operator - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: ImageMath 3 structural_maths.nii Project structural.nii 1 2 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - op1: '"structural.nii"' - # type=file|default=: first operator - operation: '"Project"' - # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations - op2: '"1 2"' - # type=traitcompound|default=None: second operator - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: ImageMath 3 structural_maths.nii G structural.nii 4 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - op1: '"structural.nii"' - # type=file|default=: first operator - operation: '"G"' - # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations - op2: '"4"' - # type=traitcompound|default=None: second operator - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: ImageMath 3 structural_maths.nii TruncateImageIntensity structural.nii 0.005 0.999 256 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - op1: '"structural.nii"' - # type=file|default=: first operator - operation: '"TruncateImageIntensity"' - # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations - op2: '"0.005 0.999 256"' - # type=traitcompound|default=None: second operator - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/interfaces/affine_initializer.yaml b/nipype-auto-conv/specs/interfaces/affine_initializer.yaml new file mode 100644 index 0000000..8eeac88 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/affine_initializer.yaml @@ -0,0 +1,145 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.utils.AffineInitializer' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Initialize an affine transform (as in antsBrainExtraction.sh) +# +# >>> from nipype.interfaces.ants import AffineInitializer +# >>> init = AffineInitializer() +# >>> init.inputs.fixed_image = 'fixed1.nii' +# >>> init.inputs.moving_image = 'moving1.nii' +# >>> init.cmdline +# 'antsAffineInitializer 3 fixed1.nii moving1.nii transform.mat 15.000000 0.100000 0 10' +# +# +task_name: AffineInitializer +nipype_name: AffineInitializer +nipype_module: nipype.interfaces.ants.utils +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + fixed_image: medimage/itk-image + # type=file|default=: reference image + moving_image: medimage/itk-image + # type=file|default=: moving image + out_file: Path + # type=file: output transform file + # type=file|default='transform.mat': output transform file + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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: generic/file + # type=file: output transform file + # type=file|default='transform.mat': output transform file + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: dimension + fixed_image: + # type=file|default=: reference image + moving_image: + # type=file|default=: moving image + out_file: + # type=file: output transform file + # type=file|default='transform.mat': output transform file + search_factor: + # type=float|default=15.0: increments (degrees) for affine search + radian_fraction: + # type=range|default=0.1: search this arc +/- principal axes + principal_axes: + # type=bool|default=False: whether the rotation is searched around an initial principal axis alignment. + local_search: + # type=int|default=10: determines if a local optimization is run at each search point for the set number of iterations + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + fixed_image: + # type=file|default=: reference image + moving_image: + # type=file|default=: moving image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: antsAffineInitializer 3 fixed1.nii moving1.nii transform.mat 15.000000 0.100000 0 10 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + fixed_image: '"fixed1.nii"' + # type=file|default=: reference image + moving_image: '"moving1.nii"' + # type=file|default=: moving image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/affine_initializer_callables.py b/nipype-auto-conv/specs/interfaces/affine_initializer_callables.py similarity index 100% rename from nipype-auto-conv/specs/affine_initializer_callables.py rename to nipype-auto-conv/specs/interfaces/affine_initializer_callables.py diff --git a/nipype-auto-conv/specs/interfaces/ai.yaml b/nipype-auto-conv/specs/interfaces/ai.yaml new file mode 100644 index 0000000..91623b4 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/ai.yaml @@ -0,0 +1,133 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.utils.AI' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Calculate the optimal linear transform parameters for aligning two images. +# +# Examples +# -------- +# >>> AI( +# ... fixed_image='structural.nii', +# ... moving_image='epi.nii', +# ... metric=('Mattes', 32, 'Regular', 1), +# ... ).cmdline +# 'antsAI -c [10,1e-06,10] -d 3 -m Mattes[structural.nii,epi.nii,32,Regular,1] +# -o initialization.mat -p 0 -s [20,0.12] -t Affine[0.1] -v 0' +# +# >>> AI(fixed_image='structural.nii', +# ... moving_image='epi.nii', +# ... metric=('Mattes', 32, 'Regular', 1), +# ... search_grid=(12, (1, 1, 1)), +# ... ).cmdline +# 'antsAI -c [10,1e-06,10] -d 3 -m Mattes[structural.nii,epi.nii,32,Regular,1] +# -o initialization.mat -p 0 -s [20,0.12] -g [12.0,1x1x1] -t Affine[0.1] -v 0' +# +# +task_name: AI +nipype_name: AI +nipype_module: nipype.interfaces.ants.utils +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + fixed_image: medimage/itk-image + # type=file|default=: Image to which the moving_image should be transformed + fixed_image_mask: generic/file + # type=file|default=: fixed mage mask + moving_image: medimage/itk-image + # type=file|default=: Image that will be transformed to fixed_image + moving_image_mask: generic/file + # type=file|default=: moving mage mask + output_transform: Path + # type=file: output file name + # type=file|default='initialization.mat': output file name + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_transform: generic/file + # type=file: output file name + # type=file|default='initialization.mat': output file name + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: dimension of output image + verbose: + # type=bool|default=False: enable verbosity + fixed_image: + # type=file|default=: Image to which the moving_image should be transformed + moving_image: + # type=file|default=: Image that will be transformed to fixed_image + fixed_image_mask: + # type=file|default=: fixed mage mask + moving_image_mask: + # type=file|default=: moving mage mask + metric: + # type=tuple|default=('Mattes', 32, 'Regular', 0.2): the metric(s) to use. + transform: + # type=tuple|default=('Affine', 0.1): Several transform options are available + principal_axes: + # type=bool|default=False: align using principal axes + search_factor: + # type=tuple|default=(20, 0.12): search factor + search_grid: + # type=traitcompound|default=None: Translation search grid in mm + convergence: + # type=tuple|default=(10, 1e-06, 10): convergence + output_transform: + # type=file: output file name + # type=file|default='initialization.mat': output file name + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: [] diff --git a/nipype-auto-conv/specs/ai_callables.py b/nipype-auto-conv/specs/interfaces/ai_callables.py similarity index 100% rename from nipype-auto-conv/specs/ai_callables.py rename to nipype-auto-conv/specs/interfaces/ai_callables.py diff --git a/nipype-auto-conv/specs/interfaces/ants.yaml b/nipype-auto-conv/specs/interfaces/ants.yaml new file mode 100644 index 0000000..411e222 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/ants.yaml @@ -0,0 +1,248 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.registration.ANTS' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# ANTS wrapper for registration of images +# (old, use Registration instead) +# +# Examples +# -------- +# +# >>> from nipype.interfaces.ants import ANTS +# >>> ants = ANTS() +# >>> ants.inputs.dimension = 3 +# >>> ants.inputs.output_transform_prefix = 'MY' +# >>> ants.inputs.metric = ['CC'] +# >>> ants.inputs.fixed_image = ['T1.nii'] +# >>> ants.inputs.moving_image = ['resting.nii'] +# >>> ants.inputs.metric_weight = [1.0] +# >>> ants.inputs.radius = [5] +# >>> ants.inputs.transformation_model = 'SyN' +# >>> ants.inputs.gradient_step_length = 0.25 +# >>> ants.inputs.number_of_iterations = [50, 35, 15] +# >>> ants.inputs.use_histogram_matching = True +# >>> ants.inputs.mi_option = [32, 16000] +# >>> ants.inputs.regularization = 'Gauss' +# >>> ants.inputs.regularization_gradient_field_sigma = 3 +# >>> ants.inputs.regularization_deformation_field_sigma = 0 +# >>> ants.inputs.number_of_affine_iterations = [10000,10000,10000,10000,10000] +# >>> ants.cmdline +# 'ANTS 3 --MI-option 32x16000 --image-metric CC[ T1.nii, resting.nii, 1, 5 ] --number-of-affine-iterations 10000x10000x10000x10000x10000 --number-of-iterations 50x35x15 --output-naming MY --regularization Gauss[3.0,0.0] --transformation-model SyN[0.25] --use-Histogram-Matching 1' +# +task_name: ANTS +nipype_name: ANTS +nipype_module: nipype.interfaces.ants.registration +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + fixed_image: medimage/itk-image+list-of + # type=inputmultiobject|default=[]: image to which the moving image is warped + moving_image: medimage/itk-image+list-of + # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregisteredfunctional) + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + affine_transform: generic/file + # type=file: Affine transform file + inverse_warp_transform: generic/file + # type=file: Inverse warping deformation field + metaheader: generic/file + # type=file: VTK metaheader .mhd file + metaheader_raw: generic/file + # type=file: VTK metaheader .raw file + warp_transform: generic/file + # type=file: Warping deformation field + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + fixed_image: + # type=inputmultiobject|default=[]: image to which the moving image is warped + moving_image: + # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregisteredfunctional) + metric: + # type=list|default=[]: + metric_weight: + # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. + radius: + # type=list|default=[]: radius of the region (i.e. number of layers around a voxel/pixel) that is used for computing cross correlation + output_transform_prefix: + # type=str|default='out': + transformation_model: + # type=enum|default='Diff'|allowed['Diff','Elast','Exp','Greedy Exp','SyN']: + gradient_step_length: + # type=float|default=0.0: + number_of_time_steps: + # type=int|default=0: + delta_time: + # type=float|default=0.0: + symmetry_type: + # type=float|default=0.0: + use_histogram_matching: + # type=bool|default=True: + number_of_iterations: + # type=list|default=[]: + smoothing_sigmas: + # type=list|default=[]: + subsampling_factors: + # type=list|default=[]: + affine_gradient_descent_option: + # type=list|default=[]: + mi_option: + # type=list|default=[]: + regularization: + # type=enum|default='Gauss'|allowed['DMFFD','Gauss']: + regularization_gradient_field_sigma: + # type=float|default=0.0: + regularization_deformation_field_sigma: + # type=float|default=0.0: + number_of_affine_iterations: + # type=list|default=[]: + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + output_transform_prefix: '"MY"' + # type=str|default='out': + metric: '["CC"]' + # type=list|default=[]: + fixed_image: + # type=inputmultiobject|default=[]: image to which the moving image is warped + moving_image: + # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregisteredfunctional) + metric_weight: "[1.0]" + # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. + radius: "[5]" + # type=list|default=[]: radius of the region (i.e. number of layers around a voxel/pixel) that is used for computing cross correlation + transformation_model: '"SyN"' + # type=enum|default='Diff'|allowed['Diff','Elast','Exp','Greedy Exp','SyN']: + gradient_step_length: "0.25" + # type=float|default=0.0: + number_of_iterations: "[50, 35, 15]" + # type=list|default=[]: + use_histogram_matching: "True" + # type=bool|default=True: + mi_option: "[32, 16000]" + # type=list|default=[]: + regularization: '"Gauss"' + # type=enum|default='Gauss'|allowed['DMFFD','Gauss']: + regularization_gradient_field_sigma: "3" + # type=float|default=0.0: + regularization_deformation_field_sigma: "0" + # type=float|default=0.0: + number_of_affine_iterations: "[10000,10000,10000,10000,10000]" + # type=list|default=[]: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: ANTS 3 --MI-option 32x16000 --image-metric CC[ T1.nii, resting.nii, 1, 5 ] --number-of-affine-iterations 10000x10000x10000x10000x10000 --number-of-iterations 50x35x15 --output-naming MY --regularization Gauss[3.0,0.0] --transformation-model SyN[0.25] --use-Histogram-Matching 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + output_transform_prefix: '"MY"' + # type=str|default='out': + metric: '["CC"]' + # type=list|default=[]: + fixed_image: '["T1.nii"]' + # type=inputmultiobject|default=[]: image to which the moving image is warped + moving_image: '["resting.nii"]' + # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregisteredfunctional) + metric_weight: "[1.0]" + # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. + radius: "[5]" + # type=list|default=[]: radius of the region (i.e. number of layers around a voxel/pixel) that is used for computing cross correlation + transformation_model: '"SyN"' + # type=enum|default='Diff'|allowed['Diff','Elast','Exp','Greedy Exp','SyN']: + gradient_step_length: "0.25" + # type=float|default=0.0: + number_of_iterations: "[50, 35, 15]" + # type=list|default=[]: + use_histogram_matching: "True" + # type=bool|default=True: + mi_option: "[32, 16000]" + # type=list|default=[]: + regularization: '"Gauss"' + # type=enum|default='Gauss'|allowed['DMFFD','Gauss']: + regularization_gradient_field_sigma: "3" + # type=float|default=0.0: + regularization_deformation_field_sigma: "0" + # type=float|default=0.0: + number_of_affine_iterations: "[10000,10000,10000,10000,10000]" + # type=list|default=[]: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/ants_callables.py b/nipype-auto-conv/specs/interfaces/ants_callables.py similarity index 100% rename from nipype-auto-conv/specs/ants_callables.py rename to nipype-auto-conv/specs/interfaces/ants_callables.py diff --git a/nipype-auto-conv/specs/interfaces/ants_introduction.yaml b/nipype-auto-conv/specs/interfaces/ants_introduction.yaml new file mode 100644 index 0000000..691cd9d --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/ants_introduction.yaml @@ -0,0 +1,161 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.legacy.antsIntroduction' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# Uses ANTS to generate matrices to warp data from one space to another. +# +# Examples +# -------- +# +# >>> from nipype.interfaces.ants.legacy import antsIntroduction +# >>> warp = antsIntroduction() +# >>> warp.inputs.reference_image = 'Template_6.nii' +# >>> warp.inputs.input_image = 'structural.nii' +# >>> warp.inputs.max_iterations = [30,90,20] +# >>> warp.cmdline +# 'antsIntroduction.sh -d 3 -i structural.nii -m 30x90x20 -o ants_ -r Template_6.nii -t GR' +# +# +task_name: antsIntroduction +nipype_name: antsIntroduction +nipype_module: nipype.interfaces.ants.legacy +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + input_image: medimage/itk-image + # type=file|default=: input image to warp to template + reference_image: medimage/itk-image + # type=file|default=: template file to warp to + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + affine_transformation: generic/file + # type=file: affine (prefix_Affine.txt) + input_file: generic/file + # type=file: input image (prefix_repaired.nii) + inverse_warp_field: generic/file + # type=file: inverse warp field (prefix_InverseWarp.nii) + output_file: generic/file + # type=file: output image (prefix_deformed.nii) + warp_field: generic/file + # type=file: warp field (prefix_Warp.nii) + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + reference_image: + # type=file|default=: template file to warp to + input_image: + # type=file|default=: input image to warp to template + force_proceed: + # type=bool|default=False: force script to proceed even if headers may be incompatible + inverse_warp_template_labels: + # type=bool|default=False: Applies inverse warp to the template labels to estimate label positions in target space (use for template-based segmentation) + max_iterations: + # type=list|default=[]: maximum number of iterations (must be list of integers in the form [J,K,L...]: J = coarsest resolution iterations, K = middle resolution iterations, L = fine resolution iterations + bias_field_correction: + # type=bool|default=False: Applies bias field correction to moving image + similarity_metric: + # type=enum|default='PR'|allowed['CC','MI','MSQ','PR']: Type of similartiy metric used for registration (CC = cross correlation, MI = mutual information, PR = probability mapping, MSQ = mean square difference) + transformation_model: + # type=enum|default='GR'|allowed['DD','EL','EX','GR','RA','RI','S2','SY']: Type of transofmration model used for registration (EL = elastic transformation model, SY = SyN with time, arbitrary number of time points, S2 = SyN with time optimized for 2 time points, GR = greedy SyN, EX = exponential, DD = diffeomorphic demons style exponential mapping, RI = purely rigid, RA = affine rigid + out_prefix: + # type=str|default='ants_': Prefix that is prepended to all output files (default = ants_) + quality_check: + # type=bool|default=False: Perform a quality check of the result + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + reference_image: + # type=file|default=: template file to warp to + input_image: + # type=file|default=: input image to warp to template + max_iterations: "[30,90,20]" + # type=list|default=[]: maximum number of iterations (must be list of integers in the form [J,K,L...]: J = coarsest resolution iterations, K = middle resolution iterations, L = fine resolution iterations + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: antsIntroduction.sh -d 3 -i structural.nii -m 30x90x20 -o ants_ -r Template_6.nii -t GR + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + reference_image: '"Template_6.nii"' + # type=file|default=: template file to warp to + input_image: '"structural.nii"' + # type=file|default=: input image to warp to template + max_iterations: "[30,90,20]" + # type=list|default=[]: maximum number of iterations (must be list of integers in the form [J,K,L...]: J = coarsest resolution iterations, K = middle resolution iterations, L = fine resolution iterations + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/ants_introduction_callables.py b/nipype-auto-conv/specs/interfaces/ants_introduction_callables.py similarity index 100% rename from nipype-auto-conv/specs/ants_introduction_callables.py rename to nipype-auto-conv/specs/interfaces/ants_introduction_callables.py diff --git a/nipype-auto-conv/specs/interfaces/apply_transforms.yaml b/nipype-auto-conv/specs/interfaces/apply_transforms.yaml new file mode 100644 index 0000000..ad9de12 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/apply_transforms.yaml @@ -0,0 +1,395 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.resampling.ApplyTransforms' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# ApplyTransforms, applied to an input image, transforms it according to a +# reference image and a transform (or a set of transforms). +# +# Examples +# -------- +# +# >>> from nipype.interfaces.ants import ApplyTransforms +# >>> at = ApplyTransforms() +# >>> at.inputs.input_image = 'moving1.nii' +# >>> at.inputs.reference_image = 'fixed1.nii' +# >>> at.inputs.transforms = 'identity' +# >>> at.cmdline +# 'antsApplyTransforms --default-value 0 --float 0 --input moving1.nii --interpolation Linear --output moving1_trans.nii --reference-image fixed1.nii --transform identity' +# +# >>> at = ApplyTransforms() +# >>> at.inputs.dimension = 3 +# >>> at.inputs.input_image = 'moving1.nii' +# >>> at.inputs.reference_image = 'fixed1.nii' +# >>> at.inputs.output_image = 'deformed_moving1.nii' +# >>> at.inputs.interpolation = 'Linear' +# >>> at.inputs.default_value = 0 +# >>> at.inputs.transforms = ['ants_Warp.nii.gz', 'trans.mat'] +# >>> at.inputs.invert_transform_flags = [False, True] +# >>> at.cmdline +# 'antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii --interpolation Linear --output deformed_moving1.nii --reference-image fixed1.nii --transform ants_Warp.nii.gz --transform [ trans.mat, 1 ]' +# +# >>> at1 = ApplyTransforms() +# >>> at1.inputs.dimension = 3 +# >>> at1.inputs.input_image = 'moving1.nii' +# >>> at1.inputs.reference_image = 'fixed1.nii' +# >>> at1.inputs.output_image = 'deformed_moving1.nii' +# >>> at1.inputs.interpolation = 'BSpline' +# >>> at1.inputs.interpolation_parameters = (5,) +# >>> at1.inputs.default_value = 0 +# >>> at1.inputs.transforms = ['ants_Warp.nii.gz', 'trans.mat'] +# >>> at1.inputs.invert_transform_flags = [False, False] +# >>> at1.cmdline +# 'antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii --interpolation BSpline[ 5 ] --output deformed_moving1.nii --reference-image fixed1.nii --transform ants_Warp.nii.gz --transform trans.mat' +# +# Identity transforms may be used as part of a chain: +# +# >>> at2 = ApplyTransforms() +# >>> at2.inputs.dimension = 3 +# >>> at2.inputs.input_image = 'moving1.nii' +# >>> at2.inputs.reference_image = 'fixed1.nii' +# >>> at2.inputs.output_image = 'deformed_moving1.nii' +# >>> at2.inputs.interpolation = 'BSpline' +# >>> at2.inputs.interpolation_parameters = (5,) +# >>> at2.inputs.default_value = 0 +# >>> at2.inputs.transforms = ['identity', 'ants_Warp.nii.gz', 'trans.mat'] +# >>> at2.cmdline +# 'antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii --interpolation BSpline[ 5 ] --output deformed_moving1.nii --reference-image fixed1.nii --transform identity --transform ants_Warp.nii.gz --transform trans.mat' +# +task_name: ApplyTransforms +nipype_name: ApplyTransforms +nipype_module: nipype.interfaces.ants.resampling +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + input_image: medimage/itk-image+list-of,medimage/itk-image + input_image_type: str + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: medimage/itk-image + # type=file|default=: reference image space that you wish to warp INTO + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_image: medimage/itk-image,medimage/itk-image+list-of + # type=file: Warped image + # type=str|default='': output file name + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + output_image: '"deformed_moving1.nii"' + # type=file: Warped image + # type=str|default='': output file name + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. + input_image_type: + # type=enum|default=0|allowed[0,1,2,3]: Option specifying the input image type of scalar (default), vector, tensor, or time series. + input_image: + # type=file|default=: image to apply transformation to (generally a coregistered functional) + output_image: + # type=file: Warped image + # type=str|default='': output file name + out_postfix: + # type=str|default='_trans': Postfix that is appended to all output files (default = _trans) + reference_image: + # type=file|default=: reference image space that you wish to warp INTO + interpolation: + # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: + interpolation_parameters: + # type=traitcompound|default=None: + transforms: + # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. + invert_transform_flags: + # type=inputmultiobject|default=[]: + default_value: + # type=float|default=0.0: + print_out_composite_warp_file: + # type=bool|default=False: output a composite warp file instead of a transformed image + float: + # type=bool|default=False: Use float instead of double for computations. + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: + # type=file|default=: reference image space that you wish to warp INTO + transforms: '"identity"' + # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. + input_image: + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: + # type=file|default=: reference image space that you wish to warp INTO + output_image: '"deformed_moving1.nii"' + # type=file: Warped image + # type=str|default='': output file name + interpolation: '"Linear"' + # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: + default_value: "0" + # type=float|default=0.0: + transforms: '["ants_Warp.nii.gz", "trans.mat"]' + # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. + invert_transform_flags: "[False, True]" + # type=inputmultiobject|default=[]: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. + input_image: + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: + # type=file|default=: reference image space that you wish to warp INTO + output_image: '"deformed_moving1.nii"' + # type=file: Warped image + # type=str|default='': output file name + interpolation: '"BSpline"' + # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: + interpolation_parameters: (5,) + # type=traitcompound|default=None: + default_value: "0" + # type=float|default=0.0: + transforms: '["ants_Warp.nii.gz", "trans.mat"]' + # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. + invert_transform_flags: "[False, False]" + # type=inputmultiobject|default=[]: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. + input_image: + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: + # type=file|default=: reference image space that you wish to warp INTO + output_image: '"deformed_moving1.nii"' + # type=file: Warped image + # type=str|default='': output file name + interpolation: '"BSpline"' + # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: + interpolation_parameters: (5,) + # type=traitcompound|default=None: + default_value: "0" + # type=float|default=0.0: + transforms: '["identity", "ants_Warp.nii.gz", "trans.mat"]' + # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: antsApplyTransforms --default-value 0 --float 0 --input moving1.nii --interpolation Linear --output moving1_trans.nii --reference-image fixed1.nii --transform identity + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"moving1.nii"' + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: '"fixed1.nii"' + # type=file|default=: reference image space that you wish to warp INTO + transforms: '"identity"' + # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii --interpolation Linear --output deformed_moving1.nii --reference-image fixed1.nii --transform ants_Warp.nii.gz --transform [ trans.mat, 1 ] + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. + input_image: '"moving1.nii"' + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: '"fixed1.nii"' + # type=file|default=: reference image space that you wish to warp INTO + output_image: '"deformed_moving1.nii"' + # type=file: Warped image + # type=str|default='': output file name + interpolation: '"Linear"' + # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: + default_value: "0" + # type=float|default=0.0: + transforms: '["ants_Warp.nii.gz", "trans.mat"]' + # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. + invert_transform_flags: "[False, True]" + # type=inputmultiobject|default=[]: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii --interpolation BSpline[ 5 ] --output deformed_moving1.nii --reference-image fixed1.nii --transform ants_Warp.nii.gz --transform trans.mat + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. + input_image: '"moving1.nii"' + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: '"fixed1.nii"' + # type=file|default=: reference image space that you wish to warp INTO + output_image: '"deformed_moving1.nii"' + # type=file: Warped image + # type=str|default='': output file name + interpolation: '"BSpline"' + # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: + interpolation_parameters: (5,) + # type=traitcompound|default=None: + default_value: "0" + # type=float|default=0.0: + transforms: '["ants_Warp.nii.gz", "trans.mat"]' + # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. + invert_transform_flags: "[False, False]" + # type=inputmultiobject|default=[]: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsApplyTransforms --default-value 0 --dimensionality 3 --float 0 --input moving1.nii --interpolation BSpline[ 5 ] --output deformed_moving1.nii --reference-image fixed1.nii --transform identity --transform ants_Warp.nii.gz --transform trans.mat + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, antsWarp tries to infer the dimensionality from the input image. + input_image: '"moving1.nii"' + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: '"fixed1.nii"' + # type=file|default=: reference image space that you wish to warp INTO + output_image: '"deformed_moving1.nii"' + # type=file: Warped image + # type=str|default='': output file name + interpolation: '"BSpline"' + # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: + interpolation_parameters: (5,) + # type=traitcompound|default=None: + default_value: "0" + # type=float|default=0.0: + transforms: '["identity", "ants_Warp.nii.gz", "trans.mat"]' + # type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/apply_transforms_callables.py b/nipype-auto-conv/specs/interfaces/apply_transforms_callables.py similarity index 100% rename from nipype-auto-conv/specs/apply_transforms_callables.py rename to nipype-auto-conv/specs/interfaces/apply_transforms_callables.py diff --git a/nipype-auto-conv/specs/apply_transforms_to_points.yaml b/nipype-auto-conv/specs/interfaces/apply_transforms_to_points.yaml similarity index 100% rename from nipype-auto-conv/specs/apply_transforms_to_points.yaml rename to nipype-auto-conv/specs/interfaces/apply_transforms_to_points.yaml diff --git a/nipype-auto-conv/specs/apply_transforms_to_points_callables.py b/nipype-auto-conv/specs/interfaces/apply_transforms_to_points_callables.py similarity index 100% rename from nipype-auto-conv/specs/apply_transforms_to_points_callables.py rename to nipype-auto-conv/specs/interfaces/apply_transforms_to_points_callables.py diff --git a/nipype-auto-conv/specs/interfaces/atropos.yaml b/nipype-auto-conv/specs/interfaces/atropos.yaml new file mode 100644 index 0000000..3470744 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/atropos.yaml @@ -0,0 +1,583 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.segmentation.Atropos' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# A multivariate n-class segmentation algorithm. +# +# A finite mixture modeling (FMM) segmentation approach with possibilities for +# specifying prior constraints. These prior constraints include the specification +# of a prior label image, prior probability images (one for each class), and/or an +# MRF prior to enforce spatial smoothing of the labels. Similar algorithms include +# FAST and SPM. +# +# Examples +# -------- +# >>> from nipype.interfaces.ants import Atropos +# >>> at = Atropos( +# ... dimension=3, intensity_images='structural.nii', mask_image='mask.nii', +# ... number_of_tissue_classes=2, likelihood_model='Gaussian', save_posteriors=True, +# ... mrf_smoothing_factor=0.2, mrf_radius=[1, 1, 1], icm_use_synchronous_update=True, +# ... maximum_number_of_icm_terations=1, n_iterations=5, convergence_threshold=0.000001, +# ... posterior_formulation='Socrates', use_mixture_model_proportions=True) +# >>> at.inputs.initialization = 'Random' +# >>> at.cmdline +# 'Atropos --image-dimensionality 3 --icm [1,1] +# --initialization Random[2] --intensity-image structural.nii +# --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] +# --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] +# --use-random-seed 1' +# +# >>> at = Atropos( +# ... dimension=3, intensity_images='structural.nii', mask_image='mask.nii', +# ... number_of_tissue_classes=2, likelihood_model='Gaussian', save_posteriors=True, +# ... mrf_smoothing_factor=0.2, mrf_radius=[1, 1, 1], icm_use_synchronous_update=True, +# ... maximum_number_of_icm_terations=1, n_iterations=5, convergence_threshold=0.000001, +# ... posterior_formulation='Socrates', use_mixture_model_proportions=True) +# >>> at.inputs.initialization = 'KMeans' +# >>> at.inputs.kmeans_init_centers = [100, 200] +# >>> at.cmdline +# 'Atropos --image-dimensionality 3 --icm [1,1] +# --initialization KMeans[2,100,200] --intensity-image structural.nii +# --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] +# --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] +# --use-random-seed 1' +# +# >>> at = Atropos( +# ... dimension=3, intensity_images='structural.nii', mask_image='mask.nii', +# ... number_of_tissue_classes=2, likelihood_model='Gaussian', save_posteriors=True, +# ... mrf_smoothing_factor=0.2, mrf_radius=[1, 1, 1], icm_use_synchronous_update=True, +# ... maximum_number_of_icm_terations=1, n_iterations=5, convergence_threshold=0.000001, +# ... posterior_formulation='Socrates', use_mixture_model_proportions=True) +# >>> at.inputs.initialization = 'PriorProbabilityImages' +# >>> at.inputs.prior_image = 'BrainSegmentationPrior%02d.nii.gz' +# >>> at.inputs.prior_weighting = 0.8 +# >>> at.inputs.prior_probability_threshold = 0.0000001 +# >>> at.cmdline +# 'Atropos --image-dimensionality 3 --icm [1,1] +# --initialization PriorProbabilityImages[2,BrainSegmentationPrior%02d.nii.gz,0.8,1e-07] +# --intensity-image structural.nii --likelihood-model Gaussian --mask-image mask.nii +# --mrf [0.2,1x1x1] --convergence [5,1e-06] +# --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] +# --posterior-formulation Socrates[1] --use-random-seed 1' +# +# >>> at = Atropos( +# ... dimension=3, intensity_images='structural.nii', mask_image='mask.nii', +# ... number_of_tissue_classes=2, likelihood_model='Gaussian', save_posteriors=True, +# ... mrf_smoothing_factor=0.2, mrf_radius=[1, 1, 1], icm_use_synchronous_update=True, +# ... maximum_number_of_icm_terations=1, n_iterations=5, convergence_threshold=0.000001, +# ... posterior_formulation='Socrates', use_mixture_model_proportions=True) +# >>> at.inputs.initialization = 'PriorLabelImage' +# >>> at.inputs.prior_image = 'segmentation0.nii.gz' +# >>> at.inputs.number_of_tissue_classes = 2 +# >>> at.inputs.prior_weighting = 0.8 +# >>> at.cmdline +# 'Atropos --image-dimensionality 3 --icm [1,1] +# --initialization PriorLabelImage[2,segmentation0.nii.gz,0.8] --intensity-image structural.nii +# --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] +# --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] +# --use-random-seed 1' +# +# +task_name: Atropos +nipype_name: Atropos +nipype_module: nipype.interfaces.ants.segmentation +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + intensity_images: medimage/nifti1+list-of + # type=inputmultiobject|default=[]: + mask_image: medimage/itk-image + # type=file|default=: + out_classified_image_name: Path + # type=file|default=: + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + out_classified_image_name: out_classified_image_name_default + # type=file|default=: + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + classified_image: medimage/itk-image + # type=file: + posteriors: generic/file+list-of + # type=outputmultiobject: + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) + intensity_images: + # type=inputmultiobject|default=[]: + mask_image: + # type=file|default=: + initialization: + # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: + kmeans_init_centers: + # type=list|default=[]: + prior_image: + # type=traitcompound|default=None: either a string pattern (e.g., 'prior%02d.nii') or an existing vector-image file. + number_of_tissue_classes: + # type=int|default=0: + prior_weighting: + # type=float|default=0.0: + prior_probability_threshold: + # type=float|default=0.0: + likelihood_model: + # type=str|default='': + mrf_smoothing_factor: + # type=float|default=0.0: + mrf_radius: + # type=list|default=[]: + icm_use_synchronous_update: + # type=bool|default=False: + maximum_number_of_icm_terations: + # type=int|default=0: + n_iterations: + # type=int|default=0: + convergence_threshold: + # type=float|default=0.0: + posterior_formulation: + # type=str|default='': + use_random_seed: + # type=bool|default=True: use random seed value over constant + use_mixture_model_proportions: + # type=bool|default=False: + out_classified_image_name: + # type=file|default=: + save_posteriors: + # type=bool|default=False: + output_posteriors_name_template: + # type=str|default='POSTERIOR_%02d.nii.gz': + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + initialization: '"Random"' + # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) + intensity_images: + # type=inputmultiobject|default=[]: + mask_image: + # type=file|default=: + number_of_tissue_classes: "2" + # type=int|default=0: + likelihood_model: '"Gaussian"' + # type=str|default='': + save_posteriors: "True" + # type=bool|default=False: + mrf_smoothing_factor: "0.2" + # type=float|default=0.0: + mrf_radius: "[1, 1, 1]" + # type=list|default=[]: + icm_use_synchronous_update: "True" + # type=bool|default=False: + maximum_number_of_icm_terations: "1" + # type=int|default=0: + n_iterations: "5" + # type=int|default=0: + convergence_threshold: "0.000001" + # type=float|default=0.0: + posterior_formulation: '"Socrates"' + # type=str|default='': + use_mixture_model_proportions: "True" + # type=bool|default=False: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + initialization: '"KMeans"' + # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: + kmeans_init_centers: "[100, 200]" + # type=list|default=[]: + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) + intensity_images: + # type=inputmultiobject|default=[]: + mask_image: + # type=file|default=: + number_of_tissue_classes: "2" + # type=int|default=0: + likelihood_model: '"Gaussian"' + # type=str|default='': + save_posteriors: "True" + # type=bool|default=False: + mrf_smoothing_factor: "0.2" + # type=float|default=0.0: + mrf_radius: "[1, 1, 1]" + # type=list|default=[]: + icm_use_synchronous_update: "True" + # type=bool|default=False: + maximum_number_of_icm_terations: "1" + # type=int|default=0: + n_iterations: "5" + # type=int|default=0: + convergence_threshold: "0.000001" + # type=float|default=0.0: + posterior_formulation: '"Socrates"' + # type=str|default='': + use_mixture_model_proportions: "True" + # type=bool|default=False: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + initialization: '"PriorProbabilityImages"' + # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: + prior_image: '"BrainSegmentationPrior%02d.nii.gz"' + # type=traitcompound|default=None: either a string pattern (e.g., 'prior%02d.nii') or an existing vector-image file. + prior_weighting: "0.8" + # type=float|default=0.0: + prior_probability_threshold: "0.0000001" + # type=float|default=0.0: + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) + intensity_images: + # type=inputmultiobject|default=[]: + mask_image: + # type=file|default=: + number_of_tissue_classes: "2" + # type=int|default=0: + likelihood_model: '"Gaussian"' + # type=str|default='': + save_posteriors: "True" + # type=bool|default=False: + mrf_smoothing_factor: "0.2" + # type=float|default=0.0: + mrf_radius: "[1, 1, 1]" + # type=list|default=[]: + icm_use_synchronous_update: "True" + # type=bool|default=False: + maximum_number_of_icm_terations: "1" + # type=int|default=0: + n_iterations: "5" + # type=int|default=0: + convergence_threshold: "0.000001" + # type=float|default=0.0: + posterior_formulation: '"Socrates"' + # type=str|default='': + use_mixture_model_proportions: "True" + # type=bool|default=False: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + initialization: '"PriorLabelImage"' + # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: + prior_image: '"segmentation0.nii.gz"' + # type=traitcompound|default=None: either a string pattern (e.g., 'prior%02d.nii') or an existing vector-image file. + number_of_tissue_classes: "2" + # type=int|default=0: + prior_weighting: "0.8" + # type=float|default=0.0: + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) + intensity_images: + # type=inputmultiobject|default=[]: + mask_image: + # type=file|default=: + likelihood_model: '"Gaussian"' + # type=str|default='': + save_posteriors: "True" + # type=bool|default=False: + mrf_smoothing_factor: "0.2" + # type=float|default=0.0: + mrf_radius: "[1, 1, 1]" + # type=list|default=[]: + icm_use_synchronous_update: "True" + # type=bool|default=False: + maximum_number_of_icm_terations: "1" + # type=int|default=0: + n_iterations: "5" + # type=int|default=0: + convergence_threshold: "0.000001" + # type=float|default=0.0: + posterior_formulation: '"Socrates"' + # type=str|default='': + use_mixture_model_proportions: "True" + # type=bool|default=False: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: Atropos --image-dimensionality 3 --icm [1,1] --initialization Random[2] --intensity-image structural.nii --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] --use-random-seed 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + initialization: '"Random"' + # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) + intensity_images: '"structural.nii"' + # type=inputmultiobject|default=[]: + mask_image: '"mask.nii"' + # type=file|default=: + number_of_tissue_classes: "2" + # type=int|default=0: + likelihood_model: '"Gaussian"' + # type=str|default='': + save_posteriors: "True" + # type=bool|default=False: + mrf_smoothing_factor: "0.2" + # type=float|default=0.0: + mrf_radius: "[1, 1, 1]" + # type=list|default=[]: + icm_use_synchronous_update: "True" + # type=bool|default=False: + maximum_number_of_icm_terations: "1" + # type=int|default=0: + n_iterations: "5" + # type=int|default=0: + convergence_threshold: "0.000001" + # type=float|default=0.0: + posterior_formulation: '"Socrates"' + # type=str|default='': + use_mixture_model_proportions: "True" + # type=bool|default=False: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: Atropos --image-dimensionality 3 --icm [1,1] --initialization KMeans[2,100,200] --intensity-image structural.nii --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] --use-random-seed 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + initialization: '"KMeans"' + # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: + kmeans_init_centers: "[100, 200]" + # type=list|default=[]: + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) + intensity_images: '"structural.nii"' + # type=inputmultiobject|default=[]: + mask_image: '"mask.nii"' + # type=file|default=: + number_of_tissue_classes: "2" + # type=int|default=0: + likelihood_model: '"Gaussian"' + # type=str|default='': + save_posteriors: "True" + # type=bool|default=False: + mrf_smoothing_factor: "0.2" + # type=float|default=0.0: + mrf_radius: "[1, 1, 1]" + # type=list|default=[]: + icm_use_synchronous_update: "True" + # type=bool|default=False: + maximum_number_of_icm_terations: "1" + # type=int|default=0: + n_iterations: "5" + # type=int|default=0: + convergence_threshold: "0.000001" + # type=float|default=0.0: + posterior_formulation: '"Socrates"' + # type=str|default='': + use_mixture_model_proportions: "True" + # type=bool|default=False: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: Atropos --image-dimensionality 3 --icm [1,1] --initialization PriorProbabilityImages[2,BrainSegmentationPrior%02d.nii.gz,0.8,1e-07] --intensity-image structural.nii --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] --use-random-seed 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + initialization: '"PriorProbabilityImages"' + # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: + prior_image: '"BrainSegmentationPrior%02d.nii.gz"' + # type=traitcompound|default=None: either a string pattern (e.g., 'prior%02d.nii') or an existing vector-image file. + prior_weighting: "0.8" + # type=float|default=0.0: + prior_probability_threshold: "0.0000001" + # type=float|default=0.0: + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) + intensity_images: '"structural.nii"' + # type=inputmultiobject|default=[]: + mask_image: '"mask.nii"' + # type=file|default=: + number_of_tissue_classes: "2" + # type=int|default=0: + likelihood_model: '"Gaussian"' + # type=str|default='': + save_posteriors: "True" + # type=bool|default=False: + mrf_smoothing_factor: "0.2" + # type=float|default=0.0: + mrf_radius: "[1, 1, 1]" + # type=list|default=[]: + icm_use_synchronous_update: "True" + # type=bool|default=False: + maximum_number_of_icm_terations: "1" + # type=int|default=0: + n_iterations: "5" + # type=int|default=0: + convergence_threshold: "0.000001" + # type=float|default=0.0: + posterior_formulation: '"Socrates"' + # type=str|default='': + use_mixture_model_proportions: "True" + # type=bool|default=False: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: Atropos --image-dimensionality 3 --icm [1,1] --initialization PriorLabelImage[2,segmentation0.nii.gz,0.8] --intensity-image structural.nii --likelihood-model Gaussian --mask-image mask.nii --mrf [0.2,1x1x1] --convergence [5,1e-06] --output [structural_labeled.nii,POSTERIOR_%02d.nii.gz] --posterior-formulation Socrates[1] --use-random-seed 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + initialization: '"PriorLabelImage"' + # type=enum|default='Random'|allowed['KMeans','Otsu','PriorLabelImage','PriorProbabilityImages','Random']: + prior_image: '"segmentation0.nii.gz"' + # type=traitcompound|default=None: either a string pattern (e.g., 'prior%02d.nii') or an existing vector-image file. + number_of_tissue_classes: "2" + # type=int|default=0: + prior_weighting: "0.8" + # type=float|default=0.0: + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3, or 4) + intensity_images: '"structural.nii"' + # type=inputmultiobject|default=[]: + mask_image: '"mask.nii"' + # type=file|default=: + likelihood_model: '"Gaussian"' + # type=str|default='': + save_posteriors: "True" + # type=bool|default=False: + mrf_smoothing_factor: "0.2" + # type=float|default=0.0: + mrf_radius: "[1, 1, 1]" + # type=list|default=[]: + icm_use_synchronous_update: "True" + # type=bool|default=False: + maximum_number_of_icm_terations: "1" + # type=int|default=0: + n_iterations: "5" + # type=int|default=0: + convergence_threshold: "0.000001" + # type=float|default=0.0: + posterior_formulation: '"Socrates"' + # type=str|default='': + use_mixture_model_proportions: "True" + # type=bool|default=False: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/atropos_callables.py b/nipype-auto-conv/specs/interfaces/atropos_callables.py similarity index 100% rename from nipype-auto-conv/specs/atropos_callables.py rename to nipype-auto-conv/specs/interfaces/atropos_callables.py diff --git a/nipype-auto-conv/specs/average_affine_transform.yaml b/nipype-auto-conv/specs/interfaces/average_affine_transform.yaml similarity index 100% rename from nipype-auto-conv/specs/average_affine_transform.yaml rename to nipype-auto-conv/specs/interfaces/average_affine_transform.yaml diff --git a/nipype-auto-conv/specs/average_affine_transform_callables.py b/nipype-auto-conv/specs/interfaces/average_affine_transform_callables.py similarity index 100% rename from nipype-auto-conv/specs/average_affine_transform_callables.py rename to nipype-auto-conv/specs/interfaces/average_affine_transform_callables.py diff --git a/nipype-auto-conv/specs/interfaces/average_images.yaml b/nipype-auto-conv/specs/interfaces/average_images.yaml new file mode 100644 index 0000000..241424a --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/average_images.yaml @@ -0,0 +1,146 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.utils.AverageImages' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Examples +# -------- +# >>> from nipype.interfaces.ants import AverageImages +# >>> avg = AverageImages() +# >>> avg.inputs.dimension = 3 +# >>> avg.inputs.output_average_image = "average.nii.gz" +# >>> avg.inputs.normalize = True +# >>> avg.inputs.images = ['rc1s1.nii', 'rc1s1.nii'] +# >>> avg.cmdline +# 'AverageImages 3 average.nii.gz 1 rc1s1.nii rc1s1.nii' +# +task_name: AverageImages +nipype_name: AverageImages +nipype_module: nipype.interfaces.ants.utils +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + images: medimage/nifti1+list-of + # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregistered functional) + output_average_image: Path + # type=file: average image file + # type=file|default='average.nii': the name of the resulting image. + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_average_image: medimage/itk-image + # type=file: average image file + # type=file|default='average.nii': the name of the resulting image. + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + output_average_image: + # type=file: average image file + # type=file|default='average.nii': the name of the resulting image. + normalize: + # type=bool|default=False: Normalize: if true, the 2nd image is divided by its mean. This will select the largest image to average into. + images: + # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregistered functional) + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + output_average_image: '"average.nii.gz"' + # type=file: average image file + # type=file|default='average.nii': the name of the resulting image. + normalize: "True" + # type=bool|default=False: Normalize: if true, the 2nd image is divided by its mean. This will select the largest image to average into. + images: + # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregistered functional) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: AverageImages 3 average.nii.gz 1 rc1s1.nii rc1s1.nii + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + output_average_image: '"average.nii.gz"' + # type=file: average image file + # type=file|default='average.nii': the name of the resulting image. + normalize: "True" + # type=bool|default=False: Normalize: if true, the 2nd image is divided by its mean. This will select the largest image to average into. + images: '["rc1s1.nii", "rc1s1.nii"]' + # type=inputmultiobject|default=[]: image to apply transformation to (generally a coregistered functional) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/average_images_callables.py b/nipype-auto-conv/specs/interfaces/average_images_callables.py similarity index 100% rename from nipype-auto-conv/specs/average_images_callables.py rename to nipype-auto-conv/specs/interfaces/average_images_callables.py diff --git a/nipype-auto-conv/specs/interfaces/brain_extraction.yaml b/nipype-auto-conv/specs/interfaces/brain_extraction.yaml new file mode 100644 index 0000000..34232b5 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/brain_extraction.yaml @@ -0,0 +1,197 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.segmentation.BrainExtraction' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Atlas-based brain extraction. +# +# Examples +# -------- +# >>> from nipype.interfaces.ants.segmentation import BrainExtraction +# >>> brainextraction = BrainExtraction() +# >>> brainextraction.inputs.dimension = 3 +# >>> brainextraction.inputs.anatomical_image ='T1.nii.gz' +# >>> brainextraction.inputs.brain_template = 'study_template.nii.gz' +# >>> brainextraction.inputs.brain_probability_mask ='ProbabilityMaskOfStudyTemplate.nii.gz' +# >>> brainextraction.cmdline +# 'antsBrainExtraction.sh -a T1.nii.gz -m ProbabilityMaskOfStudyTemplate.nii.gz +# -e study_template.nii.gz -d 3 -s nii.gz -o highres001_' +# +# +task_name: BrainExtraction +nipype_name: BrainExtraction +nipype_module: nipype.interfaces.ants.segmentation +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + anatomical_image: medimage/itk-image + # type=file|default=: Structural image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. + brain_probability_mask: medimage/nifti-gz + # type=file|default=: Brain probability mask created using e.g. LPBA40 data set which have brain masks defined, and warped to anatomical template and averaged resulting in a probability image. + brain_template: medimage/nifti-gz + # type=file|default=: Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. + extraction_registration_mask: generic/file + # type=file|default=: Mask (defined in the template space) used during registration for brain extraction. To limit the metric computation to a specific region. + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + BrainExtractionBrain: generic/file + # type=file: brain extraction image + BrainExtractionCSF: generic/file + # type=file: segmentation mask with only CSF + BrainExtractionGM: generic/file + # type=file: segmentation mask with only grey matter + BrainExtractionInitialAffine: generic/file + # type=file: + BrainExtractionInitialAffineFixed: generic/file + # type=file: + BrainExtractionInitialAffineMoving: generic/file + # type=file: + BrainExtractionLaplacian: generic/file + # type=file: + BrainExtractionMask: generic/file + # type=file: brain extraction mask + BrainExtractionPrior0GenericAffine: generic/file + # type=file: + BrainExtractionPrior1InverseWarp: generic/file + # type=file: + BrainExtractionPrior1Warp: generic/file + # type=file: + BrainExtractionPriorWarped: generic/file + # type=file: + BrainExtractionSegmentation: generic/file + # type=file: segmentation mask with CSF, GM, and WM + BrainExtractionTemplateLaplacian: generic/file + # type=file: + BrainExtractionTmp: generic/file + # type=file: + BrainExtractionWM: generic/file + # type=file: segmenration mask with only white matter + N4Corrected0: generic/file + # type=file: N4 bias field corrected image + N4Truncated0: generic/file + # type=file: + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + anatomical_image: + # type=file|default=: Structural image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. + brain_template: + # type=file|default=: Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. + brain_probability_mask: + # type=file|default=: Brain probability mask created using e.g. LPBA40 data set which have brain masks defined, and warped to anatomical template and averaged resulting in a probability image. + out_prefix: + # type=str|default='highres001_': Prefix that is prepended to all output files + extraction_registration_mask: + # type=file|default=: Mask (defined in the template space) used during registration for brain extraction. To limit the metric computation to a specific region. + image_suffix: + # type=str|default='nii.gz': any of standard ITK formats, nii.gz is default + use_random_seeding: + # type=enum|default=0|allowed[0,1]: Use random number generated from system clock in Atropos (default = 1) + keep_temporary_files: + # type=int|default=0: Keep brain extraction/segmentation warps, etc (default = 0). + use_floatingpoint_precision: + # type=enum|default=0|allowed[0,1]: Use floating point precision in registrations (default = 0) + debug: + # type=bool|default=False: If > 0, runs a faster version of the script. Only for testing. Implies -u 0. Requires single thread computation for complete reproducibility. + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + anatomical_image: + # type=file|default=: Structural image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. + brain_template: + # type=file|default=: Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. + brain_probability_mask: + # type=file|default=: Brain probability mask created using e.g. LPBA40 data set which have brain masks defined, and warped to anatomical template and averaged resulting in a probability image. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: antsBrainExtraction.sh -a T1.nii.gz -m ProbabilityMaskOfStudyTemplate.nii.gz -e study_template.nii.gz -d 3 -s nii.gz -o highres001_ + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + anatomical_image: '"T1.nii.gz"' + # type=file|default=: Structural image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. + brain_template: '"study_template.nii.gz"' + # type=file|default=: Anatomical template created using e.g. LPBA40 data set with buildtemplateparallel.sh in ANTs. + brain_probability_mask: '"ProbabilityMaskOfStudyTemplate.nii.gz"' + # type=file|default=: Brain probability mask created using e.g. LPBA40 data set which have brain masks defined, and warped to anatomical template and averaged resulting in a probability image. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/brain_extraction_callables.py b/nipype-auto-conv/specs/interfaces/brain_extraction_callables.py similarity index 100% rename from nipype-auto-conv/specs/brain_extraction_callables.py rename to nipype-auto-conv/specs/interfaces/brain_extraction_callables.py diff --git a/nipype-auto-conv/specs/buildtemplateparallel.yaml b/nipype-auto-conv/specs/interfaces/buildtemplateparallel.yaml similarity index 100% rename from nipype-auto-conv/specs/buildtemplateparallel.yaml rename to nipype-auto-conv/specs/interfaces/buildtemplateparallel.yaml diff --git a/nipype-auto-conv/specs/buildtemplateparallel_callables.py b/nipype-auto-conv/specs/interfaces/buildtemplateparallel_callables.py similarity index 100% rename from nipype-auto-conv/specs/buildtemplateparallel_callables.py rename to nipype-auto-conv/specs/interfaces/buildtemplateparallel_callables.py diff --git a/nipype-auto-conv/specs/interfaces/compose_multi_transform.yaml b/nipype-auto-conv/specs/interfaces/compose_multi_transform.yaml new file mode 100644 index 0000000..45ae236 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/compose_multi_transform.yaml @@ -0,0 +1,140 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.utils.ComposeMultiTransform' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Take a set of transformations and convert them to a single transformation matrix/warpfield. +# +# Examples +# -------- +# >>> from nipype.interfaces.ants import ComposeMultiTransform +# >>> compose_transform = ComposeMultiTransform() +# >>> compose_transform.inputs.dimension = 3 +# >>> compose_transform.inputs.transforms = ['struct_to_template.mat', 'func_to_struct.mat'] +# >>> compose_transform.cmdline +# 'ComposeMultiTransform 3 struct_to_template_composed.mat +# struct_to_template.mat func_to_struct.mat' +# +# +task_name: ComposeMultiTransform +nipype_name: ComposeMultiTransform +nipype_module: nipype.interfaces.ants.utils +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_transform: Path + # type=file: Composed transform file + # type=file|default=: the name of the resulting transform. + reference_image: medimage/itk-image + # type=file|default=: Reference image (only necessary when output is warpfield) + transforms: datascience/text-matrix+list-of + # type=inputmultiobject|default=[]: transforms to average + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_transform: generic/file + # type=file: Composed transform file + # type=file|default=: the name of the resulting transform. + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + output_transform: + # type=file: Composed transform file + # type=file|default=: the name of the resulting transform. + reference_image: + # type=file|default=: Reference image (only necessary when output is warpfield) + transforms: + # type=inputmultiobject|default=[]: transforms to average + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + transforms: + # type=inputmultiobject|default=[]: transforms to average + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: ComposeMultiTransform 3 struct_to_template_composed.mat struct_to_template.mat func_to_struct.mat + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + transforms: '["struct_to_template.mat", "func_to_struct.mat"]' + # type=inputmultiobject|default=[]: transforms to average + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/compose_multi_transform_callables.py b/nipype-auto-conv/specs/interfaces/compose_multi_transform_callables.py similarity index 100% rename from nipype-auto-conv/specs/compose_multi_transform_callables.py rename to nipype-auto-conv/specs/interfaces/compose_multi_transform_callables.py diff --git a/nipype-auto-conv/specs/composite_transform_util.yaml b/nipype-auto-conv/specs/interfaces/composite_transform_util.yaml similarity index 100% rename from nipype-auto-conv/specs/composite_transform_util.yaml rename to nipype-auto-conv/specs/interfaces/composite_transform_util.yaml diff --git a/nipype-auto-conv/specs/composite_transform_util_callables.py b/nipype-auto-conv/specs/interfaces/composite_transform_util_callables.py similarity index 100% rename from nipype-auto-conv/specs/composite_transform_util_callables.py rename to nipype-auto-conv/specs/interfaces/composite_transform_util_callables.py diff --git a/nipype-auto-conv/specs/interfaces/convert_scalar_image_to_rgb.yaml b/nipype-auto-conv/specs/interfaces/convert_scalar_image_to_rgb.yaml new file mode 100644 index 0000000..ac238cf --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/convert_scalar_image_to_rgb.yaml @@ -0,0 +1,161 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.visualization.ConvertScalarImageToRGB' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Convert scalar images to RGB. +# +# Examples +# -------- +# >>> from nipype.interfaces.ants.visualization import ConvertScalarImageToRGB +# >>> converter = ConvertScalarImageToRGB() +# >>> converter.inputs.dimension = 3 +# >>> converter.inputs.input_image = 'T1.nii.gz' +# >>> converter.inputs.colormap = 'jet' +# >>> converter.inputs.minimum_input = 0 +# >>> converter.inputs.maximum_input = 6 +# >>> converter.cmdline +# 'ConvertScalarImageToRGB 3 T1.nii.gz rgb.nii.gz none jet none 0 6 0 255' +# +# +task_name: ConvertScalarImageToRGB +nipype_name: ConvertScalarImageToRGB +nipype_module: nipype.interfaces.ants.visualization +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + input_image: medimage/itk-image + # type=file|default=: Main input is a 3-D grayscale image. + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_image: medimage/itk-image + # type=file: converted RGB image + # type=str|default='rgb.nii.gz': rgb output image + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + input_image: + # type=file|default=: Main input is a 3-D grayscale image. + output_image: + # type=file: converted RGB image + # type=str|default='rgb.nii.gz': rgb output image + mask_image: + # type=traitcompound|default='none': mask image + colormap: + # type=enum|default='grey'|allowed['autumn','blue','cool','copper','custom','green','grey','hot','hsv','jet','overunder','red','spring','summer','winter']: Select a colormap + custom_color_map_file: + # type=str|default='none': custom color map file + minimum_input: + # type=int|default=0: minimum input + maximum_input: + # type=int|default=0: maximum input + minimum_RGB_output: + # type=int|default=0: + maximum_RGB_output: + # type=int|default=255: + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + input_image: + # type=file|default=: Main input is a 3-D grayscale image. + colormap: '"jet"' + # type=enum|default='grey'|allowed['autumn','blue','cool','copper','custom','green','grey','hot','hsv','jet','overunder','red','spring','summer','winter']: Select a colormap + minimum_input: "0" + # type=int|default=0: minimum input + maximum_input: "6" + # type=int|default=0: maximum input + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: ConvertScalarImageToRGB 3 T1.nii.gz rgb.nii.gz none jet none 0 6 0 255 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + input_image: '"T1.nii.gz"' + # type=file|default=: Main input is a 3-D grayscale image. + colormap: '"jet"' + # type=enum|default='grey'|allowed['autumn','blue','cool','copper','custom','green','grey','hot','hsv','jet','overunder','red','spring','summer','winter']: Select a colormap + minimum_input: "0" + # type=int|default=0: minimum input + maximum_input: "6" + # type=int|default=0: maximum input + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/convert_scalar_image_to_rgb_callables.py b/nipype-auto-conv/specs/interfaces/convert_scalar_image_to_rgb_callables.py similarity index 100% rename from nipype-auto-conv/specs/convert_scalar_image_to_rgb_callables.py rename to nipype-auto-conv/specs/interfaces/convert_scalar_image_to_rgb_callables.py diff --git a/nipype-auto-conv/specs/interfaces/cortical_thickness.yaml b/nipype-auto-conv/specs/interfaces/cortical_thickness.yaml new file mode 100644 index 0000000..318e795 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/cortical_thickness.yaml @@ -0,0 +1,225 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.segmentation.CorticalThickness' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Examples +# -------- +# >>> from nipype.interfaces.ants.segmentation import CorticalThickness +# >>> corticalthickness = CorticalThickness() +# >>> corticalthickness.inputs.dimension = 3 +# >>> corticalthickness.inputs.anatomical_image ='T1.nii.gz' +# >>> corticalthickness.inputs.brain_template = 'study_template.nii.gz' +# >>> corticalthickness.inputs.brain_probability_mask ='ProbabilityMaskOfStudyTemplate.nii.gz' +# >>> corticalthickness.inputs.segmentation_priors = ['BrainSegmentationPrior01.nii.gz', +# ... 'BrainSegmentationPrior02.nii.gz', +# ... 'BrainSegmentationPrior03.nii.gz', +# ... 'BrainSegmentationPrior04.nii.gz'] +# >>> corticalthickness.inputs.t1_registration_template = 'brain_study_template.nii.gz' +# >>> corticalthickness.cmdline +# 'antsCorticalThickness.sh -a T1.nii.gz -m ProbabilityMaskOfStudyTemplate.nii.gz +# -e study_template.nii.gz -d 3 -s nii.gz -o antsCT_ +# -p nipype_priors/BrainSegmentationPrior%02d.nii.gz -t brain_study_template.nii.gz' +# +# +task_name: CorticalThickness +nipype_name: CorticalThickness +nipype_module: nipype.interfaces.ants.segmentation +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + anatomical_image: medimage/itk-image + # type=file|default=: Structural *intensity* image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. + brain_probability_mask: medimage/nifti-gz + # type=file|default=: brain probability mask in template space + brain_template: medimage/nifti-gz + # type=file|default=: Anatomical *intensity* template (possibly created using a population data set with buildtemplateparallel.sh in ANTs). This template is *not* skull-stripped. + cortical_label_image: medimage/itk-image + # type=file|default=: Cortical ROI labels to use as a prior for ATITH. + extraction_registration_mask: generic/file + # type=file|default=: Mask (defined in the template space) used during registration for brain extraction. + segmentation_priors: medimage/nifti-gz+list-of + # type=inputmultiobject|default=[]: + t1_registration_template: medimage/nifti-gz + # type=file|default=: Anatomical *intensity* template (assumed to be skull-stripped). A common case would be where this would be the same template as specified in the -e option which is not skull stripped. + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + BrainExtractionMask: generic/file + # type=file: brain extraction mask + BrainSegmentation: generic/file + # type=file: brain segmentation image + BrainSegmentationN4: generic/file + # type=file: N4 corrected image + BrainSegmentationPosteriors: generic/file+list-of + # type=outputmultiobject: Posterior probability images + BrainVolumes: generic/file + # type=file: Brain volumes as text + CorticalThickness: generic/file + # type=file: cortical thickness file + CorticalThicknessNormedToTemplate: generic/file + # type=file: Normalized cortical thickness + ExtractedBrainN4: generic/file + # type=file: extracted brain from N4 image + SubjectToTemplate0GenericAffine: generic/file + # type=file: Template to subject inverse affine + SubjectToTemplate1Warp: generic/file + # type=file: Template to subject inverse warp + SubjectToTemplateLogJacobian: generic/file + # type=file: Template to subject log jacobian + TemplateToSubject0Warp: generic/file + # type=file: Template to subject warp + TemplateToSubject1GenericAffine: generic/file + # type=file: Template to subject affine + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + anatomical_image: + # type=file|default=: Structural *intensity* image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. + brain_template: + # type=file|default=: Anatomical *intensity* template (possibly created using a population data set with buildtemplateparallel.sh in ANTs). This template is *not* skull-stripped. + brain_probability_mask: + # type=file|default=: brain probability mask in template space + segmentation_priors: + # type=inputmultiobject|default=[]: + out_prefix: + # type=str|default='antsCT_': Prefix that is prepended to all output files + image_suffix: + # type=str|default='nii.gz': any of standard ITK formats, nii.gz is default + t1_registration_template: + # type=file|default=: Anatomical *intensity* template (assumed to be skull-stripped). A common case would be where this would be the same template as specified in the -e option which is not skull stripped. + extraction_registration_mask: + # type=file|default=: Mask (defined in the template space) used during registration for brain extraction. + keep_temporary_files: + # type=int|default=0: Keep brain extraction/segmentation warps, etc (default = 0). + max_iterations: + # type=int|default=0: ANTS registration max iterations (default = 100x100x70x20) + prior_segmentation_weight: + # type=float|default=0.0: Atropos spatial prior *probability* weight for the segmentation + segmentation_iterations: + # type=int|default=0: N4 -> Atropos -> N4 iterations during segmentation (default = 3) + posterior_formulation: + # type=str|default='': Atropos posterior formulation and whether or not to use mixture model proportions. e.g 'Socrates[1]' (default) or 'Aristotle[1]'. Choose the latter if you want use the distance priors (see also the -l option for label propagation control). + use_floatingpoint_precision: + # type=enum|default=0|allowed[0,1]: Use floating point precision in registrations (default = 0) + use_random_seeding: + # type=enum|default=0|allowed[0,1]: Use random number generated from system clock in Atropos (default = 1) + b_spline_smoothing: + # type=bool|default=False: Use B-spline SyN for registrations and B-spline exponential mapping in DiReCT. + cortical_label_image: + # type=file|default=: Cortical ROI labels to use as a prior for ATITH. + label_propagation: + # type=str|default='': Incorporate a distance prior one the posterior formulation. Should be of the form 'label[lambda,boundaryProbability]' where label is a value of 1,2,3,... denoting label ID. The label probability for anything outside the current label = boundaryProbability * exp( -lambda * distanceFromBoundary ) Intuitively, smaller lambda values will increase the spatial capture range of the distance prior. To apply to all label values, simply omit specifying the label, i.e. -l [lambda,boundaryProbability]. + quick_registration: + # type=bool|default=False: If = 1, use antsRegistrationSyNQuick.sh as the basis for registration during brain extraction, brain segmentation, and (optional) normalization to a template. Otherwise use antsRegistrationSyN.sh (default = 0). + debug: + # type=bool|default=False: If > 0, runs a faster version of the script. Only for testing. Implies -u 0. Requires single thread computation for complete reproducibility. + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + anatomical_image: + # type=file|default=: Structural *intensity* image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. + brain_template: + # type=file|default=: Anatomical *intensity* template (possibly created using a population data set with buildtemplateparallel.sh in ANTs). This template is *not* skull-stripped. + brain_probability_mask: + # type=file|default=: brain probability mask in template space + segmentation_priors: + # type=inputmultiobject|default=[]: + t1_registration_template: + # type=file|default=: Anatomical *intensity* template (assumed to be skull-stripped). A common case would be where this would be the same template as specified in the -e option which is not skull stripped. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: antsCorticalThickness.sh -a T1.nii.gz -m ProbabilityMaskOfStudyTemplate.nii.gz -e study_template.nii.gz -d 3 -s nii.gz -o antsCT_ -p nipype_priors/BrainSegmentationPrior%02d.nii.gz -t brain_study_template.nii.gz + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + anatomical_image: '"T1.nii.gz"' + # type=file|default=: Structural *intensity* image, typically T1. If more than one anatomical image is specified, subsequently specified images are used during the segmentation process. However, only the first image is used in the registration of priors. Our suggestion would be to specify the T1 as the first image. + brain_template: '"study_template.nii.gz"' + # type=file|default=: Anatomical *intensity* template (possibly created using a population data set with buildtemplateparallel.sh in ANTs). This template is *not* skull-stripped. + brain_probability_mask: '"ProbabilityMaskOfStudyTemplate.nii.gz"' + # type=file|default=: brain probability mask in template space + segmentation_priors: '["BrainSegmentationPrior01.nii.gz","BrainSegmentationPrior02.nii.gz","BrainSegmentationPrior03.nii.gz","BrainSegmentationPrior04.nii.gz"]' + # type=inputmultiobject|default=[]: + t1_registration_template: '"brain_study_template.nii.gz"' + # type=file|default=: Anatomical *intensity* template (assumed to be skull-stripped). A common case would be where this would be the same template as specified in the -e option which is not skull stripped. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/cortical_thickness_callables.py b/nipype-auto-conv/specs/interfaces/cortical_thickness_callables.py similarity index 100% rename from nipype-auto-conv/specs/cortical_thickness_callables.py rename to nipype-auto-conv/specs/interfaces/cortical_thickness_callables.py diff --git a/nipype-auto-conv/specs/interfaces/create_jacobian_determinant_image.yaml b/nipype-auto-conv/specs/interfaces/create_jacobian_determinant_image.yaml new file mode 100644 index 0000000..78276ac --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/create_jacobian_determinant_image.yaml @@ -0,0 +1,138 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.utils.CreateJacobianDeterminantImage' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Examples +# -------- +# >>> from nipype.interfaces.ants import CreateJacobianDeterminantImage +# >>> jacobian = CreateJacobianDeterminantImage() +# >>> jacobian.inputs.imageDimension = 3 +# >>> jacobian.inputs.deformationField = 'ants_Warp.nii.gz' +# >>> jacobian.inputs.outputImage = 'out_name.nii.gz' +# >>> jacobian.cmdline +# 'CreateJacobianDeterminantImage 3 ants_Warp.nii.gz out_name.nii.gz' +# +task_name: CreateJacobianDeterminantImage +nipype_name: CreateJacobianDeterminantImage +nipype_module: nipype.interfaces.ants.utils +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + deformationField: medimage/nifti-gz + # type=file|default=: deformation transformation file + outputImage: medimage/nifti-gz + # type=file|default=: output filename + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + jacobian_image: medimage/itk-image + # type=file: jacobian image + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + imageDimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + deformationField: + # type=file|default=: deformation transformation file + outputImage: + # type=file|default=: output filename + doLogJacobian: + # type=enum|default=0|allowed[0,1]: return the log jacobian + useGeometric: + # type=enum|default=0|allowed[0,1]: return the geometric jacobian + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + imageDimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + deformationField: + # type=file|default=: deformation transformation file + outputImage: + # type=file|default=: output filename + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: CreateJacobianDeterminantImage 3 ants_Warp.nii.gz out_name.nii.gz + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + imageDimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + deformationField: '"ants_Warp.nii.gz"' + # type=file|default=: deformation transformation file + outputImage: '"out_name.nii.gz"' + # type=file|default=: output filename + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/create_jacobian_determinant_image_callables.py b/nipype-auto-conv/specs/interfaces/create_jacobian_determinant_image_callables.py similarity index 100% rename from nipype-auto-conv/specs/create_jacobian_determinant_image_callables.py rename to nipype-auto-conv/specs/interfaces/create_jacobian_determinant_image_callables.py diff --git a/nipype-auto-conv/specs/interfaces/create_tiled_mosaic.yaml b/nipype-auto-conv/specs/interfaces/create_tiled_mosaic.yaml new file mode 100644 index 0000000..adae16a --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/create_tiled_mosaic.yaml @@ -0,0 +1,186 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.visualization.CreateTiledMosaic' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# The program CreateTiledMosaic in conjunction with ConvertScalarImageToRGB +# provides useful functionality for common image analysis tasks. The basic +# usage of CreateTiledMosaic is to tile a 3-D image volume slice-wise into +# a 2-D image. +# +# Examples +# -------- +# +# >>> from nipype.interfaces.ants.visualization import CreateTiledMosaic +# >>> mosaic_slicer = CreateTiledMosaic() +# >>> mosaic_slicer.inputs.input_image = 'T1.nii.gz' +# >>> mosaic_slicer.inputs.rgb_image = 'rgb.nii.gz' +# >>> mosaic_slicer.inputs.mask_image = 'mask.nii.gz' +# >>> mosaic_slicer.inputs.output_image = 'output.png' +# >>> mosaic_slicer.inputs.alpha_value = 0.5 +# >>> mosaic_slicer.inputs.direction = 2 +# >>> mosaic_slicer.inputs.pad_or_crop = '[ -15x -50 , -15x -30 ,0]' +# >>> mosaic_slicer.inputs.slices = '[2 ,100 ,160]' +# >>> mosaic_slicer.cmdline +# 'CreateTiledMosaic -a 0.50 -d 2 -i T1.nii.gz -x mask.nii.gz -o output.png -p [ -15x -50 , -15x -30 ,0] -r rgb.nii.gz -s [2 ,100 ,160]' +# +task_name: CreateTiledMosaic +nipype_name: CreateTiledMosaic +nipype_module: nipype.interfaces.ants.visualization +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + input_image: medimage/itk-image + # type=file|default=: Main input is a 3-D grayscale image. + mask_image: medimage/itk-image + # type=file|default=: Specifies the ROI of the RGB voxels used. + rgb_image: medimage/itk-image + # type=file|default=: An optional Rgb image can be added as an overlay.It must have the same imagegeometry as the input grayscale image. + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_image: image/png + # type=file: image file + # type=str|default='output.png': The output consists of the tiled mosaic image. + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: Main input is a 3-D grayscale image. + rgb_image: + # type=file|default=: An optional Rgb image can be added as an overlay.It must have the same imagegeometry as the input grayscale image. + mask_image: + # type=file|default=: Specifies the ROI of the RGB voxels used. + alpha_value: + # type=float|default=0.0: If an Rgb image is provided, render the overlay using the specified alpha parameter. + output_image: + # type=file: image file + # type=str|default='output.png': The output consists of the tiled mosaic image. + tile_geometry: + # type=str|default='': The tile geometry specifies the number of rows and columnsin the output image. For example, if the user specifies "5x10", then 5 rows by 10 columns of slices are rendered. If R < 0 and C > 0 (or vice versa), the negative value is selectedbased on direction. + direction: + # type=int|default=0: Specifies the direction of the slices. If no direction is specified, the direction with the coarsest spacing is chosen. + pad_or_crop: + # type=str|default='': argument passed to -p flag:[padVoxelWidth,][lowerPadding[0]xlowerPadding[1],upperPadding[0]xupperPadding[1],constantValue]The user can specify whether to pad or crop a specified voxel-width boundary of each individual slice. For this program, cropping is simply padding with negative voxel-widths.If one pads (+), the user can also specify a constant pad value (default = 0). If a mask is specified, the user can use the mask to define the region, by using the keyword "mask" plus an offset, e.g. "-p mask+3". + slices: + # type=str|default='': Number of slices to increment Slice1xSlice2xSlice3[numberOfSlicesToIncrement,,] + flip_slice: + # type=str|default='': flipXxflipY + permute_axes: + # type=bool|default=False: doPermute + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: Main input is a 3-D grayscale image. + rgb_image: + # type=file|default=: An optional Rgb image can be added as an overlay.It must have the same imagegeometry as the input grayscale image. + mask_image: + # type=file|default=: Specifies the ROI of the RGB voxels used. + output_image: '"output.png"' + # type=file: image file + # type=str|default='output.png': The output consists of the tiled mosaic image. + alpha_value: "0.5" + # type=float|default=0.0: If an Rgb image is provided, render the overlay using the specified alpha parameter. + direction: "2" + # type=int|default=0: Specifies the direction of the slices. If no direction is specified, the direction with the coarsest spacing is chosen. + pad_or_crop: '"[ -15x -50 , -15x -30 ,0]"' + # type=str|default='': argument passed to -p flag:[padVoxelWidth,][lowerPadding[0]xlowerPadding[1],upperPadding[0]xupperPadding[1],constantValue]The user can specify whether to pad or crop a specified voxel-width boundary of each individual slice. For this program, cropping is simply padding with negative voxel-widths.If one pads (+), the user can also specify a constant pad value (default = 0). If a mask is specified, the user can use the mask to define the region, by using the keyword "mask" plus an offset, e.g. "-p mask+3". + slices: '"[2 ,100 ,160]"' + # type=str|default='': Number of slices to increment Slice1xSlice2xSlice3[numberOfSlicesToIncrement,,] + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: CreateTiledMosaic -a 0.50 -d 2 -i T1.nii.gz -x mask.nii.gz -o output.png -p [ -15x -50 , -15x -30 ,0] -r rgb.nii.gz -s [2 ,100 ,160] + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"T1.nii.gz"' + # type=file|default=: Main input is a 3-D grayscale image. + rgb_image: '"rgb.nii.gz"' + # type=file|default=: An optional Rgb image can be added as an overlay.It must have the same imagegeometry as the input grayscale image. + mask_image: '"mask.nii.gz"' + # type=file|default=: Specifies the ROI of the RGB voxels used. + output_image: '"output.png"' + # type=file: image file + # type=str|default='output.png': The output consists of the tiled mosaic image. + alpha_value: "0.5" + # type=float|default=0.0: If an Rgb image is provided, render the overlay using the specified alpha parameter. + direction: "2" + # type=int|default=0: Specifies the direction of the slices. If no direction is specified, the direction with the coarsest spacing is chosen. + pad_or_crop: '"[ -15x -50 , -15x -30 ,0]"' + # type=str|default='': argument passed to -p flag:[padVoxelWidth,][lowerPadding[0]xlowerPadding[1],upperPadding[0]xupperPadding[1],constantValue]The user can specify whether to pad or crop a specified voxel-width boundary of each individual slice. For this program, cropping is simply padding with negative voxel-widths.If one pads (+), the user can also specify a constant pad value (default = 0). If a mask is specified, the user can use the mask to define the region, by using the keyword "mask" plus an offset, e.g. "-p mask+3". + slices: '"[2 ,100 ,160]"' + # type=str|default='': Number of slices to increment Slice1xSlice2xSlice3[numberOfSlicesToIncrement,,] + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/create_tiled_mosaic_callables.py b/nipype-auto-conv/specs/interfaces/create_tiled_mosaic_callables.py similarity index 100% rename from nipype-auto-conv/specs/create_tiled_mosaic_callables.py rename to nipype-auto-conv/specs/interfaces/create_tiled_mosaic_callables.py diff --git a/nipype-auto-conv/specs/interfaces/denoise_image.yaml b/nipype-auto-conv/specs/interfaces/denoise_image.yaml new file mode 100644 index 0000000..0902091 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/denoise_image.yaml @@ -0,0 +1,245 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.segmentation.DenoiseImage' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Examples +# -------- +# >>> import copy +# >>> from nipype.interfaces.ants import DenoiseImage +# >>> denoise = DenoiseImage() +# >>> denoise.inputs.dimension = 3 +# >>> denoise.inputs.input_image = 'im1.nii' +# >>> denoise.cmdline +# 'DenoiseImage -d 3 -i im1.nii -n Gaussian -o im1_noise_corrected.nii -s 1' +# +# >>> denoise_2 = copy.deepcopy(denoise) +# >>> denoise_2.inputs.output_image = 'output_corrected_image.nii.gz' +# >>> denoise_2.inputs.noise_model = 'Rician' +# >>> denoise_2.inputs.shrink_factor = 2 +# >>> denoise_2.cmdline +# 'DenoiseImage -d 3 -i im1.nii -n Rician -o output_corrected_image.nii.gz -s 2' +# +# >>> denoise_3 = DenoiseImage() +# >>> denoise_3.inputs.input_image = 'im1.nii' +# >>> denoise_3.inputs.save_noise = True +# >>> denoise_3.cmdline +# 'DenoiseImage -i im1.nii -n Gaussian -o [ im1_noise_corrected.nii, im1_noise.nii ] -s 1' +# +# +task_name: DenoiseImage +nipype_name: DenoiseImage +nipype_module: nipype.interfaces.ants.segmentation +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + input_image: medimage/itk-image + # type=file|default=: A scalar image is expected as input for noise correction. + noise_image: Path + # type=file: + # type=file|default=: Filename for the estimated noise. + output_image: Path + # type=file: + # type=file|default=: The output consists of the noise corrected version of the input image. + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + noise_image: medimage/itk-image + # type=file: + # type=file|default=: Filename for the estimated noise. + output_image: medimage/itk-image + # type=file: + # type=file|default=: The output consists of the noise corrected version of the input image. + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, the program tries to infer the dimensionality from the input image. + input_image: + # type=file|default=: A scalar image is expected as input for noise correction. + noise_model: + # type=enum|default='Gaussian'|allowed['Gaussian','Rician']: Employ a Rician or Gaussian noise model. + shrink_factor: + # type=int|default=1: Running noise correction on large images can be time consuming. To lessen computation time, the input image can be resampled. The shrink factor, specified as a single integer, describes this resampling. Shrink factor = 1 is the default. + output_image: + # type=file: + # type=file|default=: The output consists of the noise corrected version of the input image. + save_noise: + # type=bool|default=False: True if the estimated noise should be saved to file. + noise_image: + # type=file: + # type=file|default=: Filename for the estimated noise. + verbose: + # type=bool|default=False: Verbose output. + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, the program tries to infer the dimensionality from the input image. + input_image: + # type=file|default=: A scalar image is expected as input for noise correction. + imports: &id001 + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + - module: copy + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + output_image: '"output_corrected_image.nii.gz"' + # type=file: + # type=file|default=: The output consists of the noise corrected version of the input image. + noise_model: '"Rician"' + # type=enum|default='Gaussian'|allowed['Gaussian','Rician']: Employ a Rician or Gaussian noise model. + shrink_factor: "2" + # type=int|default=1: Running noise correction on large images can be time consuming. To lessen computation time, the input image can be resampled. The shrink factor, specified as a single integer, describes this resampling. Shrink factor = 1 is the default. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: A scalar image is expected as input for noise correction. + save_noise: "True" + # type=bool|default=False: True if the estimated noise should be saved to file. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: DenoiseImage -d 3 -i im1.nii -n Gaussian -o im1_noise_corrected.nii -s 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=2|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, the program tries to infer the dimensionality from the input image. + input_image: '"im1.nii"' + # type=file|default=: A scalar image is expected as input for noise correction. + imports: *id001 + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: DenoiseImage -d 3 -i im1.nii -n Rician -o output_corrected_image.nii.gz -s 2 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + output_image: '"output_corrected_image.nii.gz"' + # type=file: + # type=file|default=: The output consists of the noise corrected version of the input image. + noise_model: '"Rician"' + # type=enum|default='Gaussian'|allowed['Gaussian','Rician']: Employ a Rician or Gaussian noise model. + shrink_factor: "2" + # type=int|default=1: Running noise correction on large images can be time consuming. To lessen computation time, the input image can be resampled. The shrink factor, specified as a single integer, describes this resampling. Shrink factor = 1 is the default. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: DenoiseImage -i im1.nii -n Gaussian -o [ im1_noise_corrected.nii, im1_noise.nii ] -s 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"im1.nii"' + # type=file|default=: A scalar image is expected as input for noise correction. + save_noise: "True" + # type=bool|default=False: True if the estimated noise should be saved to file. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/denoise_image_callables.py b/nipype-auto-conv/specs/interfaces/denoise_image_callables.py similarity index 100% rename from nipype-auto-conv/specs/denoise_image_callables.py rename to nipype-auto-conv/specs/interfaces/denoise_image_callables.py diff --git a/nipype-auto-conv/specs/interfaces/gen_warp_fields.yaml b/nipype-auto-conv/specs/interfaces/gen_warp_fields.yaml new file mode 100644 index 0000000..4d5de20 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/gen_warp_fields.yaml @@ -0,0 +1,107 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.legacy.GenWarpFields' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +task_name: GenWarpFields +nipype_name: GenWarpFields +nipype_module: nipype.interfaces.ants.legacy +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + input_image: medimage/itk-image + # type=file|default=: input image to warp to template + reference_image: medimage/itk-image + # type=file|default=: template file to warp to + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + affine_transformation: generic/file + # type=file: affine (prefix_Affine.txt) + input_file: generic/file + # type=file: input image (prefix_repaired.nii) + inverse_warp_field: generic/file + # type=file: inverse warp field (prefix_InverseWarp.nii) + output_file: generic/file + # type=file: output image (prefix_deformed.nii) + warp_field: generic/file + # type=file: warp field (prefix_Warp.nii) + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + reference_image: + # type=file|default=: template file to warp to + input_image: + # type=file|default=: input image to warp to template + force_proceed: + # type=bool|default=False: force script to proceed even if headers may be incompatible + inverse_warp_template_labels: + # type=bool|default=False: Applies inverse warp to the template labels to estimate label positions in target space (use for template-based segmentation) + max_iterations: + # type=list|default=[]: maximum number of iterations (must be list of integers in the form [J,K,L...]: J = coarsest resolution iterations, K = middle resolution iterations, L = fine resolution iterations + bias_field_correction: + # type=bool|default=False: Applies bias field correction to moving image + similarity_metric: + # type=enum|default='PR'|allowed['CC','MI','MSQ','PR']: Type of similartiy metric used for registration (CC = cross correlation, MI = mutual information, PR = probability mapping, MSQ = mean square difference) + transformation_model: + # type=enum|default='GR'|allowed['DD','EL','EX','GR','RA','RI','S2','SY']: Type of transofmration model used for registration (EL = elastic transformation model, SY = SyN with time, arbitrary number of time points, S2 = SyN with time optimized for 2 time points, GR = greedy SyN, EX = exponential, DD = diffeomorphic demons style exponential mapping, RI = purely rigid, RA = affine rigid + out_prefix: + # type=str|default='ants_': Prefix that is prepended to all output files (default = ants_) + quality_check: + # type=bool|default=False: Perform a quality check of the result + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: [] diff --git a/nipype-auto-conv/specs/gen_warp_fields_callables.py b/nipype-auto-conv/specs/interfaces/gen_warp_fields_callables.py similarity index 100% rename from nipype-auto-conv/specs/gen_warp_fields_callables.py rename to nipype-auto-conv/specs/interfaces/gen_warp_fields_callables.py diff --git a/nipype-auto-conv/specs/interfaces/image_math.yaml b/nipype-auto-conv/specs/interfaces/image_math.yaml new file mode 100644 index 0000000..96f0f65 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/image_math.yaml @@ -0,0 +1,310 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.utils.ImageMath' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Operations over images. +# +# Examples +# -------- +# >>> ImageMath( +# ... op1='structural.nii', +# ... operation='+', +# ... op2='2').cmdline +# 'ImageMath 3 structural_maths.nii + structural.nii 2' +# +# >>> ImageMath( +# ... op1='structural.nii', +# ... operation='Project', +# ... op2='1 2').cmdline +# 'ImageMath 3 structural_maths.nii Project structural.nii 1 2' +# +# >>> ImageMath( +# ... op1='structural.nii', +# ... operation='G', +# ... op2='4').cmdline +# 'ImageMath 3 structural_maths.nii G structural.nii 4' +# +# >>> ImageMath( +# ... op1='structural.nii', +# ... operation='TruncateImageIntensity', +# ... op2='0.005 0.999 256').cmdline +# 'ImageMath 3 structural_maths.nii TruncateImageIntensity structural.nii 0.005 0.999 256' +# +# By default, Nipype copies headers from the first input image (``op1``) +# to the output image. +# For some operations, as the ``PadImage`` operation, the header cannot be copied from inputs to +# outputs, and so ``copy_header`` option is automatically set to ``False``. +# +# >>> pad = ImageMath( +# ... op1='structural.nii', +# ... operation='PadImage') +# >>> pad.inputs.copy_header +# False +# +# While the operation is set to ``PadImage``, +# setting ``copy_header = True`` will have no effect. +# +# >>> pad.inputs.copy_header = True +# >>> pad.inputs.copy_header +# False +# +# For any other operation, ``copy_header`` can be enabled/disabled normally: +# +# >>> pad.inputs.operation = "ME" +# >>> pad.inputs.copy_header = True +# >>> pad.inputs.copy_header +# True +# +# +task_name: ImageMath +nipype_name: ImageMath +nipype_module: nipype.interfaces.ants.utils +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + op1: medimage/nifti1 + # type=file|default=: first operator + output_image: Path + # type=file: output image file + # type=file|default=: output image file + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_image: medimage/itk-image + # type=file: output image file + # type=file|default=: output image file + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=int|default=3: dimension of output image + output_image: + # type=file: output image file + # type=file|default=: output image file + operation: + # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations + op1: + # type=file|default=: first operator + op2: + # type=traitcompound|default=None: second operator + args: + # type=str|default='': Additional parameters to the command + copy_header: + # type=bool|default=True: copy headers of the original image into the output (corrected) file + num_threads: + # type=int|default=1: Number of ITK threads to use + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + op1: + # type=file|default=: first operator + operation: '"+"' + # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations + op2: '"2"' + # type=traitcompound|default=None: second operator + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + op1: + # type=file|default=: first operator + operation: '"Project"' + # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations + op2: '"1 2"' + # type=traitcompound|default=None: second operator + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + op1: + # type=file|default=: first operator + operation: '"G"' + # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations + op2: '"4"' + # type=traitcompound|default=None: second operator + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + op1: + # type=file|default=: first operator + operation: '"TruncateImageIntensity"' + # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations + op2: '"0.005 0.999 256"' + # type=traitcompound|default=None: second operator + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: ImageMath 3 structural_maths.nii + structural.nii 2 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + op1: '"structural.nii"' + # type=file|default=: first operator + operation: '"+"' + # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations + op2: '"2"' + # type=traitcompound|default=None: second operator + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: ImageMath 3 structural_maths.nii Project structural.nii 1 2 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + op1: '"structural.nii"' + # type=file|default=: first operator + operation: '"Project"' + # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations + op2: '"1 2"' + # type=traitcompound|default=None: second operator + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: ImageMath 3 structural_maths.nii G structural.nii 4 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + op1: '"structural.nii"' + # type=file|default=: first operator + operation: '"G"' + # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations + op2: '"4"' + # type=traitcompound|default=None: second operator + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: ImageMath 3 structural_maths.nii TruncateImageIntensity structural.nii 0.005 0.999 256 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + op1: '"structural.nii"' + # type=file|default=: first operator + operation: '"TruncateImageIntensity"' + # type=enum|default='m'|allowed['+','-','/','4DTensorTo3DTensor','Byte','Canny','Convolve','CorruptImage','D','Decision','ExtractContours','ExtractSlice','ExtractVectorComponent','FillHoles','Finite','FlattenImage','G','GC','GD','GE','GO','GetLargestComponent','Grad','LabelStats','Laplacian','Lipschitz','MC','MD','ME','MO','MTR','MaurerDistance','Neg','NeighborhoodStats','Normalize','PValueImage','PadImage','Project','ReplaceVoxelValue','ReplicateDisplacement','ReplicateImage','RescaleImage','SetTimeSpacing','SetTimeSpacingWarp','Sharpen','SigmoidImage','TensorAxialDiffusion','TensorColor','TensorEigenvalue','TensorFA','TensorFADenominator','TensorFANumerator','TensorMask','TensorMeanDiffusion','TensorRadialDiffusion','TensorToVector','TensorToVectorComponent','ThresholdAtMean','Translate','TriPlanarView','TruncateImageIntensity','UnsharpMask','WindowImage','^','abs','addtozero','exp','m','max','mean','overadd','stack','total','v+','v-','vm','vtotal']: mathematical operations + op2: '"0.005 0.999 256"' + # type=traitcompound|default=None: second operator + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/image_math_callables.py b/nipype-auto-conv/specs/interfaces/image_math_callables.py similarity index 100% rename from nipype-auto-conv/specs/image_math_callables.py rename to nipype-auto-conv/specs/interfaces/image_math_callables.py diff --git a/nipype-auto-conv/specs/interfaces/joint_fusion.yaml b/nipype-auto-conv/specs/interfaces/joint_fusion.yaml new file mode 100644 index 0000000..338d9a9 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/joint_fusion.yaml @@ -0,0 +1,461 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.segmentation.JointFusion' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# An image fusion algorithm. +# +# Developed by Hongzhi Wang and Paul Yushkevich, and it won segmentation challenges +# at MICCAI 2012 and MICCAI 2013. +# The original label fusion framework was extended to accommodate intensities by Brian +# Avants. +# This implementation is based on Paul's original ITK-style implementation +# and Brian's ANTsR implementation. +# +# References include 1) H. Wang, J. W. Suh, S. +# Das, J. Pluta, C. Craige, P. Yushkevich, Multi-atlas segmentation with joint +# label fusion IEEE Trans. on Pattern Analysis and Machine Intelligence, 35(3), +# 611-623, 2013. and 2) H. Wang and P. A. Yushkevich, Multi-atlas segmentation +# with joint label fusion and corrective learning--an open source implementation, +# Front. Neuroinform., 2013. +# +# Examples +# -------- +# >>> from nipype.interfaces.ants import JointFusion +# >>> jf = JointFusion() +# >>> jf.inputs.out_label_fusion = 'ants_fusion_label_output.nii' +# >>> jf.inputs.atlas_image = [ ['rc1s1.nii','rc1s2.nii'] ] +# >>> jf.inputs.atlas_segmentation_image = ['segmentation0.nii.gz'] +# >>> jf.inputs.target_image = ['im1.nii'] +# >>> jf.cmdline +# "antsJointFusion -a 0.1 -g ['rc1s1.nii', 'rc1s2.nii'] -l segmentation0.nii.gz +# -b 2.0 -o ants_fusion_label_output.nii -s 3x3x3 -t ['im1.nii']" +# +# >>> jf.inputs.target_image = [ ['im1.nii', 'im2.nii'] ] +# >>> jf.cmdline +# "antsJointFusion -a 0.1 -g ['rc1s1.nii', 'rc1s2.nii'] -l segmentation0.nii.gz +# -b 2.0 -o ants_fusion_label_output.nii -s 3x3x3 -t ['im1.nii', 'im2.nii']" +# +# >>> jf.inputs.atlas_image = [ ['rc1s1.nii','rc1s2.nii'], +# ... ['rc2s1.nii','rc2s2.nii'] ] +# >>> jf.inputs.atlas_segmentation_image = ['segmentation0.nii.gz', +# ... 'segmentation1.nii.gz'] +# >>> jf.cmdline +# "antsJointFusion -a 0.1 -g ['rc1s1.nii', 'rc1s2.nii'] -g ['rc2s1.nii', 'rc2s2.nii'] +# -l segmentation0.nii.gz -l segmentation1.nii.gz -b 2.0 -o ants_fusion_label_output.nii +# -s 3x3x3 -t ['im1.nii', 'im2.nii']" +# +# >>> jf.inputs.dimension = 3 +# >>> jf.inputs.alpha = 0.5 +# >>> jf.inputs.beta = 1.0 +# >>> jf.inputs.patch_radius = [3,2,1] +# >>> jf.inputs.search_radius = [3] +# >>> jf.cmdline +# "antsJointFusion -a 0.5 -g ['rc1s1.nii', 'rc1s2.nii'] -g ['rc2s1.nii', 'rc2s2.nii'] +# -l segmentation0.nii.gz -l segmentation1.nii.gz -b 1.0 -d 3 -o ants_fusion_label_output.nii +# -p 3x2x1 -s 3 -t ['im1.nii', 'im2.nii']" +# +# >>> jf.inputs.search_radius = ['mask.nii'] +# >>> jf.inputs.verbose = True +# >>> jf.inputs.exclusion_image = ['roi01.nii', 'roi02.nii'] +# >>> jf.inputs.exclusion_image_label = ['1','2'] +# >>> jf.cmdline +# "antsJointFusion -a 0.5 -g ['rc1s1.nii', 'rc1s2.nii'] -g ['rc2s1.nii', 'rc2s2.nii'] +# -l segmentation0.nii.gz -l segmentation1.nii.gz -b 1.0 -d 3 -e 1[roi01.nii] -e 2[roi02.nii] +# -o ants_fusion_label_output.nii -p 3x2x1 -s mask.nii -t ['im1.nii', 'im2.nii'] -v" +# +# >>> jf.inputs.out_label_fusion = 'ants_fusion_label_output.nii' +# >>> jf.inputs.out_intensity_fusion_name_format = 'ants_joint_fusion_intensity_%d.nii.gz' +# >>> jf.inputs.out_label_post_prob_name_format = 'ants_joint_fusion_posterior_%d.nii.gz' +# >>> jf.inputs.out_atlas_voting_weight_name_format = 'ants_joint_fusion_voting_weight_%d.nii.gz' +# >>> jf.cmdline +# "antsJointFusion -a 0.5 -g ['rc1s1.nii', 'rc1s2.nii'] -g ['rc2s1.nii', 'rc2s2.nii'] +# -l segmentation0.nii.gz -l segmentation1.nii.gz -b 1.0 -d 3 -e 1[roi01.nii] -e 2[roi02.nii] +# -o [ants_fusion_label_output.nii, ants_joint_fusion_intensity_%d.nii.gz, +# ants_joint_fusion_posterior_%d.nii.gz, ants_joint_fusion_voting_weight_%d.nii.gz] +# -p 3x2x1 -s mask.nii -t ['im1.nii', 'im2.nii'] -v" +# +# +task_name: JointFusion +nipype_name: JointFusion +nipype_module: nipype.interfaces.ants.segmentation +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + atlas_segmentation_image: medimage/itk-image+list-of + # type=inputmultiobject|default=[]: The atlas segmentation images. For performing label fusion the number of specified segmentations should be identical to the number of atlas image sets. + exclusion_image: medimage/itk-image+list-of + # type=list|default=[]: Specify an exclusion region for the given label. + mask_image: medimage/itk-image + # type=file|default=: If a mask image is specified, fusion is only performed in the mask region. + out_label_fusion: Path + # type=file: + # type=file|default=: The output label fusion image. + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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_atlas_voting_weight: generic/file+list-of + # type=outputmultiobject: + out_intensity_fusion: generic/file+list-of + # type=outputmultiobject: + out_label_fusion: medimage/nifti1 + # type=file: + # type=file|default=: The output label fusion image. + out_label_post_prob: generic/file+list-of + # type=outputmultiobject: + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, the program tries to infer the dimensionality from the input image. + target_image: + # type=list|default=[]: The target image (or multimodal target images) assumed to be aligned to a common image domain. + atlas_image: + # type=list|default=[]: The atlas image (or multimodal atlas images) assumed to be aligned to a common image domain. + atlas_segmentation_image: + # type=inputmultiobject|default=[]: The atlas segmentation images. For performing label fusion the number of specified segmentations should be identical to the number of atlas image sets. + alpha: + # type=float|default=0.1: Regularization term added to matrix Mx for calculating the inverse. Default = 0.1 + beta: + # type=float|default=2.0: Exponent for mapping intensity difference to the joint error. Default = 2.0 + retain_label_posterior_images: + # type=bool|default=False: Retain label posterior probability images. Requires atlas segmentations to be specified. Default = false + retain_atlas_voting_images: + # type=bool|default=False: Retain atlas voting images. Default = false + constrain_nonnegative: + # type=bool|default=False: Constrain solution to non-negative weights. + patch_radius: + # type=list|default=[]: Patch radius for similarity measures. Default: 2x2x2 + patch_metric: + # type=enum|default='PC'|allowed['MSQ','PC']: Metric to be used in determining the most similar neighborhood patch. Options include Pearson's correlation (PC) and mean squares (MSQ). Default = PC (Pearson correlation). + search_radius: + # type=list|default=[3, 3, 3]: Search radius for similarity measures. Default = 3x3x3. One can also specify an image where the value at the voxel specifies the isotropic search radius at that voxel. + exclusion_image_label: + # type=list|default=[]: Specify a label for the exclusion region. + exclusion_image: + # type=list|default=[]: Specify an exclusion region for the given label. + mask_image: + # type=file|default=: If a mask image is specified, fusion is only performed in the mask region. + out_label_fusion: + # type=file: + # type=file|default=: The output label fusion image. + out_intensity_fusion_name_format: + # type=str|default='': Optional intensity fusion image file name format. (e.g. "antsJointFusionIntensity_%d.nii.gz") + out_label_post_prob_name_format: + # type=str|default='antsJointFusionPosterior_%d.nii.gz': Optional label posterior probability image file name format. + out_atlas_voting_weight_name_format: + # type=str|default='antsJointFusionVotingWeight_%d.nii.gz': Optional atlas voting weight image file name format. + verbose: + # type=bool|default=False: Verbose output. + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + out_label_fusion: '"ants_fusion_label_output.nii"' + # type=file: + # type=file|default=: The output label fusion image. + atlas_image: '[ ["rc1s1.nii","rc1s2.nii"] ]' + # type=list|default=[]: The atlas image (or multimodal atlas images) assumed to be aligned to a common image domain. + atlas_segmentation_image: + # type=inputmultiobject|default=[]: The atlas segmentation images. For performing label fusion the number of specified segmentations should be identical to the number of atlas image sets. + target_image: '["im1.nii"]' + # type=list|default=[]: The target image (or multimodal target images) assumed to be aligned to a common image domain. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + target_image: '[ ["im1.nii", "im2.nii"] ]' + # type=list|default=[]: The target image (or multimodal target images) assumed to be aligned to a common image domain. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + atlas_image: '[ ["rc1s1.nii","rc1s2.nii"],["rc2s1.nii","rc2s2.nii"] ]' + # type=list|default=[]: The atlas image (or multimodal atlas images) assumed to be aligned to a common image domain. + atlas_segmentation_image: + # type=inputmultiobject|default=[]: The atlas segmentation images. For performing label fusion the number of specified segmentations should be identical to the number of atlas image sets. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, the program tries to infer the dimensionality from the input image. + alpha: "0.5" + # type=float|default=0.1: Regularization term added to matrix Mx for calculating the inverse. Default = 0.1 + beta: "1.0" + # type=float|default=2.0: Exponent for mapping intensity difference to the joint error. Default = 2.0 + patch_radius: "[3,2,1]" + # type=list|default=[]: Patch radius for similarity measures. Default: 2x2x2 + search_radius: "[3]" + # type=list|default=[3, 3, 3]: Search radius for similarity measures. Default = 3x3x3. One can also specify an image where the value at the voxel specifies the isotropic search radius at that voxel. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + search_radius: '["mask.nii"]' + # type=list|default=[3, 3, 3]: Search radius for similarity measures. Default = 3x3x3. One can also specify an image where the value at the voxel specifies the isotropic search radius at that voxel. + verbose: "True" + # type=bool|default=False: Verbose output. + exclusion_image: + # type=list|default=[]: Specify an exclusion region for the given label. + exclusion_image_label: '["1","2"]' + # type=list|default=[]: Specify a label for the exclusion region. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + out_label_fusion: '"ants_fusion_label_output.nii"' + # type=file: + # type=file|default=: The output label fusion image. + out_intensity_fusion_name_format: '"ants_joint_fusion_intensity_%d.nii.gz"' + # type=str|default='': Optional intensity fusion image file name format. (e.g. "antsJointFusionIntensity_%d.nii.gz") + out_label_post_prob_name_format: '"ants_joint_fusion_posterior_%d.nii.gz"' + # type=str|default='antsJointFusionPosterior_%d.nii.gz': Optional label posterior probability image file name format. + out_atlas_voting_weight_name_format: '"ants_joint_fusion_voting_weight_%d.nii.gz"' + # type=str|default='antsJointFusionVotingWeight_%d.nii.gz': Optional atlas voting weight image file name format. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: antsJointFusion -a 0.1 -g ["rc1s1.nii", "rc1s2.nii"] -l segmentation0.nii.gz -b 2.0 -o ants_fusion_label_output.nii -s 3x3x3 -t ["im1.nii"] + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + out_label_fusion: '"ants_fusion_label_output.nii"' + # type=file: + # type=file|default=: The output label fusion image. + atlas_image: '[ ["rc1s1.nii","rc1s2.nii"] ]' + # type=list|default=[]: The atlas image (or multimodal atlas images) assumed to be aligned to a common image domain. + atlas_segmentation_image: '["segmentation0.nii.gz"]' + # type=inputmultiobject|default=[]: The atlas segmentation images. For performing label fusion the number of specified segmentations should be identical to the number of atlas image sets. + target_image: '["im1.nii"]' + # type=list|default=[]: The target image (or multimodal target images) assumed to be aligned to a common image domain. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsJointFusion -a 0.1 -g ["rc1s1.nii", "rc1s2.nii"] -l segmentation0.nii.gz -b 2.0 -o ants_fusion_label_output.nii -s 3x3x3 -t ["im1.nii", "im2.nii"] + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + target_image: '[ ["im1.nii", "im2.nii"] ]' + # type=list|default=[]: The target image (or multimodal target images) assumed to be aligned to a common image domain. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsJointFusion -a 0.1 -g ["rc1s1.nii", "rc1s2.nii"] -g ["rc2s1.nii", "rc2s2.nii"] -l segmentation0.nii.gz -l segmentation1.nii.gz -b 2.0 -o ants_fusion_label_output.nii -s 3x3x3 -t ["im1.nii", "im2.nii"] + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + atlas_image: '[ ["rc1s1.nii","rc1s2.nii"],["rc2s1.nii","rc2s2.nii"] ]' + # type=list|default=[]: The atlas image (or multimodal atlas images) assumed to be aligned to a common image domain. + atlas_segmentation_image: '["segmentation0.nii.gz","segmentation1.nii.gz"]' + # type=inputmultiobject|default=[]: The atlas segmentation images. For performing label fusion the number of specified segmentations should be identical to the number of atlas image sets. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsJointFusion -a 0.5 -g ["rc1s1.nii", "rc1s2.nii"] -g ["rc2s1.nii", "rc2s2.nii"] -l segmentation0.nii.gz -l segmentation1.nii.gz -b 1.0 -d 3 -o ants_fusion_label_output.nii -p 3x2x1 -s 3 -t ["im1.nii", "im2.nii"] + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, the program tries to infer the dimensionality from the input image. + alpha: "0.5" + # type=float|default=0.1: Regularization term added to matrix Mx for calculating the inverse. Default = 0.1 + beta: "1.0" + # type=float|default=2.0: Exponent for mapping intensity difference to the joint error. Default = 2.0 + patch_radius: "[3,2,1]" + # type=list|default=[]: Patch radius for similarity measures. Default: 2x2x2 + search_radius: "[3]" + # type=list|default=[3, 3, 3]: Search radius for similarity measures. Default = 3x3x3. One can also specify an image where the value at the voxel specifies the isotropic search radius at that voxel. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsJointFusion -a 0.5 -g ["rc1s1.nii", "rc1s2.nii"] -g ["rc2s1.nii", "rc2s2.nii"] -l segmentation0.nii.gz -l segmentation1.nii.gz -b 1.0 -d 3 -e 1[roi01.nii] -e 2[roi02.nii] -o ants_fusion_label_output.nii -p 3x2x1 -s mask.nii -t ["im1.nii", "im2.nii"] -v + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + search_radius: '["mask.nii"]' + # type=list|default=[3, 3, 3]: Search radius for similarity measures. Default = 3x3x3. One can also specify an image where the value at the voxel specifies the isotropic search radius at that voxel. + verbose: "True" + # type=bool|default=False: Verbose output. + exclusion_image: '["roi01.nii", "roi02.nii"]' + # type=list|default=[]: Specify an exclusion region for the given label. + exclusion_image_label: '["1","2"]' + # type=list|default=[]: Specify a label for the exclusion region. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsJointFusion -a 0.5 -g ["rc1s1.nii", "rc1s2.nii"] -g ["rc2s1.nii", "rc2s2.nii"] -l segmentation0.nii.gz -l segmentation1.nii.gz -b 1.0 -d 3 -e 1[roi01.nii] -e 2[roi02.nii] -o [ants_fusion_label_output.nii, ants_joint_fusion_intensity_%d.nii.gz, ants_joint_fusion_posterior_%d.nii.gz, ants_joint_fusion_voting_weight_%d.nii.gz] -p 3x2x1 -s mask.nii -t ["im1.nii", "im2.nii"] -v + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + out_label_fusion: '"ants_fusion_label_output.nii"' + # type=file: + # type=file|default=: The output label fusion image. + out_intensity_fusion_name_format: '"ants_joint_fusion_intensity_%d.nii.gz"' + # type=str|default='': Optional intensity fusion image file name format. (e.g. "antsJointFusionIntensity_%d.nii.gz") + out_label_post_prob_name_format: '"ants_joint_fusion_posterior_%d.nii.gz"' + # type=str|default='antsJointFusionPosterior_%d.nii.gz': Optional label posterior probability image file name format. + out_atlas_voting_weight_name_format: '"ants_joint_fusion_voting_weight_%d.nii.gz"' + # type=str|default='antsJointFusionVotingWeight_%d.nii.gz': Optional atlas voting weight image file name format. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/joint_fusion_callables.py b/nipype-auto-conv/specs/interfaces/joint_fusion_callables.py similarity index 100% rename from nipype-auto-conv/specs/joint_fusion_callables.py rename to nipype-auto-conv/specs/interfaces/joint_fusion_callables.py diff --git a/nipype-auto-conv/specs/interfaces/kelly_kapowski.yaml b/nipype-auto-conv/specs/interfaces/kelly_kapowski.yaml new file mode 100644 index 0000000..4335be3 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/kelly_kapowski.yaml @@ -0,0 +1,195 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.segmentation.KellyKapowski' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Nipype Interface to ANTs' KellyKapowski, also known as DiReCT. +# +# DiReCT is a registration based estimate of cortical thickness. It was published +# in S. R. Das, B. B. Avants, M. Grossman, and J. C. Gee, Registration based +# cortical thickness measurement, Neuroimage 2009, 45:867--879. +# +# Examples +# -------- +# >>> from nipype.interfaces.ants.segmentation import KellyKapowski +# >>> kk = KellyKapowski() +# >>> kk.inputs.dimension = 3 +# >>> kk.inputs.segmentation_image = "segmentation0.nii.gz" +# >>> kk.inputs.convergence = "[45,0.0,10]" +# >>> kk.inputs.thickness_prior_estimate = 10 +# >>> kk.cmdline +# 'KellyKapowski --convergence "[45,0.0,10]" +# --output "[segmentation0_cortical_thickness.nii.gz,segmentation0_warped_white_matter.nii.gz]" +# --image-dimensionality 3 --gradient-step 0.025000 +# --maximum-number-of-invert-displacement-field-iterations 20 --number-of-integration-points 10 +# --segmentation-image "[segmentation0.nii.gz,2,3]" --smoothing-variance 1.000000 +# --smoothing-velocity-field-parameter 1.500000 --thickness-prior-estimate 10.000000' +# +# +task_name: KellyKapowski +nipype_name: KellyKapowski +nipype_module: nipype.interfaces.ants.segmentation +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + cortical_thickness: Path + # type=file: A thickness map defined in the segmented gray matter. + # type=file|default=: Filename for the cortical thickness. + gray_matter_prob_image: medimage/itk-image + # type=file|default=: In addition to the segmentation image, a gray matter probability image can be used. If no such image is supplied, one is created using the segmentation image and a variance of 1.0 mm. + segmentation_image: medimage/itk-image + # type=file|default=: A segmentation image must be supplied labeling the gray and white matters. Default values = 2 and 3, respectively. + thickness_prior_image: medimage/itk-image + # type=file|default=: An image containing spatially varying prior thickness values. + warped_white_matter: Path + # type=file: A warped white matter image. + # type=file|default=: Filename for the warped white matter file. + white_matter_prob_image: medimage/itk-image + # type=file|default=: In addition to the segmentation image, a white matter probability image can be used. If no such image is supplied, one is created using the segmentation image and a variance of 1.0 mm. + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + cortical_thickness: generic/file + # type=file: A thickness map defined in the segmented gray matter. + # type=file|default=: Filename for the cortical thickness. + warped_white_matter: generic/file + # type=file: A warped white matter image. + # type=file|default=: Filename for the warped white matter file. + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + segmentation_image: + # type=file|default=: A segmentation image must be supplied labeling the gray and white matters. Default values = 2 and 3, respectively. + gray_matter_label: + # type=int|default=2: The label value for the gray matter label in the segmentation_image. + white_matter_label: + # type=int|default=3: The label value for the white matter label in the segmentation_image. + gray_matter_prob_image: + # type=file|default=: In addition to the segmentation image, a gray matter probability image can be used. If no such image is supplied, one is created using the segmentation image and a variance of 1.0 mm. + white_matter_prob_image: + # type=file|default=: In addition to the segmentation image, a white matter probability image can be used. If no such image is supplied, one is created using the segmentation image and a variance of 1.0 mm. + convergence: + # type=str|default='[50,0.001,10]': Convergence is determined by fitting a line to the normalized energy profile of the last N iterations (where N is specified by the window size) and determining the slope which is then compared with the convergence threshold. + thickness_prior_estimate: + # type=float|default=10: Provides a prior constraint on the final thickness measurement in mm. + thickness_prior_image: + # type=file|default=: An image containing spatially varying prior thickness values. + gradient_step: + # type=float|default=0.025: Gradient step size for the optimization. + smoothing_variance: + # type=float|default=1.0: Defines the Gaussian smoothing of the hit and total images. + smoothing_velocity_field: + # type=float|default=1.5: Defines the Gaussian smoothing of the velocity field (default = 1.5). If the b-spline smoothing option is chosen, then this defines the isotropic mesh spacing for the smoothing spline (default = 15). + use_bspline_smoothing: + # type=bool|default=False: Sets the option for B-spline smoothing of the velocity field. + number_integration_points: + # type=int|default=10: Number of compositions of the diffeomorphism per iteration. + max_invert_displacement_field_iters: + # type=int|default=20: Maximum number of iterations for estimating the invertdisplacement field. + cortical_thickness: + # type=file: A thickness map defined in the segmented gray matter. + # type=file|default=: Filename for the cortical thickness. + warped_white_matter: + # type=file: A warped white matter image. + # type=file|default=: Filename for the warped white matter file. + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + segmentation_image: + # type=file|default=: A segmentation image must be supplied labeling the gray and white matters. Default values = 2 and 3, respectively. + convergence: '"[45,0.0,10]"' + # type=str|default='[50,0.001,10]': Convergence is determined by fitting a line to the normalized energy profile of the last N iterations (where N is specified by the window size) and determining the slope which is then compared with the convergence threshold. + thickness_prior_estimate: "10" + # type=float|default=10: Provides a prior constraint on the final thickness measurement in mm. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: KellyKapowski --convergence "[45,0.0,10]" --output "[segmentation0_cortical_thickness.nii.gz,segmentation0_warped_white_matter.nii.gz]" --image-dimensionality 3 --gradient-step 0.025000 --maximum-number-of-invert-displacement-field-iterations 20 --number-of-integration-points 10 --segmentation-image "[segmentation0.nii.gz,2,3]" --smoothing-variance 1.000000 --smoothing-velocity-field-parameter 1.500000 --thickness-prior-estimate 10.000000 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + segmentation_image: '"segmentation0.nii.gz"' + # type=file|default=: A segmentation image must be supplied labeling the gray and white matters. Default values = 2 and 3, respectively. + convergence: '"[45,0.0,10]"' + # type=str|default='[50,0.001,10]': Convergence is determined by fitting a line to the normalized energy profile of the last N iterations (where N is specified by the window size) and determining the slope which is then compared with the convergence threshold. + thickness_prior_estimate: "10" + # type=float|default=10: Provides a prior constraint on the final thickness measurement in mm. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/kelly_kapowski_callables.py b/nipype-auto-conv/specs/interfaces/kelly_kapowski_callables.py similarity index 100% rename from nipype-auto-conv/specs/kelly_kapowski_callables.py rename to nipype-auto-conv/specs/interfaces/kelly_kapowski_callables.py diff --git a/nipype-auto-conv/specs/interfaces/label_geometry.yaml b/nipype-auto-conv/specs/interfaces/label_geometry.yaml new file mode 100644 index 0000000..f8c2050 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/label_geometry.yaml @@ -0,0 +1,173 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.utils.LabelGeometry' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Extracts geometry measures using a label file and an optional image file +# +# Examples +# -------- +# >>> from nipype.interfaces.ants import LabelGeometry +# >>> label_extract = LabelGeometry() +# >>> label_extract.inputs.dimension = 3 +# >>> label_extract.inputs.label_image = 'atlas.nii.gz' +# >>> label_extract.cmdline +# 'LabelGeometryMeasures 3 atlas.nii.gz [] atlas.csv' +# +# >>> label_extract.inputs.intensity_image = 'ants_Warp.nii.gz' +# >>> label_extract.cmdline +# 'LabelGeometryMeasures 3 atlas.nii.gz ants_Warp.nii.gz atlas.csv' +# +# +task_name: LabelGeometry +nipype_name: LabelGeometry +nipype_module: nipype.interfaces.ants.utils +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + intensity_image: medimage/itk-image + # type=file|default='[]': Intensity image to extract values from. This is an optional input + label_image: medimage/itk-image + # type=file|default=: label image to use for extracting geometry measures + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_file: generic/file + # type=file: CSV file of geometry measures + # type=str|default='': name of output file + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + label_image: + # type=file|default=: label image to use for extracting geometry measures + intensity_image: + # type=file|default='[]': Intensity image to extract values from. This is an optional input + output_file: + # type=file: CSV file of geometry measures + # type=str|default='': name of output file + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + label_image: + # type=file|default=: label image to use for extracting geometry measures + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + intensity_image: + # type=file|default='[]': Intensity image to extract values from. This is an optional input + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: LabelGeometryMeasures 3 atlas.nii.gz [] atlas.csv + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + label_image: '"atlas.nii.gz"' + # type=file|default=: label image to use for extracting geometry measures + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: LabelGeometryMeasures 3 atlas.nii.gz ants_Warp.nii.gz atlas.csv + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + intensity_image: '"ants_Warp.nii.gz"' + # type=file|default='[]': Intensity image to extract values from. This is an optional input + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/label_geometry_callables.py b/nipype-auto-conv/specs/interfaces/label_geometry_callables.py similarity index 100% rename from nipype-auto-conv/specs/label_geometry_callables.py rename to nipype-auto-conv/specs/interfaces/label_geometry_callables.py diff --git a/nipype-auto-conv/specs/interfaces/laplacian_thickness.yaml b/nipype-auto-conv/specs/interfaces/laplacian_thickness.yaml new file mode 100644 index 0000000..7fc9ca7 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/laplacian_thickness.yaml @@ -0,0 +1,183 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.segmentation.LaplacianThickness' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# Calculates the cortical thickness from an anatomical image +# +# Examples +# -------- +# +# >>> from nipype.interfaces.ants import LaplacianThickness +# >>> cort_thick = LaplacianThickness() +# >>> cort_thick.inputs.input_wm = 'white_matter.nii.gz' +# >>> cort_thick.inputs.input_gm = 'gray_matter.nii.gz' +# >>> cort_thick.cmdline +# 'LaplacianThickness white_matter.nii.gz gray_matter.nii.gz white_matter_thickness.nii.gz' +# +# >>> cort_thick.inputs.output_image = 'output_thickness.nii.gz' +# >>> cort_thick.cmdline +# 'LaplacianThickness white_matter.nii.gz gray_matter.nii.gz output_thickness.nii.gz' +# +# +task_name: LaplacianThickness +nipype_name: LaplacianThickness +nipype_module: nipype.interfaces.ants.segmentation +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + input_gm: medimage/nifti-gz + # type=file|default=: gray matter segmentation image + input_wm: medimage/nifti-gz + # type=file|default=: white matter segmentation image + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_image: medimage/itk-image + # type=file: Cortical thickness + # type=str|default='': name of output file + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_wm: + # type=file|default=: white matter segmentation image + input_gm: + # type=file|default=: gray matter segmentation image + output_image: + # type=file: Cortical thickness + # type=str|default='': name of output file + smooth_param: + # type=float|default=0.0: Sigma of the Laplacian Recursive Image Filter (defaults to 1) + prior_thickness: + # type=float|default=0.0: Prior thickness (defaults to 500) + dT: + # type=float|default=0.0: Time delta used during integration (defaults to 0.01) + sulcus_prior: + # type=float|default=0.0: Positive floating point number for sulcus prior. Authors said that 0.15 might be a reasonable value + tolerance: + # type=float|default=0.0: Tolerance to reach during optimization (defaults to 0.001) + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_wm: + # type=file|default=: white matter segmentation image + input_gm: + # type=file|default=: gray matter segmentation image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + output_image: '"output_thickness.nii.gz"' + # type=file: Cortical thickness + # type=str|default='': name of output file + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: LaplacianThickness white_matter.nii.gz gray_matter.nii.gz white_matter_thickness.nii.gz + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_wm: '"white_matter.nii.gz"' + # type=file|default=: white matter segmentation image + input_gm: '"gray_matter.nii.gz"' + # type=file|default=: gray matter segmentation image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: LaplacianThickness white_matter.nii.gz gray_matter.nii.gz output_thickness.nii.gz + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + output_image: '"output_thickness.nii.gz"' + # type=file: Cortical thickness + # type=str|default='': name of output file + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/laplacian_thickness_callables.py b/nipype-auto-conv/specs/interfaces/laplacian_thickness_callables.py similarity index 100% rename from nipype-auto-conv/specs/laplacian_thickness_callables.py rename to nipype-auto-conv/specs/interfaces/laplacian_thickness_callables.py diff --git a/nipype-auto-conv/specs/interfaces/measure_image_similarity.yaml b/nipype-auto-conv/specs/interfaces/measure_image_similarity.yaml new file mode 100644 index 0000000..18270a3 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/measure_image_similarity.yaml @@ -0,0 +1,190 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.registration.MeasureImageSimilarity' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# +# +# Examples +# -------- +# +# >>> from nipype.interfaces.ants import MeasureImageSimilarity +# >>> sim = MeasureImageSimilarity() +# >>> sim.inputs.dimension = 3 +# >>> sim.inputs.metric = 'MI' +# >>> sim.inputs.fixed_image = 'T1.nii' +# >>> sim.inputs.moving_image = 'resting.nii' +# >>> sim.inputs.metric_weight = 1.0 +# >>> sim.inputs.radius_or_number_of_bins = 5 +# >>> sim.inputs.sampling_strategy = 'Regular' +# >>> sim.inputs.sampling_percentage = 1.0 +# >>> sim.inputs.fixed_image_mask = 'mask.nii' +# >>> sim.inputs.moving_image_mask = 'mask.nii.gz' +# >>> sim.cmdline +# 'MeasureImageSimilarity --dimensionality 3 --masks ["mask.nii","mask.nii.gz"] --metric MI["T1.nii","resting.nii",1.0,5,Regular,1.0]' +# +task_name: MeasureImageSimilarity +nipype_name: MeasureImageSimilarity +nipype_module: nipype.interfaces.ants.registration +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + fixed_image: medimage/itk-image + # type=file|default=: Image to which the moving image is warped + fixed_image_mask: medimage/nifti1 + # type=file|default=: mask used to limit metric sampling region of the fixed image + moving_image: medimage/itk-image + # type=file|default=: Image to apply transformation to (generally a coregistered functional) + moving_image_mask: medimage/nifti-gz + # type=file|default=: mask used to limit metric sampling region of the moving image + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + similarity: similarity_callable + # type=float: + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=2|allowed[2,3,4]: Dimensionality of the fixed/moving image pair + fixed_image: + # type=file|default=: Image to which the moving image is warped + moving_image: + # type=file|default=: Image to apply transformation to (generally a coregistered functional) + metric: + # type=enum|default='CC'|allowed['CC','Demons','GC','MI','Mattes','MeanSquares']: + metric_weight: + # type=float|default=1.0: The "metricWeight" variable is not used. + radius_or_number_of_bins: + # type=int|default=0: The number of bins in each stage for the MI and Mattes metric, or the radius for other metrics + sampling_strategy: + # type=enum|default='None'|allowed['None','Random','Regular']: Manner of choosing point set over which to optimize the metric. Defaults to "None" (i.e. a dense sampling of one sample per voxel). + sampling_percentage: + # type=range|default=None: Percentage of points accessible to the sampling strategy over which to optimize the metric. + fixed_image_mask: + # type=file|default=: mask used to limit metric sampling region of the fixed image + moving_image_mask: + # type=file|default=: mask used to limit metric sampling region of the moving image + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=2|allowed[2,3,4]: Dimensionality of the fixed/moving image pair + metric: '"MI"' + # type=enum|default='CC'|allowed['CC','Demons','GC','MI','Mattes','MeanSquares']: + fixed_image: + # type=file|default=: Image to which the moving image is warped + moving_image: + # type=file|default=: Image to apply transformation to (generally a coregistered functional) + metric_weight: "1.0" + # type=float|default=1.0: The "metricWeight" variable is not used. + radius_or_number_of_bins: "5" + # type=int|default=0: The number of bins in each stage for the MI and Mattes metric, or the radius for other metrics + sampling_strategy: '"Regular"' + # type=enum|default='None'|allowed['None','Random','Regular']: Manner of choosing point set over which to optimize the metric. Defaults to "None" (i.e. a dense sampling of one sample per voxel). + sampling_percentage: "1.0" + # type=range|default=None: Percentage of points accessible to the sampling strategy over which to optimize the metric. + fixed_image_mask: + # type=file|default=: mask used to limit metric sampling region of the fixed image + moving_image_mask: + # type=file|default=: mask used to limit metric sampling region of the moving image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: MeasureImageSimilarity --dimensionality 3 --masks ["mask.nii","mask.nii.gz"] --metric MI["T1.nii","resting.nii",1.0,5,Regular,1.0] + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=2|allowed[2,3,4]: Dimensionality of the fixed/moving image pair + metric: '"MI"' + # type=enum|default='CC'|allowed['CC','Demons','GC','MI','Mattes','MeanSquares']: + fixed_image: '"T1.nii"' + # type=file|default=: Image to which the moving image is warped + moving_image: '"resting.nii"' + # type=file|default=: Image to apply transformation to (generally a coregistered functional) + metric_weight: "1.0" + # type=float|default=1.0: The "metricWeight" variable is not used. + radius_or_number_of_bins: "5" + # type=int|default=0: The number of bins in each stage for the MI and Mattes metric, or the radius for other metrics + sampling_strategy: '"Regular"' + # type=enum|default='None'|allowed['None','Random','Regular']: Manner of choosing point set over which to optimize the metric. Defaults to "None" (i.e. a dense sampling of one sample per voxel). + sampling_percentage: "1.0" + # type=range|default=None: Percentage of points accessible to the sampling strategy over which to optimize the metric. + fixed_image_mask: '"mask.nii"' + # type=file|default=: mask used to limit metric sampling region of the fixed image + moving_image_mask: '"mask.nii.gz"' + # type=file|default=: mask used to limit metric sampling region of the moving image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/measure_image_similarity_callables.py b/nipype-auto-conv/specs/interfaces/measure_image_similarity_callables.py similarity index 100% rename from nipype-auto-conv/specs/measure_image_similarity_callables.py rename to nipype-auto-conv/specs/interfaces/measure_image_similarity_callables.py diff --git a/nipype-auto-conv/specs/interfaces/multiply_images.yaml b/nipype-auto-conv/specs/interfaces/multiply_images.yaml new file mode 100644 index 0000000..2ce5944 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/multiply_images.yaml @@ -0,0 +1,146 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.utils.MultiplyImages' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Examples +# -------- +# >>> from nipype.interfaces.ants import MultiplyImages +# >>> test = MultiplyImages() +# >>> test.inputs.dimension = 3 +# >>> test.inputs.first_input = 'moving2.nii' +# >>> test.inputs.second_input = 0.25 +# >>> test.inputs.output_product_image = "out.nii" +# >>> test.cmdline +# 'MultiplyImages 3 moving2.nii 0.25 out.nii' +# +task_name: MultiplyImages +nipype_name: MultiplyImages +nipype_module: nipype.interfaces.ants.utils +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + first_input: medimage/nifti1 + # type=file|default=: image 1 + output_product_image: Path + # type=file: average image file + # type=file|default=: Outputfname.nii.gz: the name of the resulting image. + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_product_image: medimage/itk-image + # type=file: average image file + # type=file|default=: Outputfname.nii.gz: the name of the resulting image. + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + first_input: + # type=file|default=: image 1 + second_input: + # type=traitcompound|default=None: image 2 or multiplication weight + output_product_image: + # type=file: average image file + # type=file|default=: Outputfname.nii.gz: the name of the resulting image. + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + first_input: + # type=file|default=: image 1 + second_input: "0.25" + # type=traitcompound|default=None: image 2 or multiplication weight + output_product_image: '"out.nii"' + # type=file: average image file + # type=file|default=: Outputfname.nii.gz: the name of the resulting image. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: MultiplyImages 3 moving2.nii 0.25 out.nii + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + first_input: '"moving2.nii"' + # type=file|default=: image 1 + second_input: "0.25" + # type=traitcompound|default=None: image 2 or multiplication weight + output_product_image: '"out.nii"' + # type=file: average image file + # type=file|default=: Outputfname.nii.gz: the name of the resulting image. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/multiply_images_callables.py b/nipype-auto-conv/specs/interfaces/multiply_images_callables.py similarity index 100% rename from nipype-auto-conv/specs/multiply_images_callables.py rename to nipype-auto-conv/specs/interfaces/multiply_images_callables.py diff --git a/nipype-auto-conv/specs/interfaces/n4_bias_field_correction.yaml b/nipype-auto-conv/specs/interfaces/n4_bias_field_correction.yaml new file mode 100644 index 0000000..9e432cd --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/n4_bias_field_correction.yaml @@ -0,0 +1,381 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.segmentation.N4BiasFieldCorrection' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Bias field correction. +# +# N4 is a variant of the popular N3 (nonparameteric nonuniform normalization) +# retrospective bias correction algorithm. Based on the assumption that the +# corruption of the low frequency bias field can be modeled as a convolution of +# the intensity histogram by a Gaussian, the basic algorithmic protocol is to +# iterate between deconvolving the intensity histogram by a Gaussian, remapping +# the intensities, and then spatially smoothing this result by a B-spline modeling +# of the bias field itself. The modifications from and improvements obtained over +# the original N3 algorithm are described in [Tustison2010]_. +# +# .. [Tustison2010] N. Tustison et al., +# N4ITK: Improved N3 Bias Correction, IEEE Transactions on Medical Imaging, +# 29(6):1310-1320, June 2010. +# +# Examples +# -------- +# +# >>> import copy +# >>> from nipype.interfaces.ants import N4BiasFieldCorrection +# >>> n4 = N4BiasFieldCorrection() +# >>> n4.inputs.dimension = 3 +# >>> n4.inputs.input_image = 'structural.nii' +# >>> n4.inputs.bspline_fitting_distance = 300 +# >>> n4.inputs.shrink_factor = 3 +# >>> n4.inputs.n_iterations = [50,50,30,20] +# >>> n4.cmdline +# 'N4BiasFieldCorrection --bspline-fitting [ 300 ] +# -d 3 --input-image structural.nii +# --convergence [ 50x50x30x20 ] --output structural_corrected.nii +# --shrink-factor 3' +# +# >>> n4_2 = copy.deepcopy(n4) +# >>> n4_2.inputs.convergence_threshold = 1e-6 +# >>> n4_2.cmdline +# 'N4BiasFieldCorrection --bspline-fitting [ 300 ] +# -d 3 --input-image structural.nii +# --convergence [ 50x50x30x20, 1e-06 ] --output structural_corrected.nii +# --shrink-factor 3' +# +# >>> n4_3 = copy.deepcopy(n4_2) +# >>> n4_3.inputs.bspline_order = 5 +# >>> n4_3.cmdline +# 'N4BiasFieldCorrection --bspline-fitting [ 300, 5 ] +# -d 3 --input-image structural.nii +# --convergence [ 50x50x30x20, 1e-06 ] --output structural_corrected.nii +# --shrink-factor 3' +# +# >>> n4_4 = N4BiasFieldCorrection() +# >>> n4_4.inputs.input_image = 'structural.nii' +# >>> n4_4.inputs.save_bias = True +# >>> n4_4.inputs.dimension = 3 +# >>> n4_4.cmdline +# 'N4BiasFieldCorrection -d 3 --input-image structural.nii +# --output [ structural_corrected.nii, structural_bias.nii ]' +# +# >>> n4_5 = N4BiasFieldCorrection() +# >>> n4_5.inputs.input_image = 'structural.nii' +# >>> n4_5.inputs.dimension = 3 +# >>> n4_5.inputs.histogram_sharpening = (0.12, 0.02, 200) +# >>> n4_5.cmdline +# 'N4BiasFieldCorrection -d 3 --histogram-sharpening [0.12,0.02,200] +# --input-image structural.nii --output structural_corrected.nii' +# +# +task_name: N4BiasFieldCorrection +nipype_name: N4BiasFieldCorrection +nipype_module: nipype.interfaces.ants.segmentation +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + bias_image: Path + # type=file: Estimated bias + # type=file|default=: Filename for the estimated bias. + input_image: medimage/itk-image + # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction + mask_image: medimage/itk-image + # type=file|default=: image to specify region to perform final bias correction in + weight_image: medimage/itk-image + # type=file|default=: image for relative weighting (e.g. probability map of the white matter) of voxels during the B-spline fitting. + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + bias_image: medimage/itk-image + # type=file: Estimated bias + # type=file|default=: Filename for the estimated bias. + output_image: medimage/itk-image + # type=file: Warped image + # type=str|default='': output file name + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) + input_image: + # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction + mask_image: + # type=file|default=: image to specify region to perform final bias correction in + weight_image: + # type=file|default=: image for relative weighting (e.g. probability map of the white matter) of voxels during the B-spline fitting. + output_image: + # type=file: Warped image + # type=str|default='': output file name + bspline_fitting_distance: + # type=float|default=0.0: + bspline_order: + # type=int|default=0: + shrink_factor: + # type=int|default=0: + n_iterations: + # type=list|default=[]: + convergence_threshold: + # type=float|default=0.0: + save_bias: + # type=bool|default=False: True if the estimated bias should be saved to file. + bias_image: + # type=file: Estimated bias + # type=file|default=: Filename for the estimated bias. + copy_header: + # type=bool|default=False: copy headers of the original image into the output (corrected) file + rescale_intensities: + # type=bool|default=False: [NOTE: Only ANTs>=2.1.0] At each iteration, a new intensity mapping is calculated and applied but there is nothing which constrains the new intensity range to be within certain values. The result is that the range can "drift" from the original at each iteration. This option rescales to the [min,max] range of the original image intensities within the user-specified mask. + histogram_sharpening: + # type=tuple|default=(0.15, 0.01, 200): Three-values tuple of histogram sharpening parameters (FWHM, wienerNose, numberOfHistogramBins). These options describe the histogram sharpening parameters, i.e. the deconvolution step parameters described in the original N3 algorithm. The default values have been shown to work fairly well. + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) + input_image: + # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction + bspline_fitting_distance: "300" + # type=float|default=0.0: + shrink_factor: "3" + # type=int|default=0: + n_iterations: "[50,50,30,20]" + # type=list|default=[]: + imports: &id001 + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + - module: copy + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + convergence_threshold: 1e-6 + # type=float|default=0.0: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + bspline_order: "5" + # type=int|default=0: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction + save_bias: "True" + # type=bool|default=False: True if the estimated bias should be saved to file. + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) + histogram_sharpening: (0.12, 0.02, 200) + # type=tuple|default=(0.15, 0.01, 200): Three-values tuple of histogram sharpening parameters (FWHM, wienerNose, numberOfHistogramBins). These options describe the histogram sharpening parameters, i.e. the deconvolution step parameters described in the original N3 algorithm. The default values have been shown to work fairly well. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: N4BiasFieldCorrection --bspline-fitting [ 300 ] -d 3 --input-image structural.nii --convergence [ 50x50x30x20 ] --output structural_corrected.nii --shrink-factor 3 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) + input_image: '"structural.nii"' + # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction + bspline_fitting_distance: "300" + # type=float|default=0.0: + shrink_factor: "3" + # type=int|default=0: + n_iterations: "[50,50,30,20]" + # type=list|default=[]: + imports: *id001 + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: N4BiasFieldCorrection --bspline-fitting [ 300 ] -d 3 --input-image structural.nii --convergence [ 50x50x30x20, 1e-06 ] --output structural_corrected.nii --shrink-factor 3 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + convergence_threshold: 1e-6 + # type=float|default=0.0: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: N4BiasFieldCorrection --bspline-fitting [ 300, 5 ] -d 3 --input-image structural.nii --convergence [ 50x50x30x20, 1e-06 ] --output structural_corrected.nii --shrink-factor 3 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + bspline_order: "5" + # type=int|default=0: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: N4BiasFieldCorrection -d 3 --input-image structural.nii --output [ structural_corrected.nii, structural_bias.nii ] + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"structural.nii"' + # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction + save_bias: "True" + # type=bool|default=False: True if the estimated bias should be saved to file. + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: N4BiasFieldCorrection -d 3 --histogram-sharpening [0.12,0.02,200] --input-image structural.nii --output structural_corrected.nii + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"structural.nii"' + # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction + dimension: "3" + # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) + histogram_sharpening: (0.12, 0.02, 200) + # type=tuple|default=(0.15, 0.01, 200): Three-values tuple of histogram sharpening parameters (FWHM, wienerNose, numberOfHistogramBins). These options describe the histogram sharpening parameters, i.e. the deconvolution step parameters described in the original N3 algorithm. The default values have been shown to work fairly well. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/n4_bias_field_correction_callables.py b/nipype-auto-conv/specs/interfaces/n4_bias_field_correction_callables.py similarity index 100% rename from nipype-auto-conv/specs/n4_bias_field_correction_callables.py rename to nipype-auto-conv/specs/interfaces/n4_bias_field_correction_callables.py diff --git a/nipype-auto-conv/specs/interfaces/registration.yaml b/nipype-auto-conv/specs/interfaces/registration.yaml new file mode 100644 index 0000000..a3d319d --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/registration.yaml @@ -0,0 +1,1118 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.registration.Registration' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# ANTs Registration command for registration of images +# +# `antsRegistration `_ registers a ``moving_image`` to a ``fixed_image``, +# using a predefined (sequence of) cost function(s) and transformation operations. +# The cost function is defined using one or more 'metrics', specifically +# local cross-correlation (``CC``), Mean Squares (``MeanSquares``), Demons (``Demons``), +# global correlation (``GC``), or Mutual Information (``Mattes`` or ``MI``). +# +# ANTS can use both linear (``Translation``, ``Rigid``, ``Affine``, ``CompositeAffine``, +# or ``Translation``) and non-linear transformations (``BSpline``, ``GaussianDisplacementField``, +# ``TimeVaryingVelocityField``, ``TimeVaryingBSplineVelocityField``, ``SyN``, ``BSplineSyN``, +# ``Exponential``, or ``BSplineExponential``). Usually, registration is done in multiple +# *stages*. For example first an Affine, then a Rigid, and ultimately a non-linear +# (Syn)-transformation. +# +# antsRegistration can be initialized using one or more transforms from moving_image +# to fixed_image with the ``initial_moving_transform``-input. For example, when you +# already have a warpfield that corrects for geometrical distortions in an EPI (functional) image, +# that you want to apply before an Affine registration to a structural image. +# You could put this transform into 'intial_moving_transform'. +# +# The Registration-interface can output the resulting transform(s) that map moving_image to +# fixed_image in a single file as a ``composite_transform`` (if ``write_composite_transform`` +# is set to ``True``), or a list of transforms as ``forwards_transforms``. It can also output +# inverse transforms (from ``fixed_image`` to ``moving_image``) in a similar fashion using +# ``inverse_composite_transform``. Note that the order of ``forward_transforms`` is in 'natural' +# order: the first element should be applied first, the last element should be applied last. +# +# Note, however, that ANTS tools always apply lists of transformations in reverse order (the last +# transformation in the list is applied first). Therefore, if the output forward_transforms +# is a list, one can not directly feed it into, for example, ``ants.ApplyTransforms``. To +# make ``ants.ApplyTransforms`` apply the transformations in the same order as ``ants.Registration``, +# you have to provide the list of transformations in reverse order from ``forward_transforms``. +# ``reverse_forward_transforms`` outputs ``forward_transforms`` in reverse order and can be used for +# this purpose. Note also that, because ``composite_transform`` is always a single file, this +# output is preferred for most use-cases. +# +# More information can be found in the `ANTS +# manual `_. +# +# See below for some useful examples. +# +# Examples +# -------- +# +# Set up a Registration node with some default settings. This Node registers +# 'fixed1.nii' to 'moving1.nii' by first fitting a linear 'Affine' transformation, and +# then a non-linear 'SyN' transformation, both using the Mutual Information-cost +# metric. +# +# The registration is initialized by first applying the (linear) transform +# trans.mat. +# +# >>> import copy, pprint +# >>> from nipype.interfaces.ants import Registration +# >>> reg = Registration() +# >>> reg.inputs.fixed_image = 'fixed1.nii' +# >>> reg.inputs.moving_image = 'moving1.nii' +# >>> reg.inputs.output_transform_prefix = "output_" +# >>> reg.inputs.initial_moving_transform = 'trans.mat' +# >>> reg.inputs.transforms = ['Affine', 'SyN'] +# >>> reg.inputs.transform_parameters = [(2.0,), (0.25, 3.0, 0.0)] +# >>> reg.inputs.number_of_iterations = [[1500, 200], [100, 50, 30]] +# >>> reg.inputs.dimension = 3 +# >>> reg.inputs.write_composite_transform = True +# >>> reg.inputs.collapse_output_transforms = False +# >>> reg.inputs.initialize_transforms_per_stage = False +# >>> reg.inputs.metric = ['Mattes']*2 +# >>> reg.inputs.metric_weight = [1]*2 # Default (value ignored currently by ANTs) +# >>> reg.inputs.radius_or_number_of_bins = [32]*2 +# >>> reg.inputs.sampling_strategy = ['Random', None] +# >>> reg.inputs.sampling_percentage = [0.05, None] +# >>> reg.inputs.convergence_threshold = [1.e-8, 1.e-9] +# >>> reg.inputs.convergence_window_size = [20]*2 +# >>> reg.inputs.smoothing_sigmas = [[1,0], [2,1,0]] +# >>> reg.inputs.sigma_units = ['vox'] * 2 +# >>> reg.inputs.shrink_factors = [[2,1], [3,2,1]] +# >>> reg.inputs.use_estimate_learning_rate_once = [True, True] +# >>> reg.inputs.use_histogram_matching = [True, True] # This is the default +# >>> reg.inputs.output_warped_image = 'output_warped_image.nii.gz' +# >>> reg.cmdline +# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 0 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +# >>> reg.run() # doctest: +SKIP +# +# Same as reg1, but first invert the initial transform ('trans.mat') before applying it. +# +# >>> reg.inputs.invert_initial_moving_transform = True +# >>> reg1 = copy.deepcopy(reg) +# >>> reg1.inputs.winsorize_lower_quantile = 0.025 +# >>> reg1.cmdline +# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.025, 1.0 ] --write-composite-transform 1' +# >>> reg1.run() # doctest: +SKIP +# +# Clip extremely high intensity data points using winsorize_upper_quantile. All data points +# higher than the 0.975 quantile are set to the value of the 0.975 quantile. +# +# >>> reg2 = copy.deepcopy(reg) +# >>> reg2.inputs.winsorize_upper_quantile = 0.975 +# >>> reg2.cmdline +# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 0.975 ] --write-composite-transform 1' +# +# Clip extremely low intensity data points using winsorize_lower_quantile. All data points +# lower than the 0.025 quantile are set to the original value at the 0.025 quantile. +# +# +# >>> reg3 = copy.deepcopy(reg) +# >>> reg3.inputs.winsorize_lower_quantile = 0.025 +# >>> reg3.inputs.winsorize_upper_quantile = 0.975 +# >>> reg3.cmdline +# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.025, 0.975 ] --write-composite-transform 1' +# +# Use float instead of double for computations (saves memory usage) +# +# >>> reg3a = copy.deepcopy(reg) +# >>> reg3a.inputs.float = True +# >>> reg3a.cmdline +# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --float 1 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +# +# Force to use double instead of float for computations (more precision and memory usage). +# +# >>> reg3b = copy.deepcopy(reg) +# >>> reg3b.inputs.float = False +# >>> reg3b.cmdline +# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --float 0 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +# +# 'collapse_output_transforms' can be used to put all transformation in a single 'composite_transform'- +# file. Note that forward_transforms will now be an empty list. +# +# >>> # Test collapse transforms flag +# >>> reg4 = copy.deepcopy(reg) +# >>> reg4.inputs.save_state = 'trans.mat' +# >>> reg4.inputs.restore_state = 'trans.mat' +# >>> reg4.inputs.initialize_transforms_per_stage = True +# >>> reg4.inputs.collapse_output_transforms = True +# >>> outputs = reg4._list_outputs() +# >>> pprint.pprint(outputs) # doctest: +ELLIPSIS, +# {'composite_transform': '...data/output_Composite.h5', +# 'elapsed_time': , +# 'forward_invert_flags': [], +# 'forward_transforms': [], +# 'inverse_composite_transform': '...data/output_InverseComposite.h5', +# 'inverse_warped_image': , +# 'metric_value': , +# 'reverse_forward_invert_flags': [], +# 'reverse_forward_transforms': [], +# 'reverse_invert_flags': [], +# 'reverse_transforms': [], +# 'save_state': '...data/trans.mat', +# 'warped_image': '...data/output_warped_image.nii.gz'} +# >>> reg4.cmdline +# 'antsRegistration --collapse-output-transforms 1 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 1 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --restore-state trans.mat --save-state trans.mat --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +# +# +# >>> # Test collapse transforms flag +# >>> reg4b = copy.deepcopy(reg4) +# >>> reg4b.inputs.write_composite_transform = False +# >>> outputs = reg4b._list_outputs() +# >>> pprint.pprint(outputs) # doctest: +ELLIPSIS, +# {'composite_transform': , +# 'elapsed_time': , +# 'forward_invert_flags': [False, False], +# 'forward_transforms': ['...data/output_0GenericAffine.mat', +# '...data/output_1Warp.nii.gz'], +# 'inverse_composite_transform': , +# 'inverse_warped_image': , +# 'metric_value': , +# 'reverse_forward_invert_flags': [False, False], +# 'reverse_forward_transforms': ['...data/output_1Warp.nii.gz', +# '...data/output_0GenericAffine.mat'], +# 'reverse_invert_flags': [True, False], +# 'reverse_transforms': ['...data/output_0GenericAffine.mat', '...data/output_1InverseWarp.nii.gz'], +# 'save_state': '...data/trans.mat', +# 'warped_image': '...data/output_warped_image.nii.gz'} +# >>> reg4b.aggregate_outputs() # doctest: +SKIP +# >>> reg4b.cmdline +# 'antsRegistration --collapse-output-transforms 1 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 1 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --restore-state trans.mat --save-state trans.mat --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 0' +# +# One can use multiple similarity metrics in a single registration stage.The Node below first +# performs a linear registation using only the Mutual Information ('Mattes')-metric. +# In a second stage, it performs a non-linear registration ('Syn') using both a +# Mutual Information and a local cross-correlation ('CC')-metric. Both metrics are weighted +# equally ('metric_weight' is .5 for both). The Mutual Information- metric uses 32 bins. +# The local cross-correlations (correlations between every voxel's neighborhoods) is computed +# with a radius of 4. +# +# >>> # Test multiple metrics per stage +# >>> reg5 = copy.deepcopy(reg) +# >>> reg5.inputs.fixed_image = 'fixed1.nii' +# >>> reg5.inputs.moving_image = 'moving1.nii' +# >>> reg5.inputs.metric = ['Mattes', ['Mattes', 'CC']] +# >>> reg5.inputs.metric_weight = [1, [.5,.5]] +# >>> reg5.inputs.radius_or_number_of_bins = [32, [32, 4] ] +# >>> reg5.inputs.sampling_strategy = ['Random', None] # use default strategy in second stage +# >>> reg5.inputs.sampling_percentage = [0.05, [0.05, 0.10]] +# >>> reg5.cmdline +# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 0.5, 32, None, 0.05 ] --metric CC[ fixed1.nii, moving1.nii, 0.5, 4, None, 0.1 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +# +# ANTS Registration can also use multiple modalities to perform the registration. Here it is assumed +# that fixed1.nii and fixed2.nii are in the same space, and so are moving1.nii and +# moving2.nii. First, a linear registration is performed matching fixed1.nii to moving1.nii, +# then a non-linear registration is performed to match fixed2.nii to moving2.nii, starting from +# the transformation of the first step. +# +# >>> # Test multiple inputS +# >>> reg6 = copy.deepcopy(reg5) +# >>> reg6.inputs.fixed_image = ['fixed1.nii', 'fixed2.nii'] +# >>> reg6.inputs.moving_image = ['moving1.nii', 'moving2.nii'] +# >>> reg6.cmdline +# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 0.5, 32, None, 0.05 ] --metric CC[ fixed2.nii, moving2.nii, 0.5, 4, None, 0.1 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +# +# Different methods can be used for the interpolation when applying transformations. +# +# >>> # Test Interpolation Parameters (BSpline) +# >>> reg7a = copy.deepcopy(reg) +# >>> reg7a.inputs.interpolation = 'BSpline' +# >>> reg7a.inputs.interpolation_parameters = (3,) +# >>> reg7a.cmdline +# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation BSpline[ 3 ] --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +# +# >>> # Test Interpolation Parameters (MultiLabel/Gaussian) +# >>> reg7b = copy.deepcopy(reg) +# >>> reg7b.inputs.interpolation = 'Gaussian' +# >>> reg7b.inputs.interpolation_parameters = (1.0, 1.0) +# >>> reg7b.cmdline +# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Gaussian[ 1.0, 1.0 ] --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +# +# BSplineSyN non-linear registration with custom parameters. +# +# >>> # Test Extended Transform Parameters +# >>> reg8 = copy.deepcopy(reg) +# >>> reg8.inputs.transforms = ['Affine', 'BSplineSyN'] +# >>> reg8.inputs.transform_parameters = [(2.0,), (0.25, 26, 0, 3)] +# >>> reg8.cmdline +# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform BSplineSyN[ 0.25, 26, 0, 3 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +# +# Mask the fixed image in the second stage of the registration (but not the first). +# +# >>> # Test masking +# >>> reg9 = copy.deepcopy(reg) +# >>> reg9.inputs.fixed_image_masks = ['NULL', 'fixed1.nii'] +# >>> reg9.cmdline +# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --masks [ NULL, NULL ] --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --masks [ fixed1.nii, NULL ] --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +# +# Here we use both a warpfield and a linear transformation, before registration commences. Note that +# the first transformation that needs to be applied ('ants_Warp.nii.gz') is last in the list of +# 'initial_moving_transform'. +# +# >>> # Test initialization with multiple transforms matrices (e.g., unwarp and affine transform) +# >>> reg10 = copy.deepcopy(reg) +# >>> reg10.inputs.initial_moving_transform = ['func_to_struct.mat', 'ants_Warp.nii.gz'] +# >>> reg10.inputs.invert_initial_moving_transform = [False, False] +# >>> reg10.cmdline +# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ func_to_struct.mat, 0 ] [ ants_Warp.nii.gz, 0 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' +# +task_name: Registration +nipype_name: Registration +nipype_module: nipype.interfaces.ants.registration +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + fixed_image: medimage/itk-image+list-of + # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) + fixed_image_mask: generic/file + # type=file|default=: Mask used to limit metric sampling region of the fixed imagein all stages + initial_moving_transform: datascience/text-matrix+list-of + # type=inputmultiobject|default=[]: A transform or a list of transforms that should be applied before the registration begins. Note that, when a list is given, the transformations are applied in reverse order. + moving_image: medimage/itk-image+list-of + # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to + moving_image_mask: generic/file + # type=file|default=: mask used to limit metric sampling region of the moving imagein all stages + restore_state: datascience/text-matrix + # type=file|default=: Filename for restoring the internal restorable state of the registration + save_state: Path + # type=file: The saved registration state to be restored + # type=file|default=: Filename for saving the internal restorable state of the registration + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + composite_transform: generic/file + # type=file: Composite transform file + forward_transforms: generic/file+list-of + # type=list: List of output transforms for forward registration + inverse_composite_transform: generic/file + # type=file: Inverse composite transform file + inverse_warped_image: medimage/itk-image + # type=file: Outputs the inverse of the warped image + reverse_forward_transforms: generic/file+list-of + # type=list: List of output transforms for forward registration reversed for antsApplyTransform + reverse_transforms: generic/file+list-of + # type=list: List of output transforms for reverse registration + save_state: datascience/text-matrix + # type=file: The saved registration state to be restored + # type=file|default=: Filename for saving the internal restorable state of the registration + warped_image: medimage/itk-image + # type=file: Outputs warped image + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + elapsed_time: elapsed_time_callable + # type=float: the total elapsed time as reported by ANTs + metric_value: metric_value_callable + # type=float: the final value of metric + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + fixed_image: + # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) + fixed_image_mask: + # type=file|default=: Mask used to limit metric sampling region of the fixed imagein all stages + fixed_image_masks: + # type=inputmultiobject|default=[]: Masks used to limit metric sampling region of the fixed image, defined per registration stage(Use "NULL" to omit a mask at a given stage) + moving_image: + # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to + moving_image_mask: + # type=file|default=: mask used to limit metric sampling region of the moving imagein all stages + moving_image_masks: + # type=inputmultiobject|default=[]: Masks used to limit metric sampling region of the moving image, defined per registration stage(Use "NULL" to omit a mask at a given stage) + save_state: + # type=file: The saved registration state to be restored + # type=file|default=: Filename for saving the internal restorable state of the registration + restore_state: + # type=file|default=: Filename for restoring the internal restorable state of the registration + initial_moving_transform: + # type=inputmultiobject|default=[]: A transform or a list of transforms that should be applied before the registration begins. Note that, when a list is given, the transformations are applied in reverse order. + invert_initial_moving_transform: + # type=inputmultiobject|default=[]: One boolean or a list of booleans that indicatewhether the inverse(s) of the transform(s) definedin initial_moving_transform should be used. + initial_moving_transform_com: + # type=enum|default=0|allowed[0,1,2]: Align the moving_image and fixed_image before registration using the geometric center of the images (=0), the image intensities (=1), or the origin of the images (=2). + metric_item_trait: + # type=enum|default='CC'|allowed['CC','Demons','GC','MI','Mattes','MeanSquares']: + metric_stage_trait: + # type=traitcompound|default=None: + metric: + # type=list|default=[]: the metric(s) to use for each stage. Note that multiple metrics per stage are not supported in ANTS 1.9.1 and earlier. + metric_weight_item_trait: + # type=float|default=1.0: + metric_weight_stage_trait: + # type=traitcompound|default=None: + metric_weight: + # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. + radius_bins_item_trait: + # type=int|default=5: + radius_bins_stage_trait: + # type=traitcompound|default=None: + radius_or_number_of_bins: + # type=list|default=[5]: the number of bins in each stage for the MI and Mattes metric, the radius for other metrics + sampling_strategy_item_trait: + # type=enum|default='None'|allowed['None','Random','Regular',None]: + sampling_strategy_stage_trait: + # type=traitcompound|default=None: + sampling_strategy: + # type=list|default=[]: the metric sampling strategy (strategies) for each stage + sampling_percentage_item_trait: + # type=traitcompound|default=None: + sampling_percentage_stage_trait: + # type=traitcompound|default=None: + sampling_percentage: + # type=list|default=[]: the metric sampling percentage(s) to use for each stage + use_estimate_learning_rate_once: + # type=list|default=[]: + use_histogram_matching: + # type=traitcompound|default=True: Histogram match the images before registration. + interpolation: + # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','GenericLabel','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: + interpolation_parameters: + # type=traitcompound|default=None: + write_composite_transform: + # type=bool|default=False: + collapse_output_transforms: + # type=bool|default=True: Collapse output transforms. Specifically, enabling this option combines all adjacent linear transforms and composes all adjacent displacement field transforms before writing the results to disk. + initialize_transforms_per_stage: + # type=bool|default=False: Initialize linear transforms from the previous stage. By enabling this option, the current linear stage transform is directly initialized from the previous stages linear transform; this allows multiple linear stages to be run where each stage directly updates the estimated linear transform from the previous stage. (e.g. Translation -> Rigid -> Affine). + float: + # type=bool|default=False: Use float instead of double for computations. + transforms: + # type=list|default=[]: + transform_parameters: + # type=list|default=[]: + restrict_deformation: + # type=list|default=[]: This option allows the user to restrict the optimization of the displacement field, translation, rigid or affine transform on a per-component basis. For example, if one wants to limit the deformation or rotation of 3-D volume to the first two dimensions, this is possible by specifying a weight vector of '1x1x0' for a deformation field or '1x1x0x1x1x0' for a rigid transformation. Low-dimensional restriction only works if there are no preceding transformations. + number_of_iterations: + # type=list|default=[]: + smoothing_sigmas: + # type=list|default=[]: + sigma_units: + # type=list|default=[]: units for smoothing sigmas + shrink_factors: + # type=list|default=[]: + convergence_threshold: + # type=list|default=[1e-06]: + convergence_window_size: + # type=list|default=[10]: + output_transform_prefix: + # type=str|default='transform': + output_warped_image: + # type=traitcompound|default=None: + output_inverse_warped_image: + # type=traitcompound|default=None: + winsorize_upper_quantile: + # type=range|default=1.0: The Upper quantile to clip image ranges + winsorize_lower_quantile: + # type=range|default=0.0: The Lower quantile to clip image ranges + random_seed: + # type=int|default=0: Fixed seed for random number generation + verbose: + # type=bool|default=False: + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + fixed_image: + # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) + moving_image: + # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to + output_transform_prefix: '"output_"' + # type=str|default='transform': + initial_moving_transform: + # type=inputmultiobject|default=[]: A transform or a list of transforms that should be applied before the registration begins. Note that, when a list is given, the transformations are applied in reverse order. + transforms: '["Affine", "SyN"]' + # type=list|default=[]: + transform_parameters: "[(2.0,), (0.25, 3.0, 0.0)]" + # type=list|default=[]: + number_of_iterations: "[[1500, 200], [100, 50, 30]]" + # type=list|default=[]: + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + write_composite_transform: "True" + # type=bool|default=False: + collapse_output_transforms: "False" + # type=bool|default=True: Collapse output transforms. Specifically, enabling this option combines all adjacent linear transforms and composes all adjacent displacement field transforms before writing the results to disk. + initialize_transforms_per_stage: "False" + # type=bool|default=False: Initialize linear transforms from the previous stage. By enabling this option, the current linear stage transform is directly initialized from the previous stages linear transform; this allows multiple linear stages to be run where each stage directly updates the estimated linear transform from the previous stage. (e.g. Translation -> Rigid -> Affine). + metric: '["Mattes"]*2' + # type=list|default=[]: the metric(s) to use for each stage. Note that multiple metrics per stage are not supported in ANTS 1.9.1 and earlier. + metric_weight: "[1]*2 # Default (value ignored currently by ANTs)" + # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. + radius_or_number_of_bins: "[32]*2" + # type=list|default=[5]: the number of bins in each stage for the MI and Mattes metric, the radius for other metrics + sampling_strategy: '["Random", None]' + # type=list|default=[]: the metric sampling strategy (strategies) for each stage + sampling_percentage: "[0.05, None]" + # type=list|default=[]: the metric sampling percentage(s) to use for each stage + convergence_threshold: "[1.e-8, 1.e-9]" + # type=list|default=[1e-06]: + convergence_window_size: "[20]*2" + # type=list|default=[10]: + smoothing_sigmas: "[[1,0], [2,1,0]]" + # type=list|default=[]: + sigma_units: '["vox"] * 2' + # type=list|default=[]: units for smoothing sigmas + shrink_factors: "[[2,1], [3,2,1]]" + # type=list|default=[]: + use_estimate_learning_rate_once: "[True, True]" + # type=list|default=[]: + use_histogram_matching: "[True, True] # This is the default" + # type=traitcompound|default=True: Histogram match the images before registration. + output_warped_image: '"output_warped_image.nii.gz"' + # type=traitcompound|default=None: + imports: &id001 + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + - module: copy + - module: pprint + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + invert_initial_moving_transform: "True" + # type=inputmultiobject|default=[]: One boolean or a list of booleans that indicatewhether the inverse(s) of the transform(s) definedin initial_moving_transform should be used. + winsorize_lower_quantile: "0.025" + # type=range|default=0.0: The Lower quantile to clip image ranges + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + winsorize_upper_quantile: "0.975" + # type=range|default=1.0: The Upper quantile to clip image ranges + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + winsorize_lower_quantile: "0.025" + # type=range|default=0.0: The Lower quantile to clip image ranges + winsorize_upper_quantile: "0.975" + # type=range|default=1.0: The Upper quantile to clip image ranges + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + float: "True" + # type=bool|default=False: Use float instead of double for computations. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + float: "False" + # type=bool|default=False: Use float instead of double for computations. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + save_state: '"trans.mat"' + # type=file: The saved registration state to be restored + # type=file|default=: Filename for saving the internal restorable state of the registration + restore_state: + # type=file|default=: Filename for restoring the internal restorable state of the registration + initialize_transforms_per_stage: "True" + # type=bool|default=False: Initialize linear transforms from the previous stage. By enabling this option, the current linear stage transform is directly initialized from the previous stages linear transform; this allows multiple linear stages to be run where each stage directly updates the estimated linear transform from the previous stage. (e.g. Translation -> Rigid -> Affine). + collapse_output_transforms: "True" + # type=bool|default=True: Collapse output transforms. Specifically, enabling this option combines all adjacent linear transforms and composes all adjacent displacement field transforms before writing the results to disk. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + write_composite_transform: "False" + # type=bool|default=False: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + fixed_image: + # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) + moving_image: + # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to + metric: '["Mattes", ["Mattes", "CC"]]' + # type=list|default=[]: the metric(s) to use for each stage. Note that multiple metrics per stage are not supported in ANTS 1.9.1 and earlier. + metric_weight: "[1, [.5,.5]]" + # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. + radius_or_number_of_bins: "[32, [32, 4] ]" + # type=list|default=[5]: the number of bins in each stage for the MI and Mattes metric, the radius for other metrics + sampling_strategy: '["Random", None] # use default strategy in second stage' + # type=list|default=[]: the metric sampling strategy (strategies) for each stage + sampling_percentage: "[0.05, [0.05, 0.10]]" + # type=list|default=[]: the metric sampling percentage(s) to use for each stage + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + fixed_image: + # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) + moving_image: + # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + interpolation: '"BSpline"' + # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','GenericLabel','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: + interpolation_parameters: (3,) + # type=traitcompound|default=None: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + interpolation: '"Gaussian"' + # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','GenericLabel','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: + interpolation_parameters: (1.0, 1.0) + # type=traitcompound|default=None: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + transforms: '["Affine", "BSplineSyN"]' + # type=list|default=[]: + transform_parameters: "[(2.0,), (0.25, 26, 0, 3)]" + # type=list|default=[]: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + fixed_image_masks: '["NULL", "fixed1.nii"]' + # type=inputmultiobject|default=[]: Masks used to limit metric sampling region of the fixed image, defined per registration stage(Use "NULL" to omit a mask at a given stage) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + initial_moving_transform: + # type=inputmultiobject|default=[]: A transform or a list of transforms that should be applied before the registration begins. Note that, when a list is given, the transformations are applied in reverse order. + invert_initial_moving_transform: "[False, False]" + # type=inputmultiobject|default=[]: One boolean or a list of booleans that indicatewhether the inverse(s) of the transform(s) definedin initial_moving_transform should be used. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 0 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + fixed_image: '"fixed1.nii"' + # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) + moving_image: '"moving1.nii"' + # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to + output_transform_prefix: '"output_"' + # type=str|default='transform': + initial_moving_transform: '"trans.mat"' + # type=inputmultiobject|default=[]: A transform or a list of transforms that should be applied before the registration begins. Note that, when a list is given, the transformations are applied in reverse order. + transforms: '["Affine", "SyN"]' + # type=list|default=[]: + transform_parameters: "[(2.0,), (0.25, 3.0, 0.0)]" + # type=list|default=[]: + number_of_iterations: "[[1500, 200], [100, 50, 30]]" + # type=list|default=[]: + dimension: "3" + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + write_composite_transform: "True" + # type=bool|default=False: + collapse_output_transforms: "False" + # type=bool|default=True: Collapse output transforms. Specifically, enabling this option combines all adjacent linear transforms and composes all adjacent displacement field transforms before writing the results to disk. + initialize_transforms_per_stage: "False" + # type=bool|default=False: Initialize linear transforms from the previous stage. By enabling this option, the current linear stage transform is directly initialized from the previous stages linear transform; this allows multiple linear stages to be run where each stage directly updates the estimated linear transform from the previous stage. (e.g. Translation -> Rigid -> Affine). + metric: '["Mattes"]*2' + # type=list|default=[]: the metric(s) to use for each stage. Note that multiple metrics per stage are not supported in ANTS 1.9.1 and earlier. + metric_weight: "[1]*2 # Default (value ignored currently by ANTs)" + # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. + radius_or_number_of_bins: "[32]*2" + # type=list|default=[5]: the number of bins in each stage for the MI and Mattes metric, the radius for other metrics + sampling_strategy: '["Random", None]' + # type=list|default=[]: the metric sampling strategy (strategies) for each stage + sampling_percentage: "[0.05, None]" + # type=list|default=[]: the metric sampling percentage(s) to use for each stage + convergence_threshold: "[1.e-8, 1.e-9]" + # type=list|default=[1e-06]: + convergence_window_size: "[20]*2" + # type=list|default=[10]: + smoothing_sigmas: "[[1,0], [2,1,0]]" + # type=list|default=[]: + sigma_units: '["vox"] * 2' + # type=list|default=[]: units for smoothing sigmas + shrink_factors: "[[2,1], [3,2,1]]" + # type=list|default=[]: + use_estimate_learning_rate_once: "[True, True]" + # type=list|default=[]: + use_histogram_matching: "[True, True] # This is the default" + # type=traitcompound|default=True: Histogram match the images before registration. + output_warped_image: '"output_warped_image.nii.gz"' + # type=traitcompound|default=None: + imports: *id001 + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.025, 1.0 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + invert_initial_moving_transform: "True" + # type=inputmultiobject|default=[]: One boolean or a list of booleans that indicatewhether the inverse(s) of the transform(s) definedin initial_moving_transform should be used. + winsorize_lower_quantile: "0.025" + # type=range|default=0.0: The Lower quantile to clip image ranges + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 0.975 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + winsorize_upper_quantile: "0.975" + # type=range|default=1.0: The Upper quantile to clip image ranges + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.025, 0.975 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + winsorize_lower_quantile: "0.025" + # type=range|default=0.0: The Lower quantile to clip image ranges + winsorize_upper_quantile: "0.975" + # type=range|default=1.0: The Upper quantile to clip image ranges + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --float 1 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + float: "True" + # type=bool|default=False: Use float instead of double for computations. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --float 0 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + float: "False" + # type=bool|default=False: Use float instead of double for computations. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 1 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 1 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --restore-state trans.mat --save-state trans.mat --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + save_state: '"trans.mat"' + # type=file: The saved registration state to be restored + # type=file|default=: Filename for saving the internal restorable state of the registration + restore_state: '"trans.mat"' + # type=file|default=: Filename for restoring the internal restorable state of the registration + initialize_transforms_per_stage: "True" + # type=bool|default=False: Initialize linear transforms from the previous stage. By enabling this option, the current linear stage transform is directly initialized from the previous stages linear transform; this allows multiple linear stages to be run where each stage directly updates the estimated linear transform from the previous stage. (e.g. Translation -> Rigid -> Affine). + collapse_output_transforms: "True" + # type=bool|default=True: Collapse output transforms. Specifically, enabling this option combines all adjacent linear transforms and composes all adjacent displacement field transforms before writing the results to disk. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 1 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 1 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --restore-state trans.mat --save-state trans.mat --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 0 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + write_composite_transform: "False" + # type=bool|default=False: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 0.5, 32, None, 0.05 ] --metric CC[ fixed1.nii, moving1.nii, 0.5, 4, None, 0.1 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + fixed_image: '"fixed1.nii"' + # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) + moving_image: '"moving1.nii"' + # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to + metric: '["Mattes", ["Mattes", "CC"]]' + # type=list|default=[]: the metric(s) to use for each stage. Note that multiple metrics per stage are not supported in ANTS 1.9.1 and earlier. + metric_weight: "[1, [.5,.5]]" + # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. + radius_or_number_of_bins: "[32, [32, 4] ]" + # type=list|default=[5]: the number of bins in each stage for the MI and Mattes metric, the radius for other metrics + sampling_strategy: '["Random", None] # use default strategy in second stage' + # type=list|default=[]: the metric sampling strategy (strategies) for each stage + sampling_percentage: "[0.05, [0.05, 0.10]]" + # type=list|default=[]: the metric sampling percentage(s) to use for each stage + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 0.5, 32, None, 0.05 ] --metric CC[ fixed2.nii, moving2.nii, 0.5, 4, None, 0.1 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + fixed_image: '["fixed1.nii", "fixed2.nii"]' + # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) + moving_image: '["moving1.nii", "moving2.nii"]' + # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation BSpline[ 3 ] --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + interpolation: '"BSpline"' + # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','GenericLabel','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: + interpolation_parameters: (3,) + # type=traitcompound|default=None: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Gaussian[ 1.0, 1.0 ] --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + interpolation: '"Gaussian"' + # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','GenericLabel','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: + interpolation_parameters: (1.0, 1.0) + # type=traitcompound|default=None: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform BSplineSyN[ 0.25, 26, 0, 3 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + transforms: '["Affine", "BSplineSyN"]' + # type=list|default=[]: + transform_parameters: "[(2.0,), (0.25, 26, 0, 3)]" + # type=list|default=[]: + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --masks [ NULL, NULL ] --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --masks [ fixed1.nii, NULL ] --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + fixed_image_masks: '["NULL", "fixed1.nii"]' + # type=inputmultiobject|default=[]: Masks used to limit metric sampling region of the fixed image, defined per registration stage(Use "NULL" to omit a mask at a given stage) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ func_to_struct.mat, 0 ] [ ants_Warp.nii.gz, 0 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + initial_moving_transform: '["func_to_struct.mat", "ants_Warp.nii.gz"]' + # type=inputmultiobject|default=[]: A transform or a list of transforms that should be applied before the registration begins. Note that, when a list is given, the transformations are applied in reverse order. + invert_initial_moving_transform: "[False, False]" + # type=inputmultiobject|default=[]: One boolean or a list of booleans that indicatewhether the inverse(s) of the transform(s) definedin initial_moving_transform should be used. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/registration_callables.py b/nipype-auto-conv/specs/interfaces/registration_callables.py similarity index 100% rename from nipype-auto-conv/specs/registration_callables.py rename to nipype-auto-conv/specs/interfaces/registration_callables.py diff --git a/nipype-auto-conv/specs/interfaces/registration_syn_quick.yaml b/nipype-auto-conv/specs/interfaces/registration_syn_quick.yaml new file mode 100644 index 0000000..eac0fb2 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/registration_syn_quick.yaml @@ -0,0 +1,214 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.registration.RegistrationSynQuick' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Registration using a symmetric image normalization method (SyN). +# You can read more in Avants et al.; Med Image Anal., 2008 +# (https://www.ncbi.nlm.nih.gov/pubmed/17659998). +# +# Examples +# -------- +# +# >>> from nipype.interfaces.ants import RegistrationSynQuick +# >>> reg = RegistrationSynQuick() +# >>> reg.inputs.fixed_image = 'fixed1.nii' +# >>> reg.inputs.moving_image = 'moving1.nii' +# >>> reg.inputs.num_threads = 2 +# >>> reg.cmdline +# 'antsRegistrationSyNQuick.sh -d 3 -f fixed1.nii -r 32 -m moving1.nii -n 2 -o transform -p d -s 26 -t s' +# >>> reg.run() # doctest: +SKIP +# +# example for multiple images +# +# >>> from nipype.interfaces.ants import RegistrationSynQuick +# >>> reg = RegistrationSynQuick() +# >>> reg.inputs.fixed_image = ['fixed1.nii', 'fixed2.nii'] +# >>> reg.inputs.moving_image = ['moving1.nii', 'moving2.nii'] +# >>> reg.inputs.num_threads = 2 +# >>> reg.cmdline +# 'antsRegistrationSyNQuick.sh -d 3 -f fixed1.nii -f fixed2.nii -r 32 -m moving1.nii -m moving2.nii -n 2 -o transform -p d -s 26 -t s' +# >>> reg.run() # doctest: +SKIP +# +task_name: RegistrationSynQuick +nipype_name: RegistrationSynQuick +nipype_module: nipype.interfaces.ants.registration +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + fixed_image: medimage/itk-image+list-of + # type=inputmultiobject|default=[]: Fixed image or source image or reference image + moving_image: medimage/itk-image+list-of + # type=inputmultiobject|default=[]: Moving image or target image + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + forward_warp_field: generic/file + # type=file: Forward warp field + inverse_warp_field: generic/file + # type=file: Inverse warp field + inverse_warped_image: medimage/itk-image + # type=file: Inverse warped image + out_matrix: generic/file + # type=file: Affine matrix + warped_image: medimage/itk-image + # type=file: Warped image + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + fixed_image: + # type=inputmultiobject|default=[]: Fixed image or source image or reference image + moving_image: + # type=inputmultiobject|default=[]: Moving image or target image + output_prefix: + # type=str|default='transform': A prefix that is prepended to all output files + num_threads: + # type=int|default=1: Number of threads (default = 1) + transform_type: + # type=enum|default='s'|allowed['a','b','br','r','s','sr','t']: Transform type * t: translation * r: rigid * a: rigid + affine * s: rigid + affine + deformable syn (default) * sr: rigid + deformable syn * b: rigid + affine + deformable b-spline syn * br: rigid + deformable b-spline syn + use_histogram_matching: + # type=bool|default=False: use histogram matching + histogram_bins: + # type=int|default=32: histogram bins for mutual information in SyN stage (default = 32) + spline_distance: + # type=int|default=26: spline distance for deformable B-spline SyN transform (default = 26) + precision_type: + # type=enum|default='double'|allowed['double','float']: precision type (default = double) + random_seed: + # type=int|default=0: fixed random seed + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + fixed_image: + # type=inputmultiobject|default=[]: Fixed image or source image or reference image + moving_image: + # type=inputmultiobject|default=[]: Moving image or target image + num_threads: "2" + # type=int|default=1: Number of threads (default = 1) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + fixed_image: + # type=inputmultiobject|default=[]: Fixed image or source image or reference image + moving_image: + # type=inputmultiobject|default=[]: Moving image or target image + num_threads: "2" + # type=int|default=1: Number of threads (default = 1) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: antsRegistrationSyNQuick.sh -d 3 -f fixed1.nii -r 32 -m moving1.nii -n 2 -o transform -p d -s 26 -t s + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + fixed_image: '"fixed1.nii"' + # type=inputmultiobject|default=[]: Fixed image or source image or reference image + moving_image: '"moving1.nii"' + # type=inputmultiobject|default=[]: Moving image or target image + num_threads: "2" + # type=int|default=1: Number of threads (default = 1) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: antsRegistrationSyNQuick.sh -d 3 -f fixed1.nii -f fixed2.nii -r 32 -m moving1.nii -m moving2.nii -n 2 -o transform -p d -s 26 -t s + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + fixed_image: '["fixed1.nii", "fixed2.nii"]' + # type=inputmultiobject|default=[]: Fixed image or source image or reference image + moving_image: '["moving1.nii", "moving2.nii"]' + # type=inputmultiobject|default=[]: Moving image or target image + num_threads: "2" + # type=int|default=1: Number of threads (default = 1) + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/registration_syn_quick_callables.py b/nipype-auto-conv/specs/interfaces/registration_syn_quick_callables.py similarity index 100% rename from nipype-auto-conv/specs/registration_syn_quick_callables.py rename to nipype-auto-conv/specs/interfaces/registration_syn_quick_callables.py diff --git a/nipype-auto-conv/specs/interfaces/resample_image_by_spacing.yaml b/nipype-auto-conv/specs/interfaces/resample_image_by_spacing.yaml new file mode 100644 index 0000000..1ed8d41 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/resample_image_by_spacing.yaml @@ -0,0 +1,281 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.utils.ResampleImageBySpacing' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Resample an image with a given spacing. +# +# Examples +# -------- +# >>> res = ResampleImageBySpacing(dimension=3) +# >>> res.inputs.input_image = 'structural.nii' +# >>> res.inputs.output_image = 'output.nii.gz' +# >>> res.inputs.out_spacing = (4, 4, 4) +# >>> res.cmdline #doctest: +ELLIPSIS +# 'ResampleImageBySpacing 3 structural.nii output.nii.gz 4 4 4' +# +# >>> res = ResampleImageBySpacing(dimension=3) +# >>> res.inputs.input_image = 'structural.nii' +# >>> res.inputs.output_image = 'output.nii.gz' +# >>> res.inputs.out_spacing = (4, 4, 4) +# >>> res.inputs.apply_smoothing = True +# >>> res.cmdline #doctest: +ELLIPSIS +# 'ResampleImageBySpacing 3 structural.nii output.nii.gz 4 4 4 1' +# +# >>> res = ResampleImageBySpacing(dimension=3) +# >>> res.inputs.input_image = 'structural.nii' +# >>> res.inputs.output_image = 'output.nii.gz' +# >>> res.inputs.out_spacing = (0.4, 0.4, 0.4) +# >>> res.inputs.apply_smoothing = True +# >>> res.inputs.addvox = 2 +# >>> res.inputs.nn_interp = False +# >>> res.cmdline #doctest: +ELLIPSIS +# 'ResampleImageBySpacing 3 structural.nii output.nii.gz 0.4 0.4 0.4 1 2 0' +# +# +task_name: ResampleImageBySpacing +nipype_name: ResampleImageBySpacing +nipype_module: nipype.interfaces.ants.utils +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + input_image: medimage/itk-image + # type=file|default=: input image file + output_image: Path + # type=file: resampled file + # type=file|default=: output image file + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_image: medimage/itk-image + # type=file: resampled file + # type=file|default=: output image file + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=int|default=3: dimension of output image + input_image: + # type=file|default=: input image file + output_image: + # type=file: resampled file + # type=file|default=: output image file + out_spacing: + # type=traitcompound|default=None: output spacing + apply_smoothing: + # type=bool|default=False: smooth before resampling + addvox: + # type=int|default=0: addvox pads each dimension by addvox + nn_interp: + # type=bool|default=False: nn interpolation + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: input image file + output_image: '"output.nii.gz"' + # type=file: resampled file + # type=file|default=: output image file + out_spacing: (4, 4, 4) + # type=traitcompound|default=None: output spacing + dimension: "3" + # type=int|default=3: dimension of output image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: input image file + output_image: '"output.nii.gz"' + # type=file: resampled file + # type=file|default=: output image file + out_spacing: (4, 4, 4) + # type=traitcompound|default=None: output spacing + apply_smoothing: "True" + # type=bool|default=False: smooth before resampling + dimension: "3" + # type=int|default=3: dimension of output image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: input image file + output_image: '"output.nii.gz"' + # type=file: resampled file + # type=file|default=: output image file + out_spacing: (0.4, 0.4, 0.4) + # type=traitcompound|default=None: output spacing + apply_smoothing: "True" + # type=bool|default=False: smooth before resampling + addvox: "2" + # type=int|default=0: addvox pads each dimension by addvox + nn_interp: "False" + # type=bool|default=False: nn interpolation + dimension: "3" + # type=int|default=3: dimension of output image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"structural.nii"' + # type=file|default=: input image file + output_image: '"output.nii.gz"' + # type=file: resampled file + # type=file|default=: output image file + out_spacing: (4, 4, 4) + # type=traitcompound|default=None: output spacing + dimension: "3" + # type=int|default=3: dimension of output image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"structural.nii"' + # type=file|default=: input image file + output_image: '"output.nii.gz"' + # type=file: resampled file + # type=file|default=: output image file + out_spacing: (4, 4, 4) + # type=traitcompound|default=None: output spacing + apply_smoothing: "True" + # type=bool|default=False: smooth before resampling + dimension: "3" + # type=int|default=3: dimension of output image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"structural.nii"' + # type=file|default=: input image file + output_image: '"output.nii.gz"' + # type=file: resampled file + # type=file|default=: output image file + out_spacing: (0.4, 0.4, 0.4) + # type=traitcompound|default=None: output spacing + apply_smoothing: "True" + # type=bool|default=False: smooth before resampling + addvox: "2" + # type=int|default=0: addvox pads each dimension by addvox + nn_interp: "False" + # type=bool|default=False: nn interpolation + dimension: "3" + # type=int|default=3: dimension of output image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/resample_image_by_spacing_callables.py b/nipype-auto-conv/specs/interfaces/resample_image_by_spacing_callables.py similarity index 100% rename from nipype-auto-conv/specs/resample_image_by_spacing_callables.py rename to nipype-auto-conv/specs/interfaces/resample_image_by_spacing_callables.py diff --git a/nipype-auto-conv/specs/interfaces/threshold_image.yaml b/nipype-auto-conv/specs/interfaces/threshold_image.yaml new file mode 100644 index 0000000..aaf18ff --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/threshold_image.yaml @@ -0,0 +1,237 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.utils.ThresholdImage' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# +# Apply thresholds on images. +# +# Examples +# -------- +# >>> thres = ThresholdImage(dimension=3) +# >>> thres.inputs.input_image = 'structural.nii' +# >>> thres.inputs.output_image = 'output.nii.gz' +# >>> thres.inputs.th_low = 0.5 +# >>> thres.inputs.th_high = 1.0 +# >>> thres.inputs.inside_value = 1.0 +# >>> thres.inputs.outside_value = 0.0 +# >>> thres.cmdline #doctest: +ELLIPSIS +# 'ThresholdImage 3 structural.nii output.nii.gz 0.500000 1.000000 1.000000 0.000000' +# +# >>> thres = ThresholdImage(dimension=3) +# >>> thres.inputs.input_image = 'structural.nii' +# >>> thres.inputs.output_image = 'output.nii.gz' +# >>> thres.inputs.mode = 'Kmeans' +# >>> thres.inputs.num_thresholds = 4 +# >>> thres.cmdline #doctest: +ELLIPSIS +# 'ThresholdImage 3 structural.nii output.nii.gz Kmeans 4' +# +# +task_name: ThresholdImage +nipype_name: ThresholdImage +nipype_module: nipype.interfaces.ants.utils +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + input_image: medimage/itk-image + # type=file|default=: input image file + input_mask: generic/file + # type=file|default=: input mask for Otsu, Kmeans + output_image: Path + # type=file: resampled file + # type=file|default=: output image file + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_image: medimage/itk-image + # type=file: resampled file + # type=file|default=: output image file + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=int|default=3: dimension of output image + input_image: + # type=file|default=: input image file + output_image: + # type=file: resampled file + # type=file|default=: output image file + mode: + # type=enum|default='Otsu'|allowed['Kmeans','Otsu']: whether to run Otsu / Kmeans thresholding + num_thresholds: + # type=int|default=0: number of thresholds + input_mask: + # type=file|default=: input mask for Otsu, Kmeans + th_low: + # type=float|default=0.0: lower threshold + th_high: + # type=float|default=0.0: upper threshold + inside_value: + # type=float|default=1: inside value + outside_value: + # type=float|default=0: outside value + copy_header: + # type=bool|default=True: copy headers of the original image into the output (corrected) file + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: input image file + output_image: '"output.nii.gz"' + # type=file: resampled file + # type=file|default=: output image file + th_low: "0.5" + # type=float|default=0.0: lower threshold + th_high: "1.0" + # type=float|default=0.0: upper threshold + inside_value: "1.0" + # type=float|default=1: inside value + outside_value: "0.0" + # type=float|default=0: outside value + dimension: "3" + # type=int|default=3: dimension of output image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: input image file + output_image: '"output.nii.gz"' + # type=file: resampled file + # type=file|default=: output image file + mode: '"Kmeans"' + # type=enum|default='Otsu'|allowed['Kmeans','Otsu']: whether to run Otsu / Kmeans thresholding + num_thresholds: "4" + # type=int|default=0: number of thresholds + dimension: "3" + # type=int|default=3: dimension of output image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"structural.nii"' + # type=file|default=: input image file + output_image: '"output.nii.gz"' + # type=file: resampled file + # type=file|default=: output image file + th_low: "0.5" + # type=float|default=0.0: lower threshold + th_high: "1.0" + # type=float|default=0.0: upper threshold + inside_value: "1.0" + # type=float|default=1: inside value + outside_value: "0.0" + # type=float|default=0: outside value + dimension: "3" + # type=int|default=3: dimension of output image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"structural.nii"' + # type=file|default=: input image file + output_image: '"output.nii.gz"' + # type=file: resampled file + # type=file|default=: output image file + mode: '"Kmeans"' + # type=enum|default='Otsu'|allowed['Kmeans','Otsu']: whether to run Otsu / Kmeans thresholding + num_thresholds: "4" + # type=int|default=0: number of thresholds + dimension: "3" + # type=int|default=3: dimension of output image + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/threshold_image_callables.py b/nipype-auto-conv/specs/interfaces/threshold_image_callables.py similarity index 100% rename from nipype-auto-conv/specs/threshold_image_callables.py rename to nipype-auto-conv/specs/interfaces/threshold_image_callables.py diff --git a/nipype-auto-conv/specs/interfaces/warp_image_multi_transform.yaml b/nipype-auto-conv/specs/interfaces/warp_image_multi_transform.yaml new file mode 100644 index 0000000..f61b075 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/warp_image_multi_transform.yaml @@ -0,0 +1,218 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.resampling.WarpImageMultiTransform' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# Warps an image from one space to another +# +# Examples +# -------- +# +# >>> from nipype.interfaces.ants import WarpImageMultiTransform +# >>> wimt = WarpImageMultiTransform() +# >>> wimt.inputs.input_image = 'structural.nii' +# >>> wimt.inputs.reference_image = 'ants_deformed.nii.gz' +# >>> wimt.inputs.transformation_series = ['ants_Warp.nii.gz','ants_Affine.txt'] +# >>> wimt.cmdline +# 'WarpImageMultiTransform 3 structural.nii structural_wimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz ants_Affine.txt' +# +# >>> wimt = WarpImageMultiTransform() +# >>> wimt.inputs.input_image = 'diffusion_weighted.nii' +# >>> wimt.inputs.reference_image = 'functional.nii' +# >>> wimt.inputs.transformation_series = ['func2anat_coreg_Affine.txt','func2anat_InverseWarp.nii.gz', 'dwi2anat_Warp.nii.gz','dwi2anat_coreg_Affine.txt'] +# >>> wimt.inputs.invert_affine = [1] # this will invert the 1st Affine file: 'func2anat_coreg_Affine.txt' +# >>> wimt.cmdline +# 'WarpImageMultiTransform 3 diffusion_weighted.nii diffusion_weighted_wimt.nii -R functional.nii -i func2anat_coreg_Affine.txt func2anat_InverseWarp.nii.gz dwi2anat_Warp.nii.gz dwi2anat_coreg_Affine.txt' +# +# +task_name: WarpImageMultiTransform +nipype_name: WarpImageMultiTransform +nipype_module: nipype.interfaces.ants.resampling +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + input_image: medimage/itk-image + # type=file|default=: image to apply transformation to (generally a coregistered functional) + out_postfix: str + # type=file|default='_wimt': Postfix that is prepended to all output files (default = _wimt) + output_image: Path + # type=file: Warped image + # type=file|default=: name of the output warped image + reference_image: medimage/itk-image,medimage/nifti-gz + # type=file|default=: reference image space that you wish to warp INTO + transformation_series: "[text/text-file,medimage/nifti-gz]+list-of" + # type=inputmultiobject|default=[]: transformation file(s) to be applied + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_image: medimage/itk-image + # type=file: Warped image + # type=file|default=: name of the output warped image + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + output_image: output_image + # type=file: Warped image + # type=file|default=: name of the output warped image + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) + input_image: + # type=file|default=: image to apply transformation to (generally a coregistered functional) + output_image: + # type=file: Warped image + # type=file|default=: name of the output warped image + out_postfix: + # type=file|default='_wimt': Postfix that is prepended to all output files (default = _wimt) + reference_image: + # type=file|default=: reference image space that you wish to warp INTO + tightest_box: + # type=bool|default=False: computes tightest bounding box (overridden by reference_image if given) + reslice_by_header: + # type=bool|default=False: Uses orientation matrix and origin encoded in reference image file header. Not typically used with additional transforms + use_nearest: + # type=bool|default=False: Use nearest neighbor interpolation + use_bspline: + # type=bool|default=False: Use 3rd order B-Spline interpolation + transformation_series: + # type=inputmultiobject|default=[]: transformation file(s) to be applied + invert_affine: + # type=list|default=[]: List of Affine transformations to invert.E.g.: [1,4,5] inverts the 1st, 4th, and 5th Affines found in transformation_series. Note that indexing starts with 1 and does not include warp fields. Affine transformations are distinguished from warp fields by the word "affine" included in their filenames. + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: + # type=file|default=: reference image space that you wish to warp INTO + transformation_series: + # type=inputmultiobject|default=[]: transformation file(s) to be applied + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: + # type=file|default=: reference image space that you wish to warp INTO + transformation_series: + # type=inputmultiobject|default=[]: transformation file(s) to be applied + invert_affine: '[1] # this will invert the 1st Affine file: "func2anat_coreg_Affine.txt"' + # type=list|default=[]: List of Affine transformations to invert.E.g.: [1,4,5] inverts the 1st, 4th, and 5th Affines found in transformation_series. Note that indexing starts with 1 and does not include warp fields. Affine transformations are distinguished from warp fields by the word "affine" included in their filenames. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: WarpImageMultiTransform 3 structural.nii structural_wimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz ants_Affine.txt + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"structural.nii"' + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: '"ants_deformed.nii.gz"' + # type=file|default=: reference image space that you wish to warp INTO + transformation_series: '["ants_Warp.nii.gz","ants_Affine.txt"]' + # type=inputmultiobject|default=[]: transformation file(s) to be applied + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: WarpImageMultiTransform 3 diffusion_weighted.nii diffusion_weighted_wimt.nii -R functional.nii -i func2anat_coreg_Affine.txt func2anat_InverseWarp.nii.gz dwi2anat_Warp.nii.gz dwi2anat_coreg_Affine.txt + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"diffusion_weighted.nii"' + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: '"functional.nii"' + # type=file|default=: reference image space that you wish to warp INTO + transformation_series: '["func2anat_coreg_Affine.txt","func2anat_InverseWarp.nii.gz", "dwi2anat_Warp.nii.gz","dwi2anat_coreg_Affine.txt"]' + # type=inputmultiobject|default=[]: transformation file(s) to be applied + invert_affine: '[1] # this will invert the 1st Affine file: "func2anat_coreg_Affine.txt"' + # type=list|default=[]: List of Affine transformations to invert.E.g.: [1,4,5] inverts the 1st, 4th, and 5th Affines found in transformation_series. Note that indexing starts with 1 and does not include warp fields. Affine transformations are distinguished from warp fields by the word "affine" included in their filenames. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/warp_image_multi_transform_callables.py b/nipype-auto-conv/specs/interfaces/warp_image_multi_transform_callables.py similarity index 100% rename from nipype-auto-conv/specs/warp_image_multi_transform_callables.py rename to nipype-auto-conv/specs/interfaces/warp_image_multi_transform_callables.py diff --git a/nipype-auto-conv/specs/interfaces/warp_time_series_image_multi_transform.yaml b/nipype-auto-conv/specs/interfaces/warp_time_series_image_multi_transform.yaml new file mode 100644 index 0000000..3bc9ba2 --- /dev/null +++ b/nipype-auto-conv/specs/interfaces/warp_time_series_image_multi_transform.yaml @@ -0,0 +1,205 @@ +# This file is used to manually specify the semi-automatic conversion of +# 'nipype.interfaces.ants.resampling.WarpTimeSeriesImageMultiTransform' from Nipype to Pydra. +# +# Please fill-in/edit the fields below where appropriate +# +# Docs +# ---- +# Warps a time-series from one space to another +# +# Examples +# -------- +# +# >>> from nipype.interfaces.ants import WarpTimeSeriesImageMultiTransform +# >>> wtsimt = WarpTimeSeriesImageMultiTransform() +# >>> wtsimt.inputs.input_image = 'resting.nii' +# >>> wtsimt.inputs.reference_image = 'ants_deformed.nii.gz' +# >>> wtsimt.inputs.transformation_series = ['ants_Warp.nii.gz','ants_Affine.txt'] +# >>> wtsimt.cmdline +# 'WarpTimeSeriesImageMultiTransform 4 resting.nii resting_wtsimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz ants_Affine.txt' +# +# >>> wtsimt = WarpTimeSeriesImageMultiTransform() +# >>> wtsimt.inputs.input_image = 'resting.nii' +# >>> wtsimt.inputs.reference_image = 'ants_deformed.nii.gz' +# >>> wtsimt.inputs.transformation_series = ['ants_Warp.nii.gz','ants_Affine.txt'] +# >>> wtsimt.inputs.invert_affine = [1] # # this will invert the 1st Affine file: ants_Affine.txt +# >>> wtsimt.cmdline +# 'WarpTimeSeriesImageMultiTransform 4 resting.nii resting_wtsimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz -i ants_Affine.txt' +# +task_name: WarpTimeSeriesImageMultiTransform +nipype_name: WarpTimeSeriesImageMultiTransform +nipype_module: nipype.interfaces.ants.resampling +inputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + input_image: medimage/itk-image + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: medimage/itk-image + # type=file|default=: reference image space that you wish to warp INTO + transformation_series: medimage/nifti-gz+list-of + # type=inputmultiobject|default=[]: transformation file(s) to be applied + callable_defaults: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set as the `default` method of input fields + metadata: + # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) +outputs: + omit: + # list[str] - fields to omit from the Pydra interface + rename: + # dict[str, str] - fields to rename in the Pydra interface + types: + # dict[str, type] - override inferred types (use "mime-like" string for file-format types, + # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred + # 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. + output_image: medimage/itk-image + # type=file: Warped image + callables: + # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` + # to set to the `callable` attribute of output fields + templates: + # dict[str, str] - `output_file_template` values to be provided to output fields + requirements: + # dict[str, list[str]] - input fields that are required to be provided for the output field to be present +tests: + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + dimension: + # type=enum|default=4|allowed[3,4]: image dimension (3 or 4) + input_image: + # type=file|default=: image to apply transformation to (generally a coregistered functional) + out_postfix: + # type=str|default='_wtsimt': Postfix that is prepended to all output files (default = _wtsimt) + reference_image: + # type=file|default=: reference image space that you wish to warp INTO + tightest_box: + # type=bool|default=False: computes tightest bounding box (overridden by reference_image if given) + reslice_by_header: + # type=bool|default=False: Uses orientation matrix and origin encoded in reference image file header. Not typically used with additional transforms + use_nearest: + # type=bool|default=False: Use nearest neighbor interpolation + use_bspline: + # type=bool|default=False: Use 3rd order B-Spline interpolation + transformation_series: + # type=inputmultiobject|default=[]: transformation file(s) to be applied + invert_affine: + # type=list|default=[]: List of Affine transformations to invert.E.g.: [1,4,5] inverts the 1st, 4th, and 5th Affines found in transformation_series. Note that indexing starts with 1 and does not include warp fields. Affine transformations are distinguished from warp fields by the word "affine" included in their filenames. + num_threads: + # type=int|default=1: Number of ITK threads to use + args: + # type=str|default='': Additional parameters to the command + environ: + # type=dict|default={}: Environment variables + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: + # type=file|default=: reference image space that you wish to warp INTO + transformation_series: + # type=inputmultiobject|default=[]: transformation file(s) to be applied + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file + - inputs: + # dict[str, str] - values to provide to inputs fields in the task initialisation + # (if not specified, will try to choose a sensible value) + input_image: + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: + # type=file|default=: reference image space that you wish to warp INTO + transformation_series: + # type=inputmultiobject|default=[]: transformation file(s) to be applied + invert_affine: "[1] # # this will invert the 1st Affine file: ants_Affine.txt" + # type=list|default=[]: List of Affine transformations to invert.E.g.: [1,4,5] inverts the 1st, 4th, and 5th Affines found in transformation_series. Note that indexing starts with 1 and does not include warp fields. Affine transformations are distinguished from warp fields by the word "affine" included in their filenames. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + expected_outputs: + # dict[str, str] - expected values for selected outputs, noting that tests will typically + # be terminated before they complete for time-saving reasons, and therefore + # these values will be ignored, when running in CI + timeout: 10 + # int - the value to set for the timeout in the generated test, + # after which the test will be considered to have been initialised + # successfully. Set to 0 to disable the timeout (warning, this could + # lead to the unittests taking a very long time to complete) + xfail: true + # bool - whether the unittest is expected to fail or not. Set to false + # when you are satisfied with the edits you have made to this file +doctests: + - cmdline: WarpTimeSeriesImageMultiTransform 4 resting.nii resting_wtsimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz ants_Affine.txt + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"resting.nii"' + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: '"ants_deformed.nii.gz"' + # type=file|default=: reference image space that you wish to warp INTO + transformation_series: '["ants_Warp.nii.gz","ants_Affine.txt"]' + # type=inputmultiobject|default=[]: transformation file(s) to be applied + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS + - cmdline: WarpTimeSeriesImageMultiTransform 4 resting.nii resting_wtsimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz -i ants_Affine.txt + # str - the expected cmdline output + inputs: + # dict[str, str] - name-value pairs for inputs to be provided to the doctest. + # If the field is of file-format type and the value is None, then the + # '.mock()' method of the corresponding class is used instead. + input_image: '"resting.nii"' + # type=file|default=: image to apply transformation to (generally a coregistered functional) + reference_image: '"ants_deformed.nii.gz"' + # type=file|default=: reference image space that you wish to warp INTO + transformation_series: '["ants_Warp.nii.gz","ants_Affine.txt"]' + # type=inputmultiobject|default=[]: transformation file(s) to be applied + invert_affine: "[1] # # this will invert the 1st Affine file: ants_Affine.txt" + # type=list|default=[]: List of Affine transformations to invert.E.g.: [1,4,5] inverts the 1st, 4th, and 5th Affines found in transformation_series. Note that indexing starts with 1 and does not include warp fields. Affine transformations are distinguished from warp fields by the word "affine" included in their filenames. + imports: + # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item + # consisting of 'module', 'name', and optionally 'alias' keys + directive: + # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/warp_time_series_image_multi_transform_callables.py b/nipype-auto-conv/specs/interfaces/warp_time_series_image_multi_transform_callables.py similarity index 100% rename from nipype-auto-conv/specs/warp_time_series_image_multi_transform_callables.py rename to nipype-auto-conv/specs/interfaces/warp_time_series_image_multi_transform_callables.py diff --git a/nipype-auto-conv/specs/joint_fusion.yaml b/nipype-auto-conv/specs/joint_fusion.yaml deleted file mode 100644 index 5b7d94e..0000000 --- a/nipype-auto-conv/specs/joint_fusion.yaml +++ /dev/null @@ -1,461 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.segmentation.JointFusion' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# An image fusion algorithm. -# -# Developed by Hongzhi Wang and Paul Yushkevich, and it won segmentation challenges -# at MICCAI 2012 and MICCAI 2013. -# The original label fusion framework was extended to accommodate intensities by Brian -# Avants. -# This implementation is based on Paul's original ITK-style implementation -# and Brian's ANTsR implementation. -# -# References include 1) H. Wang, J. W. Suh, S. -# Das, J. Pluta, C. Craige, P. Yushkevich, Multi-atlas segmentation with joint -# label fusion IEEE Trans. on Pattern Analysis and Machine Intelligence, 35(3), -# 611-623, 2013. and 2) H. Wang and P. A. Yushkevich, Multi-atlas segmentation -# with joint label fusion and corrective learning--an open source implementation, -# Front. Neuroinform., 2013. -# -# Examples -# -------- -# >>> from nipype.interfaces.ants import JointFusion -# >>> jf = JointFusion() -# >>> jf.inputs.out_label_fusion = 'ants_fusion_label_output.nii' -# >>> jf.inputs.atlas_image = [ ['rc1s1.nii','rc1s2.nii'] ] -# >>> jf.inputs.atlas_segmentation_image = ['segmentation0.nii.gz'] -# >>> jf.inputs.target_image = ['im1.nii'] -# >>> jf.cmdline -# "antsJointFusion -a 0.1 -g ['rc1s1.nii', 'rc1s2.nii'] -l segmentation0.nii.gz -# -b 2.0 -o ants_fusion_label_output.nii -s 3x3x3 -t ['im1.nii']" -# -# >>> jf.inputs.target_image = [ ['im1.nii', 'im2.nii'] ] -# >>> jf.cmdline -# "antsJointFusion -a 0.1 -g ['rc1s1.nii', 'rc1s2.nii'] -l segmentation0.nii.gz -# -b 2.0 -o ants_fusion_label_output.nii -s 3x3x3 -t ['im1.nii', 'im2.nii']" -# -# >>> jf.inputs.atlas_image = [ ['rc1s1.nii','rc1s2.nii'], -# ... ['rc2s1.nii','rc2s2.nii'] ] -# >>> jf.inputs.atlas_segmentation_image = ['segmentation0.nii.gz', -# ... 'segmentation1.nii.gz'] -# >>> jf.cmdline -# "antsJointFusion -a 0.1 -g ['rc1s1.nii', 'rc1s2.nii'] -g ['rc2s1.nii', 'rc2s2.nii'] -# -l segmentation0.nii.gz -l segmentation1.nii.gz -b 2.0 -o ants_fusion_label_output.nii -# -s 3x3x3 -t ['im1.nii', 'im2.nii']" -# -# >>> jf.inputs.dimension = 3 -# >>> jf.inputs.alpha = 0.5 -# >>> jf.inputs.beta = 1.0 -# >>> jf.inputs.patch_radius = [3,2,1] -# >>> jf.inputs.search_radius = [3] -# >>> jf.cmdline -# "antsJointFusion -a 0.5 -g ['rc1s1.nii', 'rc1s2.nii'] -g ['rc2s1.nii', 'rc2s2.nii'] -# -l segmentation0.nii.gz -l segmentation1.nii.gz -b 1.0 -d 3 -o ants_fusion_label_output.nii -# -p 3x2x1 -s 3 -t ['im1.nii', 'im2.nii']" -# -# >>> jf.inputs.search_radius = ['mask.nii'] -# >>> jf.inputs.verbose = True -# >>> jf.inputs.exclusion_image = ['roi01.nii', 'roi02.nii'] -# >>> jf.inputs.exclusion_image_label = ['1','2'] -# >>> jf.cmdline -# "antsJointFusion -a 0.5 -g ['rc1s1.nii', 'rc1s2.nii'] -g ['rc2s1.nii', 'rc2s2.nii'] -# -l segmentation0.nii.gz -l segmentation1.nii.gz -b 1.0 -d 3 -e 1[roi01.nii] -e 2[roi02.nii] -# -o ants_fusion_label_output.nii -p 3x2x1 -s mask.nii -t ['im1.nii', 'im2.nii'] -v" -# -# >>> jf.inputs.out_label_fusion = 'ants_fusion_label_output.nii' -# >>> jf.inputs.out_intensity_fusion_name_format = 'ants_joint_fusion_intensity_%d.nii.gz' -# >>> jf.inputs.out_label_post_prob_name_format = 'ants_joint_fusion_posterior_%d.nii.gz' -# >>> jf.inputs.out_atlas_voting_weight_name_format = 'ants_joint_fusion_voting_weight_%d.nii.gz' -# >>> jf.cmdline -# "antsJointFusion -a 0.5 -g ['rc1s1.nii', 'rc1s2.nii'] -g ['rc2s1.nii', 'rc2s2.nii'] -# -l segmentation0.nii.gz -l segmentation1.nii.gz -b 1.0 -d 3 -e 1[roi01.nii] -e 2[roi02.nii] -# -o [ants_fusion_label_output.nii, ants_joint_fusion_intensity_%d.nii.gz, -# ants_joint_fusion_posterior_%d.nii.gz, ants_joint_fusion_voting_weight_%d.nii.gz] -# -p 3x2x1 -s mask.nii -t ['im1.nii', 'im2.nii'] -v" -# -# -task_name: JointFusion -nipype_name: JointFusion -nipype_module: nipype.interfaces.ants.segmentation -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - atlas_segmentation_image: medimage/nifti-gz+list-of - # type=inputmultiobject|default=[]: The atlas segmentation images. For performing label fusion the number of specified segmentations should be identical to the number of atlas image sets. - exclusion_image: medimage/nifti1+list-of - # type=list|default=[]: Specify an exclusion region for the given label. - mask_image: generic/file - # type=file|default=: If a mask image is specified, fusion is only performed in the mask region. - out_label_fusion: Path - # type=file: - # type=file|default=: The output label fusion image. - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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_atlas_voting_weight: generic/file+list-of - # type=outputmultiobject: - out_intensity_fusion: generic/file+list-of - # type=outputmultiobject: - out_label_fusion: medimage/nifti1 - # type=file: - # type=file|default=: The output label fusion image. - out_label_post_prob: generic/file+list-of - # type=outputmultiobject: - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, the program tries to infer the dimensionality from the input image. - target_image: - # type=list|default=[]: The target image (or multimodal target images) assumed to be aligned to a common image domain. - atlas_image: - # type=list|default=[]: The atlas image (or multimodal atlas images) assumed to be aligned to a common image domain. - atlas_segmentation_image: - # type=inputmultiobject|default=[]: The atlas segmentation images. For performing label fusion the number of specified segmentations should be identical to the number of atlas image sets. - alpha: - # type=float|default=0.1: Regularization term added to matrix Mx for calculating the inverse. Default = 0.1 - beta: - # type=float|default=2.0: Exponent for mapping intensity difference to the joint error. Default = 2.0 - retain_label_posterior_images: - # type=bool|default=False: Retain label posterior probability images. Requires atlas segmentations to be specified. Default = false - retain_atlas_voting_images: - # type=bool|default=False: Retain atlas voting images. Default = false - constrain_nonnegative: - # type=bool|default=False: Constrain solution to non-negative weights. - patch_radius: - # type=list|default=[]: Patch radius for similarity measures. Default: 2x2x2 - patch_metric: - # type=enum|default='PC'|allowed['MSQ','PC']: Metric to be used in determining the most similar neighborhood patch. Options include Pearson's correlation (PC) and mean squares (MSQ). Default = PC (Pearson correlation). - search_radius: - # type=list|default=[3, 3, 3]: Search radius for similarity measures. Default = 3x3x3. One can also specify an image where the value at the voxel specifies the isotropic search radius at that voxel. - exclusion_image_label: - # type=list|default=[]: Specify a label for the exclusion region. - exclusion_image: - # type=list|default=[]: Specify an exclusion region for the given label. - mask_image: - # type=file|default=: If a mask image is specified, fusion is only performed in the mask region. - out_label_fusion: - # type=file: - # type=file|default=: The output label fusion image. - out_intensity_fusion_name_format: - # type=str|default='': Optional intensity fusion image file name format. (e.g. "antsJointFusionIntensity_%d.nii.gz") - out_label_post_prob_name_format: - # type=str|default='antsJointFusionPosterior_%d.nii.gz': Optional label posterior probability image file name format. - out_atlas_voting_weight_name_format: - # type=str|default='antsJointFusionVotingWeight_%d.nii.gz': Optional atlas voting weight image file name format. - verbose: - # type=bool|default=False: Verbose output. - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - out_label_fusion: '"ants_fusion_label_output.nii"' - # type=file: - # type=file|default=: The output label fusion image. - atlas_image: '[ ["rc1s1.nii","rc1s2.nii"] ]' - # type=list|default=[]: The atlas image (or multimodal atlas images) assumed to be aligned to a common image domain. - atlas_segmentation_image: - # type=inputmultiobject|default=[]: The atlas segmentation images. For performing label fusion the number of specified segmentations should be identical to the number of atlas image sets. - target_image: '["im1.nii"]' - # type=list|default=[]: The target image (or multimodal target images) assumed to be aligned to a common image domain. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - target_image: '[ ["im1.nii", "im2.nii"] ]' - # type=list|default=[]: The target image (or multimodal target images) assumed to be aligned to a common image domain. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - atlas_image: '[ ["rc1s1.nii","rc1s2.nii"],["rc2s1.nii","rc2s2.nii"] ]' - # type=list|default=[]: The atlas image (or multimodal atlas images) assumed to be aligned to a common image domain. - atlas_segmentation_image: - # type=inputmultiobject|default=[]: The atlas segmentation images. For performing label fusion the number of specified segmentations should be identical to the number of atlas image sets. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, the program tries to infer the dimensionality from the input image. - alpha: '0.5' - # type=float|default=0.1: Regularization term added to matrix Mx for calculating the inverse. Default = 0.1 - beta: '1.0' - # type=float|default=2.0: Exponent for mapping intensity difference to the joint error. Default = 2.0 - patch_radius: '[3,2,1]' - # type=list|default=[]: Patch radius for similarity measures. Default: 2x2x2 - search_radius: '[3]' - # type=list|default=[3, 3, 3]: Search radius for similarity measures. Default = 3x3x3. One can also specify an image where the value at the voxel specifies the isotropic search radius at that voxel. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - search_radius: '["mask.nii"]' - # type=list|default=[3, 3, 3]: Search radius for similarity measures. Default = 3x3x3. One can also specify an image where the value at the voxel specifies the isotropic search radius at that voxel. - verbose: 'True' - # type=bool|default=False: Verbose output. - exclusion_image: - # type=list|default=[]: Specify an exclusion region for the given label. - exclusion_image_label: '["1","2"]' - # type=list|default=[]: Specify a label for the exclusion region. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - out_label_fusion: '"ants_fusion_label_output.nii"' - # type=file: - # type=file|default=: The output label fusion image. - out_intensity_fusion_name_format: '"ants_joint_fusion_intensity_%d.nii.gz"' - # type=str|default='': Optional intensity fusion image file name format. (e.g. "antsJointFusionIntensity_%d.nii.gz") - out_label_post_prob_name_format: '"ants_joint_fusion_posterior_%d.nii.gz"' - # type=str|default='antsJointFusionPosterior_%d.nii.gz': Optional label posterior probability image file name format. - out_atlas_voting_weight_name_format: '"ants_joint_fusion_voting_weight_%d.nii.gz"' - # type=str|default='antsJointFusionVotingWeight_%d.nii.gz': Optional atlas voting weight image file name format. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: antsJointFusion -a 0.1 -g ["rc1s1.nii", "rc1s2.nii"] -l segmentation0.nii.gz -b 2.0 -o ants_fusion_label_output.nii -s 3x3x3 -t ["im1.nii"] - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - out_label_fusion: '"ants_fusion_label_output.nii"' - # type=file: - # type=file|default=: The output label fusion image. - atlas_image: '[ ["rc1s1.nii","rc1s2.nii"] ]' - # type=list|default=[]: The atlas image (or multimodal atlas images) assumed to be aligned to a common image domain. - atlas_segmentation_image: '["segmentation0.nii.gz"]' - # type=inputmultiobject|default=[]: The atlas segmentation images. For performing label fusion the number of specified segmentations should be identical to the number of atlas image sets. - target_image: '["im1.nii"]' - # type=list|default=[]: The target image (or multimodal target images) assumed to be aligned to a common image domain. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsJointFusion -a 0.1 -g ["rc1s1.nii", "rc1s2.nii"] -l segmentation0.nii.gz -b 2.0 -o ants_fusion_label_output.nii -s 3x3x3 -t ["im1.nii", "im2.nii"] - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - target_image: '[ ["im1.nii", "im2.nii"] ]' - # type=list|default=[]: The target image (or multimodal target images) assumed to be aligned to a common image domain. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsJointFusion -a 0.1 -g ["rc1s1.nii", "rc1s2.nii"] -g ["rc2s1.nii", "rc2s2.nii"] -l segmentation0.nii.gz -l segmentation1.nii.gz -b 2.0 -o ants_fusion_label_output.nii -s 3x3x3 -t ["im1.nii", "im2.nii"] - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - atlas_image: '[ ["rc1s1.nii","rc1s2.nii"],["rc2s1.nii","rc2s2.nii"] ]' - # type=list|default=[]: The atlas image (or multimodal atlas images) assumed to be aligned to a common image domain. - atlas_segmentation_image: '["segmentation0.nii.gz","segmentation1.nii.gz"]' - # type=inputmultiobject|default=[]: The atlas segmentation images. For performing label fusion the number of specified segmentations should be identical to the number of atlas image sets. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsJointFusion -a 0.5 -g ["rc1s1.nii", "rc1s2.nii"] -g ["rc2s1.nii", "rc2s2.nii"] -l segmentation0.nii.gz -l segmentation1.nii.gz -b 1.0 -d 3 -o ants_fusion_label_output.nii -p 3x2x1 -s 3 -t ["im1.nii", "im2.nii"] - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: This option forces the image to be treated as a specified-dimensional image. If not specified, the program tries to infer the dimensionality from the input image. - alpha: '0.5' - # type=float|default=0.1: Regularization term added to matrix Mx for calculating the inverse. Default = 0.1 - beta: '1.0' - # type=float|default=2.0: Exponent for mapping intensity difference to the joint error. Default = 2.0 - patch_radius: '[3,2,1]' - # type=list|default=[]: Patch radius for similarity measures. Default: 2x2x2 - search_radius: '[3]' - # type=list|default=[3, 3, 3]: Search radius for similarity measures. Default = 3x3x3. One can also specify an image where the value at the voxel specifies the isotropic search radius at that voxel. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsJointFusion -a 0.5 -g ["rc1s1.nii", "rc1s2.nii"] -g ["rc2s1.nii", "rc2s2.nii"] -l segmentation0.nii.gz -l segmentation1.nii.gz -b 1.0 -d 3 -e 1[roi01.nii] -e 2[roi02.nii] -o ants_fusion_label_output.nii -p 3x2x1 -s mask.nii -t ["im1.nii", "im2.nii"] -v - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - search_radius: '["mask.nii"]' - # type=list|default=[3, 3, 3]: Search radius for similarity measures. Default = 3x3x3. One can also specify an image where the value at the voxel specifies the isotropic search radius at that voxel. - verbose: 'True' - # type=bool|default=False: Verbose output. - exclusion_image: '["roi01.nii", "roi02.nii"]' - # type=list|default=[]: Specify an exclusion region for the given label. - exclusion_image_label: '["1","2"]' - # type=list|default=[]: Specify a label for the exclusion region. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsJointFusion -a 0.5 -g ["rc1s1.nii", "rc1s2.nii"] -g ["rc2s1.nii", "rc2s2.nii"] -l segmentation0.nii.gz -l segmentation1.nii.gz -b 1.0 -d 3 -e 1[roi01.nii] -e 2[roi02.nii] -o [ants_fusion_label_output.nii, ants_joint_fusion_intensity_%d.nii.gz, ants_joint_fusion_posterior_%d.nii.gz, ants_joint_fusion_voting_weight_%d.nii.gz] -p 3x2x1 -s mask.nii -t ["im1.nii", "im2.nii"] -v - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - out_label_fusion: '"ants_fusion_label_output.nii"' - # type=file: - # type=file|default=: The output label fusion image. - out_intensity_fusion_name_format: '"ants_joint_fusion_intensity_%d.nii.gz"' - # type=str|default='': Optional intensity fusion image file name format. (e.g. "antsJointFusionIntensity_%d.nii.gz") - out_label_post_prob_name_format: '"ants_joint_fusion_posterior_%d.nii.gz"' - # type=str|default='antsJointFusionPosterior_%d.nii.gz': Optional label posterior probability image file name format. - out_atlas_voting_weight_name_format: '"ants_joint_fusion_voting_weight_%d.nii.gz"' - # type=str|default='antsJointFusionVotingWeight_%d.nii.gz': Optional atlas voting weight image file name format. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/kelly_kapowski.yaml b/nipype-auto-conv/specs/kelly_kapowski.yaml deleted file mode 100644 index 7966dc9..0000000 --- a/nipype-auto-conv/specs/kelly_kapowski.yaml +++ /dev/null @@ -1,195 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.segmentation.KellyKapowski' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Nipype Interface to ANTs' KellyKapowski, also known as DiReCT. -# -# DiReCT is a registration based estimate of cortical thickness. It was published -# in S. R. Das, B. B. Avants, M. Grossman, and J. C. Gee, Registration based -# cortical thickness measurement, Neuroimage 2009, 45:867--879. -# -# Examples -# -------- -# >>> from nipype.interfaces.ants.segmentation import KellyKapowski -# >>> kk = KellyKapowski() -# >>> kk.inputs.dimension = 3 -# >>> kk.inputs.segmentation_image = "segmentation0.nii.gz" -# >>> kk.inputs.convergence = "[45,0.0,10]" -# >>> kk.inputs.thickness_prior_estimate = 10 -# >>> kk.cmdline -# 'KellyKapowski --convergence "[45,0.0,10]" -# --output "[segmentation0_cortical_thickness.nii.gz,segmentation0_warped_white_matter.nii.gz]" -# --image-dimensionality 3 --gradient-step 0.025000 -# --maximum-number-of-invert-displacement-field-iterations 20 --number-of-integration-points 10 -# --segmentation-image "[segmentation0.nii.gz,2,3]" --smoothing-variance 1.000000 -# --smoothing-velocity-field-parameter 1.500000 --thickness-prior-estimate 10.000000' -# -# -task_name: KellyKapowski -nipype_name: KellyKapowski -nipype_module: nipype.interfaces.ants.segmentation -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - cortical_thickness: Path - # type=file: A thickness map defined in the segmented gray matter. - # type=file|default=: Filename for the cortical thickness. - gray_matter_prob_image: generic/file - # type=file|default=: In addition to the segmentation image, a gray matter probability image can be used. If no such image is supplied, one is created using the segmentation image and a variance of 1.0 mm. - segmentation_image: medimage/nifti-gz - # type=file|default=: A segmentation image must be supplied labeling the gray and white matters. Default values = 2 and 3, respectively. - thickness_prior_image: generic/file - # type=file|default=: An image containing spatially varying prior thickness values. - warped_white_matter: Path - # type=file: A warped white matter image. - # type=file|default=: Filename for the warped white matter file. - white_matter_prob_image: generic/file - # type=file|default=: In addition to the segmentation image, a white matter probability image can be used. If no such image is supplied, one is created using the segmentation image and a variance of 1.0 mm. - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - cortical_thickness: generic/file - # type=file: A thickness map defined in the segmented gray matter. - # type=file|default=: Filename for the cortical thickness. - warped_white_matter: generic/file - # type=file: A warped white matter image. - # type=file|default=: Filename for the warped white matter file. - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - segmentation_image: - # type=file|default=: A segmentation image must be supplied labeling the gray and white matters. Default values = 2 and 3, respectively. - gray_matter_label: - # type=int|default=2: The label value for the gray matter label in the segmentation_image. - white_matter_label: - # type=int|default=3: The label value for the white matter label in the segmentation_image. - gray_matter_prob_image: - # type=file|default=: In addition to the segmentation image, a gray matter probability image can be used. If no such image is supplied, one is created using the segmentation image and a variance of 1.0 mm. - white_matter_prob_image: - # type=file|default=: In addition to the segmentation image, a white matter probability image can be used. If no such image is supplied, one is created using the segmentation image and a variance of 1.0 mm. - convergence: - # type=str|default='[50,0.001,10]': Convergence is determined by fitting a line to the normalized energy profile of the last N iterations (where N is specified by the window size) and determining the slope which is then compared with the convergence threshold. - thickness_prior_estimate: - # type=float|default=10: Provides a prior constraint on the final thickness measurement in mm. - thickness_prior_image: - # type=file|default=: An image containing spatially varying prior thickness values. - gradient_step: - # type=float|default=0.025: Gradient step size for the optimization. - smoothing_variance: - # type=float|default=1.0: Defines the Gaussian smoothing of the hit and total images. - smoothing_velocity_field: - # type=float|default=1.5: Defines the Gaussian smoothing of the velocity field (default = 1.5). If the b-spline smoothing option is chosen, then this defines the isotropic mesh spacing for the smoothing spline (default = 15). - use_bspline_smoothing: - # type=bool|default=False: Sets the option for B-spline smoothing of the velocity field. - number_integration_points: - # type=int|default=10: Number of compositions of the diffeomorphism per iteration. - max_invert_displacement_field_iters: - # type=int|default=20: Maximum number of iterations for estimating the invertdisplacement field. - cortical_thickness: - # type=file: A thickness map defined in the segmented gray matter. - # type=file|default=: Filename for the cortical thickness. - warped_white_matter: - # type=file: A warped white matter image. - # type=file|default=: Filename for the warped white matter file. - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - segmentation_image: - # type=file|default=: A segmentation image must be supplied labeling the gray and white matters. Default values = 2 and 3, respectively. - convergence: '"[45,0.0,10]"' - # type=str|default='[50,0.001,10]': Convergence is determined by fitting a line to the normalized energy profile of the last N iterations (where N is specified by the window size) and determining the slope which is then compared with the convergence threshold. - thickness_prior_estimate: '10' - # type=float|default=10: Provides a prior constraint on the final thickness measurement in mm. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: KellyKapowski --convergence "[45,0.0,10]" --output "[segmentation0_cortical_thickness.nii.gz,segmentation0_warped_white_matter.nii.gz]" --image-dimensionality 3 --gradient-step 0.025000 --maximum-number-of-invert-displacement-field-iterations 20 --number-of-integration-points 10 --segmentation-image "[segmentation0.nii.gz,2,3]" --smoothing-variance 1.000000 --smoothing-velocity-field-parameter 1.500000 --thickness-prior-estimate 10.000000 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - segmentation_image: '"segmentation0.nii.gz"' - # type=file|default=: A segmentation image must be supplied labeling the gray and white matters. Default values = 2 and 3, respectively. - convergence: '"[45,0.0,10]"' - # type=str|default='[50,0.001,10]': Convergence is determined by fitting a line to the normalized energy profile of the last N iterations (where N is specified by the window size) and determining the slope which is then compared with the convergence threshold. - thickness_prior_estimate: '10' - # type=float|default=10: Provides a prior constraint on the final thickness measurement in mm. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/label_geometry.yaml b/nipype-auto-conv/specs/label_geometry.yaml deleted file mode 100644 index 8c34c50..0000000 --- a/nipype-auto-conv/specs/label_geometry.yaml +++ /dev/null @@ -1,173 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.utils.LabelGeometry' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Extracts geometry measures using a label file and an optional image file -# -# Examples -# -------- -# >>> from nipype.interfaces.ants import LabelGeometry -# >>> label_extract = LabelGeometry() -# >>> label_extract.inputs.dimension = 3 -# >>> label_extract.inputs.label_image = 'atlas.nii.gz' -# >>> label_extract.cmdline -# 'LabelGeometryMeasures 3 atlas.nii.gz [] atlas.csv' -# -# >>> label_extract.inputs.intensity_image = 'ants_Warp.nii.gz' -# >>> label_extract.cmdline -# 'LabelGeometryMeasures 3 atlas.nii.gz ants_Warp.nii.gz atlas.csv' -# -# -task_name: LabelGeometry -nipype_name: LabelGeometry -nipype_module: nipype.interfaces.ants.utils -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - intensity_image: medimage/nifti-gz - # type=file|default='[]': Intensity image to extract values from. This is an optional input - label_image: medimage/nifti-gz - # type=file|default=: label image to use for extracting geometry measures - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_file: generic/file - # type=file: CSV file of geometry measures - # type=str|default='': name of output file - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - label_image: - # type=file|default=: label image to use for extracting geometry measures - intensity_image: - # type=file|default='[]': Intensity image to extract values from. This is an optional input - output_file: - # type=file: CSV file of geometry measures - # type=str|default='': name of output file - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - label_image: - # type=file|default=: label image to use for extracting geometry measures - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - intensity_image: - # type=file|default='[]': Intensity image to extract values from. This is an optional input - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: LabelGeometryMeasures 3 atlas.nii.gz [] atlas.csv - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - label_image: '"atlas.nii.gz"' - # type=file|default=: label image to use for extracting geometry measures - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: LabelGeometryMeasures 3 atlas.nii.gz ants_Warp.nii.gz atlas.csv - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - intensity_image: '"ants_Warp.nii.gz"' - # type=file|default='[]': Intensity image to extract values from. This is an optional input - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/laplacian_thickness.yaml b/nipype-auto-conv/specs/laplacian_thickness.yaml deleted file mode 100644 index 47dff88..0000000 --- a/nipype-auto-conv/specs/laplacian_thickness.yaml +++ /dev/null @@ -1,183 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.segmentation.LaplacianThickness' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# Calculates the cortical thickness from an anatomical image -# -# Examples -# -------- -# -# >>> from nipype.interfaces.ants import LaplacianThickness -# >>> cort_thick = LaplacianThickness() -# >>> cort_thick.inputs.input_wm = 'white_matter.nii.gz' -# >>> cort_thick.inputs.input_gm = 'gray_matter.nii.gz' -# >>> cort_thick.cmdline -# 'LaplacianThickness white_matter.nii.gz gray_matter.nii.gz white_matter_thickness.nii.gz' -# -# >>> cort_thick.inputs.output_image = 'output_thickness.nii.gz' -# >>> cort_thick.cmdline -# 'LaplacianThickness white_matter.nii.gz gray_matter.nii.gz output_thickness.nii.gz' -# -# -task_name: LaplacianThickness -nipype_name: LaplacianThickness -nipype_module: nipype.interfaces.ants.segmentation -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - input_gm: medimage/nifti-gz - # type=file|default=: gray matter segmentation image - input_wm: medimage/nifti-gz - # type=file|default=: white matter segmentation image - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_image: medimage/nifti-gz - # type=file: Cortical thickness - # type=str|default='': name of output file - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_wm: - # type=file|default=: white matter segmentation image - input_gm: - # type=file|default=: gray matter segmentation image - output_image: - # type=file: Cortical thickness - # type=str|default='': name of output file - smooth_param: - # type=float|default=0.0: Sigma of the Laplacian Recursive Image Filter (defaults to 1) - prior_thickness: - # type=float|default=0.0: Prior thickness (defaults to 500) - dT: - # type=float|default=0.0: Time delta used during integration (defaults to 0.01) - sulcus_prior: - # type=float|default=0.0: Positive floating point number for sulcus prior. Authors said that 0.15 might be a reasonable value - tolerance: - # type=float|default=0.0: Tolerance to reach during optimization (defaults to 0.001) - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_wm: - # type=file|default=: white matter segmentation image - input_gm: - # type=file|default=: gray matter segmentation image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - output_image: '"output_thickness.nii.gz"' - # type=file: Cortical thickness - # type=str|default='': name of output file - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: LaplacianThickness white_matter.nii.gz gray_matter.nii.gz white_matter_thickness.nii.gz - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_wm: '"white_matter.nii.gz"' - # type=file|default=: white matter segmentation image - input_gm: '"gray_matter.nii.gz"' - # type=file|default=: gray matter segmentation image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: LaplacianThickness white_matter.nii.gz gray_matter.nii.gz output_thickness.nii.gz - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - output_image: '"output_thickness.nii.gz"' - # type=file: Cortical thickness - # type=str|default='': name of output file - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/measure_image_similarity.yaml b/nipype-auto-conv/specs/measure_image_similarity.yaml deleted file mode 100644 index ca820bb..0000000 --- a/nipype-auto-conv/specs/measure_image_similarity.yaml +++ /dev/null @@ -1,190 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.registration.MeasureImageSimilarity' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# -# -# Examples -# -------- -# -# >>> from nipype.interfaces.ants import MeasureImageSimilarity -# >>> sim = MeasureImageSimilarity() -# >>> sim.inputs.dimension = 3 -# >>> sim.inputs.metric = 'MI' -# >>> sim.inputs.fixed_image = 'T1.nii' -# >>> sim.inputs.moving_image = 'resting.nii' -# >>> sim.inputs.metric_weight = 1.0 -# >>> sim.inputs.radius_or_number_of_bins = 5 -# >>> sim.inputs.sampling_strategy = 'Regular' -# >>> sim.inputs.sampling_percentage = 1.0 -# >>> sim.inputs.fixed_image_mask = 'mask.nii' -# >>> sim.inputs.moving_image_mask = 'mask.nii.gz' -# >>> sim.cmdline -# 'MeasureImageSimilarity --dimensionality 3 --masks ["mask.nii","mask.nii.gz"] --metric MI["T1.nii","resting.nii",1.0,5,Regular,1.0]' -# -task_name: MeasureImageSimilarity -nipype_name: MeasureImageSimilarity -nipype_module: nipype.interfaces.ants.registration -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - fixed_image: medimage/nifti1 - # type=file|default=: Image to which the moving image is warped - fixed_image_mask: medimage/nifti1 - # type=file|default=: mask used to limit metric sampling region of the fixed image - moving_image: medimage/nifti1 - # type=file|default=: Image to apply transformation to (generally a coregistered functional) - moving_image_mask: medimage/nifti-gz - # type=file|default=: mask used to limit metric sampling region of the moving image - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - similarity: similarity_callable - # type=float: - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=2|allowed[2,3,4]: Dimensionality of the fixed/moving image pair - fixed_image: - # type=file|default=: Image to which the moving image is warped - moving_image: - # type=file|default=: Image to apply transformation to (generally a coregistered functional) - metric: - # type=enum|default='CC'|allowed['CC','Demons','GC','MI','Mattes','MeanSquares']: - metric_weight: - # type=float|default=1.0: The "metricWeight" variable is not used. - radius_or_number_of_bins: - # type=int|default=0: The number of bins in each stage for the MI and Mattes metric, or the radius for other metrics - sampling_strategy: - # type=enum|default='None'|allowed['None','Random','Regular']: Manner of choosing point set over which to optimize the metric. Defaults to "None" (i.e. a dense sampling of one sample per voxel). - sampling_percentage: - # type=range|default=None: Percentage of points accessible to the sampling strategy over which to optimize the metric. - fixed_image_mask: - # type=file|default=: mask used to limit metric sampling region of the fixed image - moving_image_mask: - # type=file|default=: mask used to limit metric sampling region of the moving image - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=2|allowed[2,3,4]: Dimensionality of the fixed/moving image pair - metric: '"MI"' - # type=enum|default='CC'|allowed['CC','Demons','GC','MI','Mattes','MeanSquares']: - fixed_image: - # type=file|default=: Image to which the moving image is warped - moving_image: - # type=file|default=: Image to apply transformation to (generally a coregistered functional) - metric_weight: '1.0' - # type=float|default=1.0: The "metricWeight" variable is not used. - radius_or_number_of_bins: '5' - # type=int|default=0: The number of bins in each stage for the MI and Mattes metric, or the radius for other metrics - sampling_strategy: '"Regular"' - # type=enum|default='None'|allowed['None','Random','Regular']: Manner of choosing point set over which to optimize the metric. Defaults to "None" (i.e. a dense sampling of one sample per voxel). - sampling_percentage: '1.0' - # type=range|default=None: Percentage of points accessible to the sampling strategy over which to optimize the metric. - fixed_image_mask: - # type=file|default=: mask used to limit metric sampling region of the fixed image - moving_image_mask: - # type=file|default=: mask used to limit metric sampling region of the moving image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: MeasureImageSimilarity --dimensionality 3 --masks ["mask.nii","mask.nii.gz"] --metric MI["T1.nii","resting.nii",1.0,5,Regular,1.0] - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=2|allowed[2,3,4]: Dimensionality of the fixed/moving image pair - metric: '"MI"' - # type=enum|default='CC'|allowed['CC','Demons','GC','MI','Mattes','MeanSquares']: - fixed_image: '"T1.nii"' - # type=file|default=: Image to which the moving image is warped - moving_image: '"resting.nii"' - # type=file|default=: Image to apply transformation to (generally a coregistered functional) - metric_weight: '1.0' - # type=float|default=1.0: The "metricWeight" variable is not used. - radius_or_number_of_bins: '5' - # type=int|default=0: The number of bins in each stage for the MI and Mattes metric, or the radius for other metrics - sampling_strategy: '"Regular"' - # type=enum|default='None'|allowed['None','Random','Regular']: Manner of choosing point set over which to optimize the metric. Defaults to "None" (i.e. a dense sampling of one sample per voxel). - sampling_percentage: '1.0' - # type=range|default=None: Percentage of points accessible to the sampling strategy over which to optimize the metric. - fixed_image_mask: '"mask.nii"' - # type=file|default=: mask used to limit metric sampling region of the fixed image - moving_image_mask: '"mask.nii.gz"' - # type=file|default=: mask used to limit metric sampling region of the moving image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/multiply_images.yaml b/nipype-auto-conv/specs/multiply_images.yaml deleted file mode 100644 index 976836f..0000000 --- a/nipype-auto-conv/specs/multiply_images.yaml +++ /dev/null @@ -1,146 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.utils.MultiplyImages' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Examples -# -------- -# >>> from nipype.interfaces.ants import MultiplyImages -# >>> test = MultiplyImages() -# >>> test.inputs.dimension = 3 -# >>> test.inputs.first_input = 'moving2.nii' -# >>> test.inputs.second_input = 0.25 -# >>> test.inputs.output_product_image = "out.nii" -# >>> test.cmdline -# 'MultiplyImages 3 moving2.nii 0.25 out.nii' -# -task_name: MultiplyImages -nipype_name: MultiplyImages -nipype_module: nipype.interfaces.ants.utils -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - first_input: medimage/nifti1 - # type=file|default=: image 1 - output_product_image: Path - # type=file: average image file - # type=file|default=: Outputfname.nii.gz: the name of the resulting image. - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_product_image: medimage/nifti1 - # type=file: average image file - # type=file|default=: Outputfname.nii.gz: the name of the resulting image. - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - first_input: - # type=file|default=: image 1 - second_input: - # type=traitcompound|default=None: image 2 or multiplication weight - output_product_image: - # type=file: average image file - # type=file|default=: Outputfname.nii.gz: the name of the resulting image. - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - first_input: - # type=file|default=: image 1 - second_input: '0.25' - # type=traitcompound|default=None: image 2 or multiplication weight - output_product_image: '"out.nii"' - # type=file: average image file - # type=file|default=: Outputfname.nii.gz: the name of the resulting image. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: MultiplyImages 3 moving2.nii 0.25 out.nii - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - first_input: '"moving2.nii"' - # type=file|default=: image 1 - second_input: '0.25' - # type=traitcompound|default=None: image 2 or multiplication weight - output_product_image: '"out.nii"' - # type=file: average image file - # type=file|default=: Outputfname.nii.gz: the name of the resulting image. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/n4_bias_field_correction.yaml b/nipype-auto-conv/specs/n4_bias_field_correction.yaml deleted file mode 100644 index 25ed45b..0000000 --- a/nipype-auto-conv/specs/n4_bias_field_correction.yaml +++ /dev/null @@ -1,381 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.segmentation.N4BiasFieldCorrection' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Bias field correction. -# -# N4 is a variant of the popular N3 (nonparameteric nonuniform normalization) -# retrospective bias correction algorithm. Based on the assumption that the -# corruption of the low frequency bias field can be modeled as a convolution of -# the intensity histogram by a Gaussian, the basic algorithmic protocol is to -# iterate between deconvolving the intensity histogram by a Gaussian, remapping -# the intensities, and then spatially smoothing this result by a B-spline modeling -# of the bias field itself. The modifications from and improvements obtained over -# the original N3 algorithm are described in [Tustison2010]_. -# -# .. [Tustison2010] N. Tustison et al., -# N4ITK: Improved N3 Bias Correction, IEEE Transactions on Medical Imaging, -# 29(6):1310-1320, June 2010. -# -# Examples -# -------- -# -# >>> import copy -# >>> from nipype.interfaces.ants import N4BiasFieldCorrection -# >>> n4 = N4BiasFieldCorrection() -# >>> n4.inputs.dimension = 3 -# >>> n4.inputs.input_image = 'structural.nii' -# >>> n4.inputs.bspline_fitting_distance = 300 -# >>> n4.inputs.shrink_factor = 3 -# >>> n4.inputs.n_iterations = [50,50,30,20] -# >>> n4.cmdline -# 'N4BiasFieldCorrection --bspline-fitting [ 300 ] -# -d 3 --input-image structural.nii -# --convergence [ 50x50x30x20 ] --output structural_corrected.nii -# --shrink-factor 3' -# -# >>> n4_2 = copy.deepcopy(n4) -# >>> n4_2.inputs.convergence_threshold = 1e-6 -# >>> n4_2.cmdline -# 'N4BiasFieldCorrection --bspline-fitting [ 300 ] -# -d 3 --input-image structural.nii -# --convergence [ 50x50x30x20, 1e-06 ] --output structural_corrected.nii -# --shrink-factor 3' -# -# >>> n4_3 = copy.deepcopy(n4_2) -# >>> n4_3.inputs.bspline_order = 5 -# >>> n4_3.cmdline -# 'N4BiasFieldCorrection --bspline-fitting [ 300, 5 ] -# -d 3 --input-image structural.nii -# --convergence [ 50x50x30x20, 1e-06 ] --output structural_corrected.nii -# --shrink-factor 3' -# -# >>> n4_4 = N4BiasFieldCorrection() -# >>> n4_4.inputs.input_image = 'structural.nii' -# >>> n4_4.inputs.save_bias = True -# >>> n4_4.inputs.dimension = 3 -# >>> n4_4.cmdline -# 'N4BiasFieldCorrection -d 3 --input-image structural.nii -# --output [ structural_corrected.nii, structural_bias.nii ]' -# -# >>> n4_5 = N4BiasFieldCorrection() -# >>> n4_5.inputs.input_image = 'structural.nii' -# >>> n4_5.inputs.dimension = 3 -# >>> n4_5.inputs.histogram_sharpening = (0.12, 0.02, 200) -# >>> n4_5.cmdline -# 'N4BiasFieldCorrection -d 3 --histogram-sharpening [0.12,0.02,200] -# --input-image structural.nii --output structural_corrected.nii' -# -# -task_name: N4BiasFieldCorrection -nipype_name: N4BiasFieldCorrection -nipype_module: nipype.interfaces.ants.segmentation -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - bias_image: Path - # type=file: Estimated bias - # type=file|default=: Filename for the estimated bias. - input_image: medimage/nifti1 - # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction - mask_image: generic/file - # type=file|default=: image to specify region to perform final bias correction in - weight_image: generic/file - # type=file|default=: image for relative weighting (e.g. probability map of the white matter) of voxels during the B-spline fitting. - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - bias_image: generic/file - # type=file: Estimated bias - # type=file|default=: Filename for the estimated bias. - output_image: generic/file - # type=file: Warped image - # type=str|default='': output file name - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) - input_image: - # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction - mask_image: - # type=file|default=: image to specify region to perform final bias correction in - weight_image: - # type=file|default=: image for relative weighting (e.g. probability map of the white matter) of voxels during the B-spline fitting. - output_image: - # type=file: Warped image - # type=str|default='': output file name - bspline_fitting_distance: - # type=float|default=0.0: - bspline_order: - # type=int|default=0: - shrink_factor: - # type=int|default=0: - n_iterations: - # type=list|default=[]: - convergence_threshold: - # type=float|default=0.0: - save_bias: - # type=bool|default=False: True if the estimated bias should be saved to file. - bias_image: - # type=file: Estimated bias - # type=file|default=: Filename for the estimated bias. - copy_header: - # type=bool|default=False: copy headers of the original image into the output (corrected) file - rescale_intensities: - # type=bool|default=False: [NOTE: Only ANTs>=2.1.0] At each iteration, a new intensity mapping is calculated and applied but there is nothing which constrains the new intensity range to be within certain values. The result is that the range can "drift" from the original at each iteration. This option rescales to the [min,max] range of the original image intensities within the user-specified mask. - histogram_sharpening: - # type=tuple|default=(0.15, 0.01, 200): Three-values tuple of histogram sharpening parameters (FWHM, wienerNose, numberOfHistogramBins). These options describe the histogram sharpening parameters, i.e. the deconvolution step parameters described in the original N3 algorithm. The default values have been shown to work fairly well. - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) - input_image: - # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction - bspline_fitting_distance: '300' - # type=float|default=0.0: - shrink_factor: '3' - # type=int|default=0: - n_iterations: '[50,50,30,20]' - # type=list|default=[]: - imports: &id001 - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - - module: copy - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - convergence_threshold: 1e-6 - # type=float|default=0.0: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - bspline_order: '5' - # type=int|default=0: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction - save_bias: 'True' - # type=bool|default=False: True if the estimated bias should be saved to file. - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) - histogram_sharpening: (0.12, 0.02, 200) - # type=tuple|default=(0.15, 0.01, 200): Three-values tuple of histogram sharpening parameters (FWHM, wienerNose, numberOfHistogramBins). These options describe the histogram sharpening parameters, i.e. the deconvolution step parameters described in the original N3 algorithm. The default values have been shown to work fairly well. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: N4BiasFieldCorrection --bspline-fitting [ 300 ] -d 3 --input-image structural.nii --convergence [ 50x50x30x20 ] --output structural_corrected.nii --shrink-factor 3 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) - input_image: '"structural.nii"' - # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction - bspline_fitting_distance: '300' - # type=float|default=0.0: - shrink_factor: '3' - # type=int|default=0: - n_iterations: '[50,50,30,20]' - # type=list|default=[]: - imports: *id001 - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: N4BiasFieldCorrection --bspline-fitting [ 300 ] -d 3 --input-image structural.nii --convergence [ 50x50x30x20, 1e-06 ] --output structural_corrected.nii --shrink-factor 3 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - convergence_threshold: 1e-6 - # type=float|default=0.0: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: N4BiasFieldCorrection --bspline-fitting [ 300, 5 ] -d 3 --input-image structural.nii --convergence [ 50x50x30x20, 1e-06 ] --output structural_corrected.nii --shrink-factor 3 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - bspline_order: '5' - # type=int|default=0: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: N4BiasFieldCorrection -d 3 --input-image structural.nii --output [ structural_corrected.nii, structural_bias.nii ] - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"structural.nii"' - # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction - save_bias: 'True' - # type=bool|default=False: True if the estimated bias should be saved to file. - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: N4BiasFieldCorrection -d 3 --histogram-sharpening [0.12,0.02,200] --input-image structural.nii --output structural_corrected.nii - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"structural.nii"' - # type=file|default=: input for bias correction. Negative values or values close to zero should be processed prior to correction - dimension: '3' - # type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4) - histogram_sharpening: (0.12, 0.02, 200) - # type=tuple|default=(0.15, 0.01, 200): Three-values tuple of histogram sharpening parameters (FWHM, wienerNose, numberOfHistogramBins). These options describe the histogram sharpening parameters, i.e. the deconvolution step parameters described in the original N3 algorithm. The default values have been shown to work fairly well. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/package.yaml b/nipype-auto-conv/specs/package.yaml new file mode 100644 index 0000000..3de1f92 --- /dev/null +++ b/nipype-auto-conv/specs/package.yaml @@ -0,0 +1,8 @@ +# name of the package to generate, e.g. pydra.tasks.mriqc +name: pydra.tasks.ants +# name of the nipype package to generate from (e.g. mriqc) +nipype_name: nipype.interfaces.ants +# The name of the global struct/dict that contains workflow inputs that are to be converted to inputs of the function along with the type of the struct, either "dict" or "class" +config_params: null +# Mappings between nipype packages and their pydra equivalents. Regular expressions are supported +import_translations: null diff --git a/nipype-auto-conv/specs/registration.yaml b/nipype-auto-conv/specs/registration.yaml deleted file mode 100644 index a02d798..0000000 --- a/nipype-auto-conv/specs/registration.yaml +++ /dev/null @@ -1,1118 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.registration.Registration' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# ANTs Registration command for registration of images -# -# `antsRegistration `_ registers a ``moving_image`` to a ``fixed_image``, -# using a predefined (sequence of) cost function(s) and transformation operations. -# The cost function is defined using one or more 'metrics', specifically -# local cross-correlation (``CC``), Mean Squares (``MeanSquares``), Demons (``Demons``), -# global correlation (``GC``), or Mutual Information (``Mattes`` or ``MI``). -# -# ANTS can use both linear (``Translation``, ``Rigid``, ``Affine``, ``CompositeAffine``, -# or ``Translation``) and non-linear transformations (``BSpline``, ``GaussianDisplacementField``, -# ``TimeVaryingVelocityField``, ``TimeVaryingBSplineVelocityField``, ``SyN``, ``BSplineSyN``, -# ``Exponential``, or ``BSplineExponential``). Usually, registration is done in multiple -# *stages*. For example first an Affine, then a Rigid, and ultimately a non-linear -# (Syn)-transformation. -# -# antsRegistration can be initialized using one or more transforms from moving_image -# to fixed_image with the ``initial_moving_transform``-input. For example, when you -# already have a warpfield that corrects for geometrical distortions in an EPI (functional) image, -# that you want to apply before an Affine registration to a structural image. -# You could put this transform into 'intial_moving_transform'. -# -# The Registration-interface can output the resulting transform(s) that map moving_image to -# fixed_image in a single file as a ``composite_transform`` (if ``write_composite_transform`` -# is set to ``True``), or a list of transforms as ``forwards_transforms``. It can also output -# inverse transforms (from ``fixed_image`` to ``moving_image``) in a similar fashion using -# ``inverse_composite_transform``. Note that the order of ``forward_transforms`` is in 'natural' -# order: the first element should be applied first, the last element should be applied last. -# -# Note, however, that ANTS tools always apply lists of transformations in reverse order (the last -# transformation in the list is applied first). Therefore, if the output forward_transforms -# is a list, one can not directly feed it into, for example, ``ants.ApplyTransforms``. To -# make ``ants.ApplyTransforms`` apply the transformations in the same order as ``ants.Registration``, -# you have to provide the list of transformations in reverse order from ``forward_transforms``. -# ``reverse_forward_transforms`` outputs ``forward_transforms`` in reverse order and can be used for -# this purpose. Note also that, because ``composite_transform`` is always a single file, this -# output is preferred for most use-cases. -# -# More information can be found in the `ANTS -# manual `_. -# -# See below for some useful examples. -# -# Examples -# -------- -# -# Set up a Registration node with some default settings. This Node registers -# 'fixed1.nii' to 'moving1.nii' by first fitting a linear 'Affine' transformation, and -# then a non-linear 'SyN' transformation, both using the Mutual Information-cost -# metric. -# -# The registration is initialized by first applying the (linear) transform -# trans.mat. -# -# >>> import copy, pprint -# >>> from nipype.interfaces.ants import Registration -# >>> reg = Registration() -# >>> reg.inputs.fixed_image = 'fixed1.nii' -# >>> reg.inputs.moving_image = 'moving1.nii' -# >>> reg.inputs.output_transform_prefix = "output_" -# >>> reg.inputs.initial_moving_transform = 'trans.mat' -# >>> reg.inputs.transforms = ['Affine', 'SyN'] -# >>> reg.inputs.transform_parameters = [(2.0,), (0.25, 3.0, 0.0)] -# >>> reg.inputs.number_of_iterations = [[1500, 200], [100, 50, 30]] -# >>> reg.inputs.dimension = 3 -# >>> reg.inputs.write_composite_transform = True -# >>> reg.inputs.collapse_output_transforms = False -# >>> reg.inputs.initialize_transforms_per_stage = False -# >>> reg.inputs.metric = ['Mattes']*2 -# >>> reg.inputs.metric_weight = [1]*2 # Default (value ignored currently by ANTs) -# >>> reg.inputs.radius_or_number_of_bins = [32]*2 -# >>> reg.inputs.sampling_strategy = ['Random', None] -# >>> reg.inputs.sampling_percentage = [0.05, None] -# >>> reg.inputs.convergence_threshold = [1.e-8, 1.e-9] -# >>> reg.inputs.convergence_window_size = [20]*2 -# >>> reg.inputs.smoothing_sigmas = [[1,0], [2,1,0]] -# >>> reg.inputs.sigma_units = ['vox'] * 2 -# >>> reg.inputs.shrink_factors = [[2,1], [3,2,1]] -# >>> reg.inputs.use_estimate_learning_rate_once = [True, True] -# >>> reg.inputs.use_histogram_matching = [True, True] # This is the default -# >>> reg.inputs.output_warped_image = 'output_warped_image.nii.gz' -# >>> reg.cmdline -# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 0 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' -# >>> reg.run() # doctest: +SKIP -# -# Same as reg1, but first invert the initial transform ('trans.mat') before applying it. -# -# >>> reg.inputs.invert_initial_moving_transform = True -# >>> reg1 = copy.deepcopy(reg) -# >>> reg1.inputs.winsorize_lower_quantile = 0.025 -# >>> reg1.cmdline -# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.025, 1.0 ] --write-composite-transform 1' -# >>> reg1.run() # doctest: +SKIP -# -# Clip extremely high intensity data points using winsorize_upper_quantile. All data points -# higher than the 0.975 quantile are set to the value of the 0.975 quantile. -# -# >>> reg2 = copy.deepcopy(reg) -# >>> reg2.inputs.winsorize_upper_quantile = 0.975 -# >>> reg2.cmdline -# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 0.975 ] --write-composite-transform 1' -# -# Clip extremely low intensity data points using winsorize_lower_quantile. All data points -# lower than the 0.025 quantile are set to the original value at the 0.025 quantile. -# -# -# >>> reg3 = copy.deepcopy(reg) -# >>> reg3.inputs.winsorize_lower_quantile = 0.025 -# >>> reg3.inputs.winsorize_upper_quantile = 0.975 -# >>> reg3.cmdline -# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.025, 0.975 ] --write-composite-transform 1' -# -# Use float instead of double for computations (saves memory usage) -# -# >>> reg3a = copy.deepcopy(reg) -# >>> reg3a.inputs.float = True -# >>> reg3a.cmdline -# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --float 1 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' -# -# Force to use double instead of float for computations (more precision and memory usage). -# -# >>> reg3b = copy.deepcopy(reg) -# >>> reg3b.inputs.float = False -# >>> reg3b.cmdline -# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --float 0 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' -# -# 'collapse_output_transforms' can be used to put all transformation in a single 'composite_transform'- -# file. Note that forward_transforms will now be an empty list. -# -# >>> # Test collapse transforms flag -# >>> reg4 = copy.deepcopy(reg) -# >>> reg4.inputs.save_state = 'trans.mat' -# >>> reg4.inputs.restore_state = 'trans.mat' -# >>> reg4.inputs.initialize_transforms_per_stage = True -# >>> reg4.inputs.collapse_output_transforms = True -# >>> outputs = reg4._list_outputs() -# >>> pprint.pprint(outputs) # doctest: +ELLIPSIS, -# {'composite_transform': '...data/output_Composite.h5', -# 'elapsed_time': , -# 'forward_invert_flags': [], -# 'forward_transforms': [], -# 'inverse_composite_transform': '...data/output_InverseComposite.h5', -# 'inverse_warped_image': , -# 'metric_value': , -# 'reverse_forward_invert_flags': [], -# 'reverse_forward_transforms': [], -# 'reverse_invert_flags': [], -# 'reverse_transforms': [], -# 'save_state': '...data/trans.mat', -# 'warped_image': '...data/output_warped_image.nii.gz'} -# >>> reg4.cmdline -# 'antsRegistration --collapse-output-transforms 1 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 1 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --restore-state trans.mat --save-state trans.mat --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' -# -# -# >>> # Test collapse transforms flag -# >>> reg4b = copy.deepcopy(reg4) -# >>> reg4b.inputs.write_composite_transform = False -# >>> outputs = reg4b._list_outputs() -# >>> pprint.pprint(outputs) # doctest: +ELLIPSIS, -# {'composite_transform': , -# 'elapsed_time': , -# 'forward_invert_flags': [False, False], -# 'forward_transforms': ['...data/output_0GenericAffine.mat', -# '...data/output_1Warp.nii.gz'], -# 'inverse_composite_transform': , -# 'inverse_warped_image': , -# 'metric_value': , -# 'reverse_forward_invert_flags': [False, False], -# 'reverse_forward_transforms': ['...data/output_1Warp.nii.gz', -# '...data/output_0GenericAffine.mat'], -# 'reverse_invert_flags': [True, False], -# 'reverse_transforms': ['...data/output_0GenericAffine.mat', '...data/output_1InverseWarp.nii.gz'], -# 'save_state': '...data/trans.mat', -# 'warped_image': '...data/output_warped_image.nii.gz'} -# >>> reg4b.aggregate_outputs() # doctest: +SKIP -# >>> reg4b.cmdline -# 'antsRegistration --collapse-output-transforms 1 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 1 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --restore-state trans.mat --save-state trans.mat --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 0' -# -# One can use multiple similarity metrics in a single registration stage.The Node below first -# performs a linear registation using only the Mutual Information ('Mattes')-metric. -# In a second stage, it performs a non-linear registration ('Syn') using both a -# Mutual Information and a local cross-correlation ('CC')-metric. Both metrics are weighted -# equally ('metric_weight' is .5 for both). The Mutual Information- metric uses 32 bins. -# The local cross-correlations (correlations between every voxel's neighborhoods) is computed -# with a radius of 4. -# -# >>> # Test multiple metrics per stage -# >>> reg5 = copy.deepcopy(reg) -# >>> reg5.inputs.fixed_image = 'fixed1.nii' -# >>> reg5.inputs.moving_image = 'moving1.nii' -# >>> reg5.inputs.metric = ['Mattes', ['Mattes', 'CC']] -# >>> reg5.inputs.metric_weight = [1, [.5,.5]] -# >>> reg5.inputs.radius_or_number_of_bins = [32, [32, 4] ] -# >>> reg5.inputs.sampling_strategy = ['Random', None] # use default strategy in second stage -# >>> reg5.inputs.sampling_percentage = [0.05, [0.05, 0.10]] -# >>> reg5.cmdline -# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 0.5, 32, None, 0.05 ] --metric CC[ fixed1.nii, moving1.nii, 0.5, 4, None, 0.1 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' -# -# ANTS Registration can also use multiple modalities to perform the registration. Here it is assumed -# that fixed1.nii and fixed2.nii are in the same space, and so are moving1.nii and -# moving2.nii. First, a linear registration is performed matching fixed1.nii to moving1.nii, -# then a non-linear registration is performed to match fixed2.nii to moving2.nii, starting from -# the transformation of the first step. -# -# >>> # Test multiple inputS -# >>> reg6 = copy.deepcopy(reg5) -# >>> reg6.inputs.fixed_image = ['fixed1.nii', 'fixed2.nii'] -# >>> reg6.inputs.moving_image = ['moving1.nii', 'moving2.nii'] -# >>> reg6.cmdline -# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 0.5, 32, None, 0.05 ] --metric CC[ fixed2.nii, moving2.nii, 0.5, 4, None, 0.1 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' -# -# Different methods can be used for the interpolation when applying transformations. -# -# >>> # Test Interpolation Parameters (BSpline) -# >>> reg7a = copy.deepcopy(reg) -# >>> reg7a.inputs.interpolation = 'BSpline' -# >>> reg7a.inputs.interpolation_parameters = (3,) -# >>> reg7a.cmdline -# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation BSpline[ 3 ] --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' -# -# >>> # Test Interpolation Parameters (MultiLabel/Gaussian) -# >>> reg7b = copy.deepcopy(reg) -# >>> reg7b.inputs.interpolation = 'Gaussian' -# >>> reg7b.inputs.interpolation_parameters = (1.0, 1.0) -# >>> reg7b.cmdline -# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Gaussian[ 1.0, 1.0 ] --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' -# -# BSplineSyN non-linear registration with custom parameters. -# -# >>> # Test Extended Transform Parameters -# >>> reg8 = copy.deepcopy(reg) -# >>> reg8.inputs.transforms = ['Affine', 'BSplineSyN'] -# >>> reg8.inputs.transform_parameters = [(2.0,), (0.25, 26, 0, 3)] -# >>> reg8.cmdline -# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform BSplineSyN[ 0.25, 26, 0, 3 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' -# -# Mask the fixed image in the second stage of the registration (but not the first). -# -# >>> # Test masking -# >>> reg9 = copy.deepcopy(reg) -# >>> reg9.inputs.fixed_image_masks = ['NULL', 'fixed1.nii'] -# >>> reg9.cmdline -# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --masks [ NULL, NULL ] --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --masks [ fixed1.nii, NULL ] --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' -# -# Here we use both a warpfield and a linear transformation, before registration commences. Note that -# the first transformation that needs to be applied ('ants_Warp.nii.gz') is last in the list of -# 'initial_moving_transform'. -# -# >>> # Test initialization with multiple transforms matrices (e.g., unwarp and affine transform) -# >>> reg10 = copy.deepcopy(reg) -# >>> reg10.inputs.initial_moving_transform = ['func_to_struct.mat', 'ants_Warp.nii.gz'] -# >>> reg10.inputs.invert_initial_moving_transform = [False, False] -# >>> reg10.cmdline -# 'antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ func_to_struct.mat, 0 ] [ ants_Warp.nii.gz, 0 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1' -# -task_name: Registration -nipype_name: Registration -nipype_module: nipype.interfaces.ants.registration -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - fixed_image: medimage/nifti1+list-of - # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) - fixed_image_mask: generic/file - # type=file|default=: Mask used to limit metric sampling region of the fixed imagein all stages - initial_moving_transform: datascience/text-matrix+list-of - # type=inputmultiobject|default=[]: A transform or a list of transforms that should be applied before the registration begins. Note that, when a list is given, the transformations are applied in reverse order. - moving_image: medimage/nifti1+list-of - # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to - moving_image_mask: generic/file - # type=file|default=: mask used to limit metric sampling region of the moving imagein all stages - restore_state: datascience/text-matrix - # type=file|default=: Filename for restoring the internal restorable state of the registration - save_state: Path - # type=file: The saved registration state to be restored - # type=file|default=: Filename for saving the internal restorable state of the registration - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - composite_transform: generic/file - # type=file: Composite transform file - forward_transforms: generic/file+list-of - # type=list: List of output transforms for forward registration - inverse_composite_transform: generic/file - # type=file: Inverse composite transform file - inverse_warped_image: generic/file - # type=file: Outputs the inverse of the warped image - reverse_forward_transforms: generic/file+list-of - # type=list: List of output transforms for forward registration reversed for antsApplyTransform - reverse_transforms: generic/file+list-of - # type=list: List of output transforms for reverse registration - save_state: datascience/text-matrix - # type=file: The saved registration state to be restored - # type=file|default=: Filename for saving the internal restorable state of the registration - warped_image: generic/file - # type=file: Outputs warped image - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - elapsed_time: elapsed_time_callable - # type=float: the total elapsed time as reported by ANTs - metric_value: metric_value_callable - # type=float: the final value of metric - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - fixed_image: - # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) - fixed_image_mask: - # type=file|default=: Mask used to limit metric sampling region of the fixed imagein all stages - fixed_image_masks: - # type=inputmultiobject|default=[]: Masks used to limit metric sampling region of the fixed image, defined per registration stage(Use "NULL" to omit a mask at a given stage) - moving_image: - # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to - moving_image_mask: - # type=file|default=: mask used to limit metric sampling region of the moving imagein all stages - moving_image_masks: - # type=inputmultiobject|default=[]: Masks used to limit metric sampling region of the moving image, defined per registration stage(Use "NULL" to omit a mask at a given stage) - save_state: - # type=file: The saved registration state to be restored - # type=file|default=: Filename for saving the internal restorable state of the registration - restore_state: - # type=file|default=: Filename for restoring the internal restorable state of the registration - initial_moving_transform: - # type=inputmultiobject|default=[]: A transform or a list of transforms that should be applied before the registration begins. Note that, when a list is given, the transformations are applied in reverse order. - invert_initial_moving_transform: - # type=inputmultiobject|default=[]: One boolean or a list of booleans that indicatewhether the inverse(s) of the transform(s) definedin initial_moving_transform should be used. - initial_moving_transform_com: - # type=enum|default=0|allowed[0,1,2]: Align the moving_image and fixed_image before registration using the geometric center of the images (=0), the image intensities (=1), or the origin of the images (=2). - metric_item_trait: - # type=enum|default='CC'|allowed['CC','Demons','GC','MI','Mattes','MeanSquares']: - metric_stage_trait: - # type=traitcompound|default=None: - metric: - # type=list|default=[]: the metric(s) to use for each stage. Note that multiple metrics per stage are not supported in ANTS 1.9.1 and earlier. - metric_weight_item_trait: - # type=float|default=1.0: - metric_weight_stage_trait: - # type=traitcompound|default=None: - metric_weight: - # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. - radius_bins_item_trait: - # type=int|default=5: - radius_bins_stage_trait: - # type=traitcompound|default=None: - radius_or_number_of_bins: - # type=list|default=[5]: the number of bins in each stage for the MI and Mattes metric, the radius for other metrics - sampling_strategy_item_trait: - # type=enum|default='None'|allowed['None','Random','Regular',None]: - sampling_strategy_stage_trait: - # type=traitcompound|default=None: - sampling_strategy: - # type=list|default=[]: the metric sampling strategy (strategies) for each stage - sampling_percentage_item_trait: - # type=traitcompound|default=None: - sampling_percentage_stage_trait: - # type=traitcompound|default=None: - sampling_percentage: - # type=list|default=[]: the metric sampling percentage(s) to use for each stage - use_estimate_learning_rate_once: - # type=list|default=[]: - use_histogram_matching: - # type=traitcompound|default=True: Histogram match the images before registration. - interpolation: - # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','GenericLabel','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: - interpolation_parameters: - # type=traitcompound|default=None: - write_composite_transform: - # type=bool|default=False: - collapse_output_transforms: - # type=bool|default=True: Collapse output transforms. Specifically, enabling this option combines all adjacent linear transforms and composes all adjacent displacement field transforms before writing the results to disk. - initialize_transforms_per_stage: - # type=bool|default=False: Initialize linear transforms from the previous stage. By enabling this option, the current linear stage transform is directly initialized from the previous stages linear transform; this allows multiple linear stages to be run where each stage directly updates the estimated linear transform from the previous stage. (e.g. Translation -> Rigid -> Affine). - float: - # type=bool|default=False: Use float instead of double for computations. - transforms: - # type=list|default=[]: - transform_parameters: - # type=list|default=[]: - restrict_deformation: - # type=list|default=[]: This option allows the user to restrict the optimization of the displacement field, translation, rigid or affine transform on a per-component basis. For example, if one wants to limit the deformation or rotation of 3-D volume to the first two dimensions, this is possible by specifying a weight vector of '1x1x0' for a deformation field or '1x1x0x1x1x0' for a rigid transformation. Low-dimensional restriction only works if there are no preceding transformations. - number_of_iterations: - # type=list|default=[]: - smoothing_sigmas: - # type=list|default=[]: - sigma_units: - # type=list|default=[]: units for smoothing sigmas - shrink_factors: - # type=list|default=[]: - convergence_threshold: - # type=list|default=[1e-06]: - convergence_window_size: - # type=list|default=[10]: - output_transform_prefix: - # type=str|default='transform': - output_warped_image: - # type=traitcompound|default=None: - output_inverse_warped_image: - # type=traitcompound|default=None: - winsorize_upper_quantile: - # type=range|default=1.0: The Upper quantile to clip image ranges - winsorize_lower_quantile: - # type=range|default=0.0: The Lower quantile to clip image ranges - random_seed: - # type=int|default=0: Fixed seed for random number generation - verbose: - # type=bool|default=False: - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - fixed_image: - # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) - moving_image: - # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to - output_transform_prefix: '"output_"' - # type=str|default='transform': - initial_moving_transform: - # type=inputmultiobject|default=[]: A transform or a list of transforms that should be applied before the registration begins. Note that, when a list is given, the transformations are applied in reverse order. - transforms: '["Affine", "SyN"]' - # type=list|default=[]: - transform_parameters: '[(2.0,), (0.25, 3.0, 0.0)]' - # type=list|default=[]: - number_of_iterations: '[[1500, 200], [100, 50, 30]]' - # type=list|default=[]: - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - write_composite_transform: 'True' - # type=bool|default=False: - collapse_output_transforms: 'False' - # type=bool|default=True: Collapse output transforms. Specifically, enabling this option combines all adjacent linear transforms and composes all adjacent displacement field transforms before writing the results to disk. - initialize_transforms_per_stage: 'False' - # type=bool|default=False: Initialize linear transforms from the previous stage. By enabling this option, the current linear stage transform is directly initialized from the previous stages linear transform; this allows multiple linear stages to be run where each stage directly updates the estimated linear transform from the previous stage. (e.g. Translation -> Rigid -> Affine). - metric: '["Mattes"]*2' - # type=list|default=[]: the metric(s) to use for each stage. Note that multiple metrics per stage are not supported in ANTS 1.9.1 and earlier. - metric_weight: '[1]*2 # Default (value ignored currently by ANTs)' - # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. - radius_or_number_of_bins: '[32]*2' - # type=list|default=[5]: the number of bins in each stage for the MI and Mattes metric, the radius for other metrics - sampling_strategy: '["Random", None]' - # type=list|default=[]: the metric sampling strategy (strategies) for each stage - sampling_percentage: '[0.05, None]' - # type=list|default=[]: the metric sampling percentage(s) to use for each stage - convergence_threshold: '[1.e-8, 1.e-9]' - # type=list|default=[1e-06]: - convergence_window_size: '[20]*2' - # type=list|default=[10]: - smoothing_sigmas: '[[1,0], [2,1,0]]' - # type=list|default=[]: - sigma_units: '["vox"] * 2' - # type=list|default=[]: units for smoothing sigmas - shrink_factors: '[[2,1], [3,2,1]]' - # type=list|default=[]: - use_estimate_learning_rate_once: '[True, True]' - # type=list|default=[]: - use_histogram_matching: '[True, True] # This is the default' - # type=traitcompound|default=True: Histogram match the images before registration. - output_warped_image: '"output_warped_image.nii.gz"' - # type=traitcompound|default=None: - imports: &id001 - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - - module: copy - - module: pprint - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - invert_initial_moving_transform: 'True' - # type=inputmultiobject|default=[]: One boolean or a list of booleans that indicatewhether the inverse(s) of the transform(s) definedin initial_moving_transform should be used. - winsorize_lower_quantile: '0.025' - # type=range|default=0.0: The Lower quantile to clip image ranges - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - winsorize_upper_quantile: '0.975' - # type=range|default=1.0: The Upper quantile to clip image ranges - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - winsorize_lower_quantile: '0.025' - # type=range|default=0.0: The Lower quantile to clip image ranges - winsorize_upper_quantile: '0.975' - # type=range|default=1.0: The Upper quantile to clip image ranges - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - float: 'True' - # type=bool|default=False: Use float instead of double for computations. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - float: 'False' - # type=bool|default=False: Use float instead of double for computations. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - save_state: '"trans.mat"' - # type=file: The saved registration state to be restored - # type=file|default=: Filename for saving the internal restorable state of the registration - restore_state: - # type=file|default=: Filename for restoring the internal restorable state of the registration - initialize_transforms_per_stage: 'True' - # type=bool|default=False: Initialize linear transforms from the previous stage. By enabling this option, the current linear stage transform is directly initialized from the previous stages linear transform; this allows multiple linear stages to be run where each stage directly updates the estimated linear transform from the previous stage. (e.g. Translation -> Rigid -> Affine). - collapse_output_transforms: 'True' - # type=bool|default=True: Collapse output transforms. Specifically, enabling this option combines all adjacent linear transforms and composes all adjacent displacement field transforms before writing the results to disk. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - write_composite_transform: 'False' - # type=bool|default=False: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - fixed_image: - # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) - moving_image: - # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to - metric: '["Mattes", ["Mattes", "CC"]]' - # type=list|default=[]: the metric(s) to use for each stage. Note that multiple metrics per stage are not supported in ANTS 1.9.1 and earlier. - metric_weight: '[1, [.5,.5]]' - # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. - radius_or_number_of_bins: '[32, [32, 4] ]' - # type=list|default=[5]: the number of bins in each stage for the MI and Mattes metric, the radius for other metrics - sampling_strategy: '["Random", None] # use default strategy in second stage' - # type=list|default=[]: the metric sampling strategy (strategies) for each stage - sampling_percentage: '[0.05, [0.05, 0.10]]' - # type=list|default=[]: the metric sampling percentage(s) to use for each stage - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - fixed_image: - # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) - moving_image: - # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - interpolation: '"BSpline"' - # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','GenericLabel','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: - interpolation_parameters: (3,) - # type=traitcompound|default=None: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - interpolation: '"Gaussian"' - # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','GenericLabel','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: - interpolation_parameters: (1.0, 1.0) - # type=traitcompound|default=None: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - transforms: '["Affine", "BSplineSyN"]' - # type=list|default=[]: - transform_parameters: '[(2.0,), (0.25, 26, 0, 3)]' - # type=list|default=[]: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - fixed_image_masks: '["NULL", "fixed1.nii"]' - # type=inputmultiobject|default=[]: Masks used to limit metric sampling region of the fixed image, defined per registration stage(Use "NULL" to omit a mask at a given stage) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - initial_moving_transform: - # type=inputmultiobject|default=[]: A transform or a list of transforms that should be applied before the registration begins. Note that, when a list is given, the transformations are applied in reverse order. - invert_initial_moving_transform: '[False, False]' - # type=inputmultiobject|default=[]: One boolean or a list of booleans that indicatewhether the inverse(s) of the transform(s) definedin initial_moving_transform should be used. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 0 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - fixed_image: '"fixed1.nii"' - # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) - moving_image: '"moving1.nii"' - # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to - output_transform_prefix: '"output_"' - # type=str|default='transform': - initial_moving_transform: '"trans.mat"' - # type=inputmultiobject|default=[]: A transform or a list of transforms that should be applied before the registration begins. Note that, when a list is given, the transformations are applied in reverse order. - transforms: '["Affine", "SyN"]' - # type=list|default=[]: - transform_parameters: '[(2.0,), (0.25, 3.0, 0.0)]' - # type=list|default=[]: - number_of_iterations: '[[1500, 200], [100, 50, 30]]' - # type=list|default=[]: - dimension: '3' - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - write_composite_transform: 'True' - # type=bool|default=False: - collapse_output_transforms: 'False' - # type=bool|default=True: Collapse output transforms. Specifically, enabling this option combines all adjacent linear transforms and composes all adjacent displacement field transforms before writing the results to disk. - initialize_transforms_per_stage: 'False' - # type=bool|default=False: Initialize linear transforms from the previous stage. By enabling this option, the current linear stage transform is directly initialized from the previous stages linear transform; this allows multiple linear stages to be run where each stage directly updates the estimated linear transform from the previous stage. (e.g. Translation -> Rigid -> Affine). - metric: '["Mattes"]*2' - # type=list|default=[]: the metric(s) to use for each stage. Note that multiple metrics per stage are not supported in ANTS 1.9.1 and earlier. - metric_weight: '[1]*2 # Default (value ignored currently by ANTs)' - # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. - radius_or_number_of_bins: '[32]*2' - # type=list|default=[5]: the number of bins in each stage for the MI and Mattes metric, the radius for other metrics - sampling_strategy: '["Random", None]' - # type=list|default=[]: the metric sampling strategy (strategies) for each stage - sampling_percentage: '[0.05, None]' - # type=list|default=[]: the metric sampling percentage(s) to use for each stage - convergence_threshold: '[1.e-8, 1.e-9]' - # type=list|default=[1e-06]: - convergence_window_size: '[20]*2' - # type=list|default=[10]: - smoothing_sigmas: '[[1,0], [2,1,0]]' - # type=list|default=[]: - sigma_units: '["vox"] * 2' - # type=list|default=[]: units for smoothing sigmas - shrink_factors: '[[2,1], [3,2,1]]' - # type=list|default=[]: - use_estimate_learning_rate_once: '[True, True]' - # type=list|default=[]: - use_histogram_matching: '[True, True] # This is the default' - # type=traitcompound|default=True: Histogram match the images before registration. - output_warped_image: '"output_warped_image.nii.gz"' - # type=traitcompound|default=None: - imports: *id001 - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.025, 1.0 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - invert_initial_moving_transform: 'True' - # type=inputmultiobject|default=[]: One boolean or a list of booleans that indicatewhether the inverse(s) of the transform(s) definedin initial_moving_transform should be used. - winsorize_lower_quantile: '0.025' - # type=range|default=0.0: The Lower quantile to clip image ranges - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 0.975 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - winsorize_upper_quantile: '0.975' - # type=range|default=1.0: The Upper quantile to clip image ranges - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.025, 0.975 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - winsorize_lower_quantile: '0.025' - # type=range|default=0.0: The Lower quantile to clip image ranges - winsorize_upper_quantile: '0.975' - # type=range|default=1.0: The Upper quantile to clip image ranges - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --float 1 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - float: 'True' - # type=bool|default=False: Use float instead of double for computations. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --float 0 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - float: 'False' - # type=bool|default=False: Use float instead of double for computations. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 1 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 1 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --restore-state trans.mat --save-state trans.mat --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - save_state: '"trans.mat"' - # type=file: The saved registration state to be restored - # type=file|default=: Filename for saving the internal restorable state of the registration - restore_state: '"trans.mat"' - # type=file|default=: Filename for restoring the internal restorable state of the registration - initialize_transforms_per_stage: 'True' - # type=bool|default=False: Initialize linear transforms from the previous stage. By enabling this option, the current linear stage transform is directly initialized from the previous stages linear transform; this allows multiple linear stages to be run where each stage directly updates the estimated linear transform from the previous stage. (e.g. Translation -> Rigid -> Affine). - collapse_output_transforms: 'True' - # type=bool|default=True: Collapse output transforms. Specifically, enabling this option combines all adjacent linear transforms and composes all adjacent displacement field transforms before writing the results to disk. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 1 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 1 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --restore-state trans.mat --save-state trans.mat --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 0 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - write_composite_transform: 'False' - # type=bool|default=False: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 0.5, 32, None, 0.05 ] --metric CC[ fixed1.nii, moving1.nii, 0.5, 4, None, 0.1 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - fixed_image: '"fixed1.nii"' - # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) - moving_image: '"moving1.nii"' - # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to - metric: '["Mattes", ["Mattes", "CC"]]' - # type=list|default=[]: the metric(s) to use for each stage. Note that multiple metrics per stage are not supported in ANTS 1.9.1 and earlier. - metric_weight: '[1, [.5,.5]]' - # type=list|default=[1.0]: the metric weight(s) for each stage. The weights must sum to 1 per stage. - radius_or_number_of_bins: '[32, [32, 4] ]' - # type=list|default=[5]: the number of bins in each stage for the MI and Mattes metric, the radius for other metrics - sampling_strategy: '["Random", None] # use default strategy in second stage' - # type=list|default=[]: the metric sampling strategy (strategies) for each stage - sampling_percentage: '[0.05, [0.05, 0.10]]' - # type=list|default=[]: the metric sampling percentage(s) to use for each stage - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 0.5, 32, None, 0.05 ] --metric CC[ fixed2.nii, moving2.nii, 0.5, 4, None, 0.1 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - fixed_image: '["fixed1.nii", "fixed2.nii"]' - # type=inputmultiobject|default=[]: Image to which the moving_image should be transformed(usually a structural image) - moving_image: '["moving1.nii", "moving2.nii"]' - # type=inputmultiobject|default=[]: Image that will be registered to the space of fixed_image. This is theimage on which the transformations will be applied to - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation BSpline[ 3 ] --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - interpolation: '"BSpline"' - # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','GenericLabel','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: - interpolation_parameters: (3,) - # type=traitcompound|default=None: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Gaussian[ 1.0, 1.0 ] --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - interpolation: '"Gaussian"' - # type=enum|default='Linear'|allowed['BSpline','CosineWindowedSinc','Gaussian','GenericLabel','HammingWindowedSinc','LanczosWindowedSinc','Linear','MultiLabel','NearestNeighbor','WelchWindowedSinc']: - interpolation_parameters: (1.0, 1.0) - # type=traitcompound|default=None: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform BSplineSyN[ 0.25, 26, 0, 3 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - transforms: '["Affine", "BSplineSyN"]' - # type=list|default=[]: - transform_parameters: '[(2.0,), (0.25, 26, 0, 3)]' - # type=list|default=[]: - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ trans.mat, 1 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --masks [ NULL, NULL ] --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --masks [ fixed1.nii, NULL ] --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - fixed_image_masks: '["NULL", "fixed1.nii"]' - # type=inputmultiobject|default=[]: Masks used to limit metric sampling region of the fixed image, defined per registration stage(Use "NULL" to omit a mask at a given stage) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistration --collapse-output-transforms 0 --dimensionality 3 --initial-moving-transform [ func_to_struct.mat, 0 ] [ ants_Warp.nii.gz, 0 ] --initialize-transforms-per-stage 0 --interpolation Linear --output [ output_, output_warped_image.nii.gz ] --transform Affine[ 2.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32, Random, 0.05 ] --convergence [ 1500x200, 1e-08, 20 ] --smoothing-sigmas 1.0x0.0vox --shrink-factors 2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --transform SyN[ 0.25, 3.0, 0.0 ] --metric Mattes[ fixed1.nii, moving1.nii, 1, 32 ] --convergence [ 100x50x30, 1e-09, 20 ] --smoothing-sigmas 2.0x1.0x0.0vox --shrink-factors 3x2x1 --use-estimate-learning-rate-once 1 --use-histogram-matching 1 --winsorize-image-intensities [ 0.0, 1.0 ] --write-composite-transform 1 - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - initial_moving_transform: '["func_to_struct.mat", "ants_Warp.nii.gz"]' - # type=inputmultiobject|default=[]: A transform or a list of transforms that should be applied before the registration begins. Note that, when a list is given, the transformations are applied in reverse order. - invert_initial_moving_transform: '[False, False]' - # type=inputmultiobject|default=[]: One boolean or a list of booleans that indicatewhether the inverse(s) of the transform(s) definedin initial_moving_transform should be used. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/registration_syn_quick.yaml b/nipype-auto-conv/specs/registration_syn_quick.yaml deleted file mode 100644 index deb3a09..0000000 --- a/nipype-auto-conv/specs/registration_syn_quick.yaml +++ /dev/null @@ -1,214 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.registration.RegistrationSynQuick' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Registration using a symmetric image normalization method (SyN). -# You can read more in Avants et al.; Med Image Anal., 2008 -# (https://www.ncbi.nlm.nih.gov/pubmed/17659998). -# -# Examples -# -------- -# -# >>> from nipype.interfaces.ants import RegistrationSynQuick -# >>> reg = RegistrationSynQuick() -# >>> reg.inputs.fixed_image = 'fixed1.nii' -# >>> reg.inputs.moving_image = 'moving1.nii' -# >>> reg.inputs.num_threads = 2 -# >>> reg.cmdline -# 'antsRegistrationSyNQuick.sh -d 3 -f fixed1.nii -r 32 -m moving1.nii -n 2 -o transform -p d -s 26 -t s' -# >>> reg.run() # doctest: +SKIP -# -# example for multiple images -# -# >>> from nipype.interfaces.ants import RegistrationSynQuick -# >>> reg = RegistrationSynQuick() -# >>> reg.inputs.fixed_image = ['fixed1.nii', 'fixed2.nii'] -# >>> reg.inputs.moving_image = ['moving1.nii', 'moving2.nii'] -# >>> reg.inputs.num_threads = 2 -# >>> reg.cmdline -# 'antsRegistrationSyNQuick.sh -d 3 -f fixed1.nii -f fixed2.nii -r 32 -m moving1.nii -m moving2.nii -n 2 -o transform -p d -s 26 -t s' -# >>> reg.run() # doctest: +SKIP -# -task_name: RegistrationSynQuick -nipype_name: RegistrationSynQuick -nipype_module: nipype.interfaces.ants.registration -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - fixed_image: medimage/nifti1+list-of - # type=inputmultiobject|default=[]: Fixed image or source image or reference image - moving_image: medimage/nifti1+list-of - # type=inputmultiobject|default=[]: Moving image or target image - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - forward_warp_field: generic/file - # type=file: Forward warp field - inverse_warp_field: generic/file - # type=file: Inverse warp field - inverse_warped_image: generic/file - # type=file: Inverse warped image - out_matrix: generic/file - # type=file: Affine matrix - warped_image: generic/file - # type=file: Warped image - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - fixed_image: - # type=inputmultiobject|default=[]: Fixed image or source image or reference image - moving_image: - # type=inputmultiobject|default=[]: Moving image or target image - output_prefix: - # type=str|default='transform': A prefix that is prepended to all output files - num_threads: - # type=int|default=1: Number of threads (default = 1) - transform_type: - # type=enum|default='s'|allowed['a','b','br','r','s','sr','t']: Transform type * t: translation * r: rigid * a: rigid + affine * s: rigid + affine + deformable syn (default) * sr: rigid + deformable syn * b: rigid + affine + deformable b-spline syn * br: rigid + deformable b-spline syn - use_histogram_matching: - # type=bool|default=False: use histogram matching - histogram_bins: - # type=int|default=32: histogram bins for mutual information in SyN stage (default = 32) - spline_distance: - # type=int|default=26: spline distance for deformable B-spline SyN transform (default = 26) - precision_type: - # type=enum|default='double'|allowed['double','float']: precision type (default = double) - random_seed: - # type=int|default=0: fixed random seed - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - fixed_image: - # type=inputmultiobject|default=[]: Fixed image or source image or reference image - moving_image: - # type=inputmultiobject|default=[]: Moving image or target image - num_threads: '2' - # type=int|default=1: Number of threads (default = 1) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - fixed_image: - # type=inputmultiobject|default=[]: Fixed image or source image or reference image - moving_image: - # type=inputmultiobject|default=[]: Moving image or target image - num_threads: '2' - # type=int|default=1: Number of threads (default = 1) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: antsRegistrationSyNQuick.sh -d 3 -f fixed1.nii -r 32 -m moving1.nii -n 2 -o transform -p d -s 26 -t s - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - fixed_image: '"fixed1.nii"' - # type=inputmultiobject|default=[]: Fixed image or source image or reference image - moving_image: '"moving1.nii"' - # type=inputmultiobject|default=[]: Moving image or target image - num_threads: '2' - # type=int|default=1: Number of threads (default = 1) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: antsRegistrationSyNQuick.sh -d 3 -f fixed1.nii -f fixed2.nii -r 32 -m moving1.nii -m moving2.nii -n 2 -o transform -p d -s 26 -t s - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - fixed_image: '["fixed1.nii", "fixed2.nii"]' - # type=inputmultiobject|default=[]: Fixed image or source image or reference image - moving_image: '["moving1.nii", "moving2.nii"]' - # type=inputmultiobject|default=[]: Moving image or target image - num_threads: '2' - # type=int|default=1: Number of threads (default = 1) - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/resample_image_by_spacing.yaml b/nipype-auto-conv/specs/resample_image_by_spacing.yaml deleted file mode 100644 index 8700041..0000000 --- a/nipype-auto-conv/specs/resample_image_by_spacing.yaml +++ /dev/null @@ -1,281 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.utils.ResampleImageBySpacing' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Resample an image with a given spacing. -# -# Examples -# -------- -# >>> res = ResampleImageBySpacing(dimension=3) -# >>> res.inputs.input_image = 'structural.nii' -# >>> res.inputs.output_image = 'output.nii.gz' -# >>> res.inputs.out_spacing = (4, 4, 4) -# >>> res.cmdline #doctest: +ELLIPSIS -# 'ResampleImageBySpacing 3 structural.nii output.nii.gz 4 4 4' -# -# >>> res = ResampleImageBySpacing(dimension=3) -# >>> res.inputs.input_image = 'structural.nii' -# >>> res.inputs.output_image = 'output.nii.gz' -# >>> res.inputs.out_spacing = (4, 4, 4) -# >>> res.inputs.apply_smoothing = True -# >>> res.cmdline #doctest: +ELLIPSIS -# 'ResampleImageBySpacing 3 structural.nii output.nii.gz 4 4 4 1' -# -# >>> res = ResampleImageBySpacing(dimension=3) -# >>> res.inputs.input_image = 'structural.nii' -# >>> res.inputs.output_image = 'output.nii.gz' -# >>> res.inputs.out_spacing = (0.4, 0.4, 0.4) -# >>> res.inputs.apply_smoothing = True -# >>> res.inputs.addvox = 2 -# >>> res.inputs.nn_interp = False -# >>> res.cmdline #doctest: +ELLIPSIS -# 'ResampleImageBySpacing 3 structural.nii output.nii.gz 0.4 0.4 0.4 1 2 0' -# -# -task_name: ResampleImageBySpacing -nipype_name: ResampleImageBySpacing -nipype_module: nipype.interfaces.ants.utils -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - input_image: medimage/nifti1 - # type=file|default=: input image file - output_image: Path - # type=file: resampled file - # type=file|default=: output image file - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_image: medimage/nifti-gz - # type=file: resampled file - # type=file|default=: output image file - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=int|default=3: dimension of output image - input_image: - # type=file|default=: input image file - output_image: - # type=file: resampled file - # type=file|default=: output image file - out_spacing: - # type=traitcompound|default=None: output spacing - apply_smoothing: - # type=bool|default=False: smooth before resampling - addvox: - # type=int|default=0: addvox pads each dimension by addvox - nn_interp: - # type=bool|default=False: nn interpolation - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: input image file - output_image: '"output.nii.gz"' - # type=file: resampled file - # type=file|default=: output image file - out_spacing: (4, 4, 4) - # type=traitcompound|default=None: output spacing - dimension: '3' - # type=int|default=3: dimension of output image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: input image file - output_image: '"output.nii.gz"' - # type=file: resampled file - # type=file|default=: output image file - out_spacing: (4, 4, 4) - # type=traitcompound|default=None: output spacing - apply_smoothing: 'True' - # type=bool|default=False: smooth before resampling - dimension: '3' - # type=int|default=3: dimension of output image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: input image file - output_image: '"output.nii.gz"' - # type=file: resampled file - # type=file|default=: output image file - out_spacing: (0.4, 0.4, 0.4) - # type=traitcompound|default=None: output spacing - apply_smoothing: 'True' - # type=bool|default=False: smooth before resampling - addvox: '2' - # type=int|default=0: addvox pads each dimension by addvox - nn_interp: 'False' - # type=bool|default=False: nn interpolation - dimension: '3' - # type=int|default=3: dimension of output image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"structural.nii"' - # type=file|default=: input image file - output_image: '"output.nii.gz"' - # type=file: resampled file - # type=file|default=: output image file - out_spacing: (4, 4, 4) - # type=traitcompound|default=None: output spacing - dimension: '3' - # type=int|default=3: dimension of output image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"structural.nii"' - # type=file|default=: input image file - output_image: '"output.nii.gz"' - # type=file: resampled file - # type=file|default=: output image file - out_spacing: (4, 4, 4) - # type=traitcompound|default=None: output spacing - apply_smoothing: 'True' - # type=bool|default=False: smooth before resampling - dimension: '3' - # type=int|default=3: dimension of output image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"structural.nii"' - # type=file|default=: input image file - output_image: '"output.nii.gz"' - # type=file: resampled file - # type=file|default=: output image file - out_spacing: (0.4, 0.4, 0.4) - # type=traitcompound|default=None: output spacing - apply_smoothing: 'True' - # type=bool|default=False: smooth before resampling - addvox: '2' - # type=int|default=0: addvox pads each dimension by addvox - nn_interp: 'False' - # type=bool|default=False: nn interpolation - dimension: '3' - # type=int|default=3: dimension of output image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/threshold_image.yaml b/nipype-auto-conv/specs/threshold_image.yaml deleted file mode 100644 index 1e6ed70..0000000 --- a/nipype-auto-conv/specs/threshold_image.yaml +++ /dev/null @@ -1,237 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.utils.ThresholdImage' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# -# Apply thresholds on images. -# -# Examples -# -------- -# >>> thres = ThresholdImage(dimension=3) -# >>> thres.inputs.input_image = 'structural.nii' -# >>> thres.inputs.output_image = 'output.nii.gz' -# >>> thres.inputs.th_low = 0.5 -# >>> thres.inputs.th_high = 1.0 -# >>> thres.inputs.inside_value = 1.0 -# >>> thres.inputs.outside_value = 0.0 -# >>> thres.cmdline #doctest: +ELLIPSIS -# 'ThresholdImage 3 structural.nii output.nii.gz 0.500000 1.000000 1.000000 0.000000' -# -# >>> thres = ThresholdImage(dimension=3) -# >>> thres.inputs.input_image = 'structural.nii' -# >>> thres.inputs.output_image = 'output.nii.gz' -# >>> thres.inputs.mode = 'Kmeans' -# >>> thres.inputs.num_thresholds = 4 -# >>> thres.cmdline #doctest: +ELLIPSIS -# 'ThresholdImage 3 structural.nii output.nii.gz Kmeans 4' -# -# -task_name: ThresholdImage -nipype_name: ThresholdImage -nipype_module: nipype.interfaces.ants.utils -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - input_image: medimage/nifti1 - # type=file|default=: input image file - input_mask: generic/file - # type=file|default=: input mask for Otsu, Kmeans - output_image: Path - # type=file: resampled file - # type=file|default=: output image file - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_image: medimage/nifti-gz - # type=file: resampled file - # type=file|default=: output image file - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=int|default=3: dimension of output image - input_image: - # type=file|default=: input image file - output_image: - # type=file: resampled file - # type=file|default=: output image file - mode: - # type=enum|default='Otsu'|allowed['Kmeans','Otsu']: whether to run Otsu / Kmeans thresholding - num_thresholds: - # type=int|default=0: number of thresholds - input_mask: - # type=file|default=: input mask for Otsu, Kmeans - th_low: - # type=float|default=0.0: lower threshold - th_high: - # type=float|default=0.0: upper threshold - inside_value: - # type=float|default=1: inside value - outside_value: - # type=float|default=0: outside value - copy_header: - # type=bool|default=True: copy headers of the original image into the output (corrected) file - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: input image file - output_image: '"output.nii.gz"' - # type=file: resampled file - # type=file|default=: output image file - th_low: '0.5' - # type=float|default=0.0: lower threshold - th_high: '1.0' - # type=float|default=0.0: upper threshold - inside_value: '1.0' - # type=float|default=1: inside value - outside_value: '0.0' - # type=float|default=0: outside value - dimension: '3' - # type=int|default=3: dimension of output image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: input image file - output_image: '"output.nii.gz"' - # type=file: resampled file - # type=file|default=: output image file - mode: '"Kmeans"' - # type=enum|default='Otsu'|allowed['Kmeans','Otsu']: whether to run Otsu / Kmeans thresholding - num_thresholds: '4' - # type=int|default=0: number of thresholds - dimension: '3' - # type=int|default=3: dimension of output image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"structural.nii"' - # type=file|default=: input image file - output_image: '"output.nii.gz"' - # type=file: resampled file - # type=file|default=: output image file - th_low: '0.5' - # type=float|default=0.0: lower threshold - th_high: '1.0' - # type=float|default=0.0: upper threshold - inside_value: '1.0' - # type=float|default=1: inside value - outside_value: '0.0' - # type=float|default=0: outside value - dimension: '3' - # type=int|default=3: dimension of output image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"structural.nii"' - # type=file|default=: input image file - output_image: '"output.nii.gz"' - # type=file: resampled file - # type=file|default=: output image file - mode: '"Kmeans"' - # type=enum|default='Otsu'|allowed['Kmeans','Otsu']: whether to run Otsu / Kmeans thresholding - num_thresholds: '4' - # type=int|default=0: number of thresholds - dimension: '3' - # type=int|default=3: dimension of output image - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/warp_image_multi_transform.yaml b/nipype-auto-conv/specs/warp_image_multi_transform.yaml deleted file mode 100644 index 915c3c8..0000000 --- a/nipype-auto-conv/specs/warp_image_multi_transform.yaml +++ /dev/null @@ -1,218 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.resampling.WarpImageMultiTransform' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# Warps an image from one space to another -# -# Examples -# -------- -# -# >>> from nipype.interfaces.ants import WarpImageMultiTransform -# >>> wimt = WarpImageMultiTransform() -# >>> wimt.inputs.input_image = 'structural.nii' -# >>> wimt.inputs.reference_image = 'ants_deformed.nii.gz' -# >>> wimt.inputs.transformation_series = ['ants_Warp.nii.gz','ants_Affine.txt'] -# >>> wimt.cmdline -# 'WarpImageMultiTransform 3 structural.nii structural_wimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz ants_Affine.txt' -# -# >>> wimt = WarpImageMultiTransform() -# >>> wimt.inputs.input_image = 'diffusion_weighted.nii' -# >>> wimt.inputs.reference_image = 'functional.nii' -# >>> wimt.inputs.transformation_series = ['func2anat_coreg_Affine.txt','func2anat_InverseWarp.nii.gz', 'dwi2anat_Warp.nii.gz','dwi2anat_coreg_Affine.txt'] -# >>> wimt.inputs.invert_affine = [1] # this will invert the 1st Affine file: 'func2anat_coreg_Affine.txt' -# >>> wimt.cmdline -# 'WarpImageMultiTransform 3 diffusion_weighted.nii diffusion_weighted_wimt.nii -R functional.nii -i func2anat_coreg_Affine.txt func2anat_InverseWarp.nii.gz dwi2anat_Warp.nii.gz dwi2anat_coreg_Affine.txt' -# -# -task_name: WarpImageMultiTransform -nipype_name: WarpImageMultiTransform -nipype_module: nipype.interfaces.ants.resampling -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - input_image: medimage/nifti1 - # type=file|default=: image to apply transformation to (generally a coregistered functional) - out_postfix: str - # type=file|default='_wimt': Postfix that is prepended to all output files (default = _wimt) - output_image: Path - # type=file: Warped image - # type=file|default=: name of the output warped image - reference_image: medimage/nifti1,medimage/nifti-gz - # type=file|default=: reference image space that you wish to warp INTO - transformation_series: '[text/text-file,medimage/nifti-gz]+list-of' - # type=inputmultiobject|default=[]: transformation file(s) to be applied - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_image: generic/file - # type=file: Warped image - # type=file|default=: name of the output warped image - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - output_image: output_image - # type=file: Warped image - # type=file|default=: name of the output warped image - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=3|allowed[2,3]: image dimension (2 or 3) - input_image: - # type=file|default=: image to apply transformation to (generally a coregistered functional) - output_image: - # type=file: Warped image - # type=file|default=: name of the output warped image - out_postfix: - # type=file|default='_wimt': Postfix that is prepended to all output files (default = _wimt) - reference_image: - # type=file|default=: reference image space that you wish to warp INTO - tightest_box: - # type=bool|default=False: computes tightest bounding box (overridden by reference_image if given) - reslice_by_header: - # type=bool|default=False: Uses orientation matrix and origin encoded in reference image file header. Not typically used with additional transforms - use_nearest: - # type=bool|default=False: Use nearest neighbor interpolation - use_bspline: - # type=bool|default=False: Use 3rd order B-Spline interpolation - transformation_series: - # type=inputmultiobject|default=[]: transformation file(s) to be applied - invert_affine: - # type=list|default=[]: List of Affine transformations to invert.E.g.: [1,4,5] inverts the 1st, 4th, and 5th Affines found in transformation_series. Note that indexing starts with 1 and does not include warp fields. Affine transformations are distinguished from warp fields by the word "affine" included in their filenames. - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: - # type=file|default=: reference image space that you wish to warp INTO - transformation_series: - # type=inputmultiobject|default=[]: transformation file(s) to be applied - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: - # type=file|default=: reference image space that you wish to warp INTO - transformation_series: - # type=inputmultiobject|default=[]: transformation file(s) to be applied - invert_affine: '[1] # this will invert the 1st Affine file: "func2anat_coreg_Affine.txt"' - # type=list|default=[]: List of Affine transformations to invert.E.g.: [1,4,5] inverts the 1st, 4th, and 5th Affines found in transformation_series. Note that indexing starts with 1 and does not include warp fields. Affine transformations are distinguished from warp fields by the word "affine" included in their filenames. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: WarpImageMultiTransform 3 structural.nii structural_wimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz ants_Affine.txt - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"structural.nii"' - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: '"ants_deformed.nii.gz"' - # type=file|default=: reference image space that you wish to warp INTO - transformation_series: '["ants_Warp.nii.gz","ants_Affine.txt"]' - # type=inputmultiobject|default=[]: transformation file(s) to be applied - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: WarpImageMultiTransform 3 diffusion_weighted.nii diffusion_weighted_wimt.nii -R functional.nii -i func2anat_coreg_Affine.txt func2anat_InverseWarp.nii.gz dwi2anat_Warp.nii.gz dwi2anat_coreg_Affine.txt - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"diffusion_weighted.nii"' - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: '"functional.nii"' - # type=file|default=: reference image space that you wish to warp INTO - transformation_series: '["func2anat_coreg_Affine.txt","func2anat_InverseWarp.nii.gz", "dwi2anat_Warp.nii.gz","dwi2anat_coreg_Affine.txt"]' - # type=inputmultiobject|default=[]: transformation file(s) to be applied - invert_affine: '[1] # this will invert the 1st Affine file: "func2anat_coreg_Affine.txt"' - # type=list|default=[]: List of Affine transformations to invert.E.g.: [1,4,5] inverts the 1st, 4th, and 5th Affines found in transformation_series. Note that indexing starts with 1 and does not include warp fields. Affine transformations are distinguished from warp fields by the word "affine" included in their filenames. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS diff --git a/nipype-auto-conv/specs/warp_time_series_image_multi_transform.yaml b/nipype-auto-conv/specs/warp_time_series_image_multi_transform.yaml deleted file mode 100644 index b9813e6..0000000 --- a/nipype-auto-conv/specs/warp_time_series_image_multi_transform.yaml +++ /dev/null @@ -1,205 +0,0 @@ -# This file is used to manually specify the semi-automatic conversion of -# 'nipype.interfaces.ants.resampling.WarpTimeSeriesImageMultiTransform' from Nipype to Pydra. -# -# Please fill-in/edit the fields below where appropriate -# -# Docs -# ---- -# Warps a time-series from one space to another -# -# Examples -# -------- -# -# >>> from nipype.interfaces.ants import WarpTimeSeriesImageMultiTransform -# >>> wtsimt = WarpTimeSeriesImageMultiTransform() -# >>> wtsimt.inputs.input_image = 'resting.nii' -# >>> wtsimt.inputs.reference_image = 'ants_deformed.nii.gz' -# >>> wtsimt.inputs.transformation_series = ['ants_Warp.nii.gz','ants_Affine.txt'] -# >>> wtsimt.cmdline -# 'WarpTimeSeriesImageMultiTransform 4 resting.nii resting_wtsimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz ants_Affine.txt' -# -# >>> wtsimt = WarpTimeSeriesImageMultiTransform() -# >>> wtsimt.inputs.input_image = 'resting.nii' -# >>> wtsimt.inputs.reference_image = 'ants_deformed.nii.gz' -# >>> wtsimt.inputs.transformation_series = ['ants_Warp.nii.gz','ants_Affine.txt'] -# >>> wtsimt.inputs.invert_affine = [1] # # this will invert the 1st Affine file: ants_Affine.txt -# >>> wtsimt.cmdline -# 'WarpTimeSeriesImageMultiTransform 4 resting.nii resting_wtsimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz -i ants_Affine.txt' -# -task_name: WarpTimeSeriesImageMultiTransform -nipype_name: WarpTimeSeriesImageMultiTransform -nipype_module: nipype.interfaces.ants.resampling -inputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - input_image: medimage/nifti1 - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: medimage/nifti-gz - # type=file|default=: reference image space that you wish to warp INTO - transformation_series: medimage/nifti-gz+list-of - # type=inputmultiobject|default=[]: transformation file(s) to be applied - callable_defaults: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set as the `default` method of input fields - metadata: - # dict[str, dict[str, any]] - additional metadata to set on any of the input fields (e.g. out_file: position: 1) -outputs: - omit: - # list[str] - fields to omit from the Pydra interface - rename: - # dict[str, str] - fields to rename in the Pydra interface - types: - # dict[str, type] - override inferred types (use "mime-like" string for file-format types, - # e.g. 'medimage/nifti-gz'). For most fields the type will be correctly inferred - # 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. - output_image: generic/file - # type=file: Warped image - callables: - # dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py` - # to set to the `callable` attribute of output fields - templates: - # dict[str, str] - `output_file_template` values to be provided to output fields - requirements: - # dict[str, list[str]] - input fields that are required to be provided for the output field to be present -tests: -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - dimension: - # type=enum|default=4|allowed[3,4]: image dimension (3 or 4) - input_image: - # type=file|default=: image to apply transformation to (generally a coregistered functional) - out_postfix: - # type=str|default='_wtsimt': Postfix that is prepended to all output files (default = _wtsimt) - reference_image: - # type=file|default=: reference image space that you wish to warp INTO - tightest_box: - # type=bool|default=False: computes tightest bounding box (overridden by reference_image if given) - reslice_by_header: - # type=bool|default=False: Uses orientation matrix and origin encoded in reference image file header. Not typically used with additional transforms - use_nearest: - # type=bool|default=False: Use nearest neighbor interpolation - use_bspline: - # type=bool|default=False: Use 3rd order B-Spline interpolation - transformation_series: - # type=inputmultiobject|default=[]: transformation file(s) to be applied - invert_affine: - # type=list|default=[]: List of Affine transformations to invert.E.g.: [1,4,5] inverts the 1st, 4th, and 5th Affines found in transformation_series. Note that indexing starts with 1 and does not include warp fields. Affine transformations are distinguished from warp fields by the word "affine" included in their filenames. - num_threads: - # type=int|default=1: Number of ITK threads to use - args: - # type=str|default='': Additional parameters to the command - environ: - # type=dict|default={}: Environment variables - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: - # type=file|default=: reference image space that you wish to warp INTO - transformation_series: - # type=inputmultiobject|default=[]: transformation file(s) to be applied - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -- inputs: - # dict[str, str] - values to provide to inputs fields in the task initialisation - # (if not specified, will try to choose a sensible value) - input_image: - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: - # type=file|default=: reference image space that you wish to warp INTO - transformation_series: - # type=inputmultiobject|default=[]: transformation file(s) to be applied - invert_affine: '[1] # # this will invert the 1st Affine file: ants_Affine.txt' - # type=list|default=[]: List of Affine transformations to invert.E.g.: [1,4,5] inverts the 1st, 4th, and 5th Affines found in transformation_series. Note that indexing starts with 1 and does not include warp fields. Affine transformations are distinguished from warp fields by the word "affine" included in their filenames. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - expected_outputs: - # dict[str, str] - expected values for selected outputs, noting that tests will typically - # be terminated before they complete for time-saving reasons, and therefore - # these values will be ignored, when running in CI - timeout: 10 - # int - the value to set for the timeout in the generated test, - # after which the test will be considered to have been initialised - # successfully. Set to 0 to disable the timeout (warning, this could - # lead to the unittests taking a very long time to complete) - xfail: true - # bool - whether the unittest is expected to fail or not. Set to false - # when you are satisfied with the edits you have made to this file -doctests: -- cmdline: WarpTimeSeriesImageMultiTransform 4 resting.nii resting_wtsimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz ants_Affine.txt - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"resting.nii"' - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: '"ants_deformed.nii.gz"' - # type=file|default=: reference image space that you wish to warp INTO - transformation_series: '["ants_Warp.nii.gz","ants_Affine.txt"]' - # type=inputmultiobject|default=[]: transformation file(s) to be applied - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS -- cmdline: WarpTimeSeriesImageMultiTransform 4 resting.nii resting_wtsimt.nii -R ants_deformed.nii.gz ants_Warp.nii.gz -i ants_Affine.txt - # str - the expected cmdline output - inputs: - # dict[str, str] - name-value pairs for inputs to be provided to the doctest. - # If the field is of file-format type and the value is None, then the - # '.mock()' method of the corresponding class is used instead. - input_image: '"resting.nii"' - # type=file|default=: image to apply transformation to (generally a coregistered functional) - reference_image: '"ants_deformed.nii.gz"' - # type=file|default=: reference image space that you wish to warp INTO - transformation_series: '["ants_Warp.nii.gz","ants_Affine.txt"]' - # type=inputmultiobject|default=[]: transformation file(s) to be applied - invert_affine: '[1] # # this will invert the 1st Affine file: ants_Affine.txt' - # type=list|default=[]: List of Affine transformations to invert.E.g.: [1,4,5] inverts the 1st, 4th, and 5th Affines found in transformation_series. Note that indexing starts with 1 and does not include warp fields. Affine transformations are distinguished from warp fields by the word "affine" included in their filenames. - imports: - # list[nipype2pydra.task.base.importstatement] - list import statements required by the test, with each list item - # consisting of 'module', 'name', and optionally 'alias' keys - directive: - # str - any doctest directive to place on the cmdline call, e.g. # doctest: +ELLIPSIS