Skip to content

Commit

Permalink
fixed input/output types of ants interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
tclose committed Apr 24, 2024
1 parent 31e1293 commit 759d7f8
Show file tree
Hide file tree
Showing 3 changed files with 220 additions and 220 deletions.
134 changes: 67 additions & 67 deletions nipype-auto-conv/specs/interfaces/fix_header_apply_transforms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#
# Docs
# ----
#
#
# A replacement for nipype.interfaces.ants.resampling.ApplyTransforms that
# fixes the resampled image header to match the xform of the reference
# image
#
#
task_name: FixHeaderApplyTransforms
nipype_name: FixHeaderApplyTransforms
nipype_module: niworkflows.interfaces.fixes
Expand All @@ -19,14 +19,14 @@ inputs:
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
# 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
# type=file|default=<undefined>: image to apply transformation to (generally a coregistered functional)
reference_image: generic/file
reference_image: medimage/itk-image+list-of,medimage/itk-image
# type=file|default=<undefined>: 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`
Expand All @@ -39,74 +39,74 @@ outputs:
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
# 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+list-of,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
# dict[str, str] - `output_file_template` values to be provided to output fields
output_image: output_image
# 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)
transforms:
# type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first.
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=<undefined>: 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=<undefined>: 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:
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.explicitimport] - 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:
# type=inputmultiobject|default=[]: transform files: will be applied in reverse order. For example, the last specified transform will be applied first.
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=<undefined>: 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=<undefined>: 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:
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.explicitimport] - 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: []
148 changes: 74 additions & 74 deletions nipype-auto-conv/specs/interfaces/fix_n4_bias_field_correction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ inputs:
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.
# 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=<undefined>: Filename for the estimated bias.
input_image: generic/file
input_image: medimage/itk-image+list-of,medimage/itk-image
# type=file|default=<undefined>: input for bias correction. Negative values or values close to zero should be processed prior to correction
mask_image: generic/file
mask_image: medimage/itk-image+list-of,medimage/itk-image
# type=file|default=<undefined>: image to specify region to perform final bias correction in
weight_image: generic/file
# type=file|default=<undefined>: image for relative weighting (e.g. probability map of the white matter) of voxels during the B-spline fitting.
weight_image: medimage/itk-image+list-of,medimage/itk-image
# type=file|default=<undefined>: 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
Expand All @@ -40,81 +40,81 @@ outputs:
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
# 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+list-of,medimage/itk-image
# type=file: Estimated bias
# type=file|default=<undefined>: Filename for the estimated bias.
output_image: generic/file
output_image: medimage/itk-image+list-of,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
# dict[str, str] - names of methods/callable classes defined in the adjacent `*_callables.py`
# to set to the `callable` attribute of output fields
negative_values: negative_values_callable
# type=bool: Indicates whether the input was corrected for nonpositive values by adding a constant offset.
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=<undefined>: input for bias correction. Negative values or values close to zero should be processed prior to correction
mask_image:
# type=file|default=<undefined>: image to specify region to perform final bias correction in
weight_image:
# type=file|default=<undefined>: 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=<undefined>: 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.explicitimport] - 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:
# type=enum|default=3|allowed[2,3,4]: image dimension (2, 3 or 4)
input_image:
# type=file|default=<undefined>: input for bias correction. Negative values or values close to zero should be processed prior to correction
mask_image:
# type=file|default=<undefined>: image to specify region to perform final bias correction in
weight_image:
# type=file|default=<undefined>: 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=<undefined>: 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.explicitimport] - 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: []
Loading

0 comments on commit 759d7f8

Please sign in to comment.