Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ permissions:
env: # Define environment variables
SCIGET_NAME: ants
SCIGET_VERSION: 2.6.0
# ANTS_VERSION: v2.5.1
# ANTS_INSTALL_PATH: /opt/ants
# Force tox and pytest to use color
FORCE_COLOR: true
jobs:

Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "pydra-ants"
project = "pydra-tasks-ants"
author = "Pydra Developers"
copyright = f"2022-2023, {author}"
release = __version__
Expand Down
2 changes: 1 addition & 1 deletion pydra/tasks/ants/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from ._version import __version__
except ImportError:
raise RuntimeError(
"pydra-ants has not been properly installed, please run "
"pydra-tasks-ants has not been properly installed, please run "
f"`pip install -e {str(pkg_path)}` to install a development version"
)

Expand Down
4 changes: 2 additions & 2 deletions pydra/tasks/ants/v2/legacy/buildtemplateparallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class buildtemplateparallel(shell.Task["buildtemplateparallel.Outputs"]):
in_files: list[Nifti1] = shell.arg(
help="list of images to generate template from",
position=-1,
formatter="in_files_formatter",
formatter=in_files_formatter,
)
parallelization: ty.Any = shell.arg(
help="control for parallel processing (0 = serial, 1 = use PBS, 2 = use PEXEC, 3 = use Apple XGrid",
Expand All @@ -149,7 +149,7 @@ class buildtemplateparallel(shell.Task["buildtemplateparallel.Outputs"]):
num_cores: int = shell.arg(
help="Requires parallelization = 2 (PEXEC). Sets number of cpu cores to use",
requires=["parallelization"],
formatter="num_cores_formatter",
formatter=num_cores_formatter,
)
max_iterations: list[int] = shell.arg(
help="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",
Expand Down
10 changes: 5 additions & 5 deletions pydra/tasks/ants/v2/registration/ants.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ class ANTS(shell.Task["ANTS.Outputs"]):
)
moving_image: list[Nifti1] = shell.arg(
help="image to apply transformation to (generally a coregisteredfunctional)",
formatter="moving_image_formatter",
formatter=moving_image_formatter,
)
metric: list[ty.Any] = shell.arg(help="")
metric_weight: list[float] | None = shell.arg(
Expand All @@ -184,14 +184,14 @@ class ANTS(shell.Task["ANTS.Outputs"]):
help="", argstr="--output-naming {output_transform_prefix}", default="out"
)
transformation_model: ty.Any = shell.arg(
help="", formatter="transformation_model_formatter"
help="", formatter=transformation_model_formatter
)
gradient_step_length: float = shell.arg(help="", requires=["transformation_model"])
number_of_time_steps: int = shell.arg(help="", requires=["gradient_step_length"])
delta_time: float = shell.arg(help="", requires=["number_of_time_steps"])
symmetry_type: float = shell.arg(help="", requires=["delta_time"])
use_histogram_matching: bool = shell.arg(
help="", formatter="use_histogram_matching_formatter", default=True
help="", formatter=use_histogram_matching_formatter, default=True
)
number_of_iterations: list[int] = shell.arg(
help="", argstr="--number-of-iterations {number_of_iterations}", sep="x"
Expand All @@ -203,10 +203,10 @@ class ANTS(shell.Task["ANTS.Outputs"]):
help="", argstr="--subsampling-factors {subsampling_factors}", sep="x"
)
affine_gradient_descent_option: list[float] = shell.arg(
help="", formatter="affine_gradient_descent_option_formatter"
help="", formatter=affine_gradient_descent_option_formatter
)
mi_option: list[int] = shell.arg(help="", argstr="--MI-option {mi_option}", sep="x")
regularization: ty.Any = shell.arg(help="", formatter="regularization_formatter")
regularization: ty.Any = shell.arg(help="", formatter=regularization_formatter)
regularization_gradient_field_sigma: float = shell.arg(
help="", requires=["regularization"]
)
Expand Down
4 changes: 2 additions & 2 deletions pydra/tasks/ants/v2/registration/composite_transform_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ class CompositeTransformUtil(shell.Task["CompositeTransformUtil.Outputs"]):
out_file: Path = shell.arg(
help="Output file path (only used for disassembly).",
position=2,
formatter="out_file_formatter",
formatter=out_file_formatter,
)
in_file: list[TextMatrix] = shell.arg(
help="Input transform file(s)", argstr="{in_file}...", position=3
)
output_prefix: str = shell.arg(
help="A prefix that is prepended to all output files (only used for assembly).",
position=4,
formatter="output_prefix_formatter",
formatter=output_prefix_formatter,
default="transform",
)
num_threads: int = shell.arg(help="Number of ITK threads to use", default=1)
Expand Down
4 changes: 2 additions & 2 deletions pydra/tasks/ants/v2/registration/measure_image_similarity.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class MeasureImageSimilarity(shell.Task["MeasureImageSimilarity.Outputs"]):
moving_image: File = shell.arg(
help="Image to apply transformation to (generally a coregistered functional)"
)
metric: ty.Any = shell.arg(help="", formatter="metric_formatter")
metric: ty.Any = shell.arg(help="", formatter=metric_formatter)
metric_weight: float = shell.arg(
help='The "metricWeight" variable is not used.',
requires=["metric"],
Expand All @@ -112,7 +112,7 @@ class MeasureImageSimilarity(shell.Task["MeasureImageSimilarity.Outputs"]):
)
fixed_image_mask: Nifti1 = shell.arg(
help="mask used to limit metric sampling region of the fixed image",
formatter="fixed_image_mask_formatter",
formatter=fixed_image_mask_formatter,
)
moving_image_mask: File | None = shell.arg(
help="mask used to limit metric sampling region of the moving image",
Expand Down
16 changes: 8 additions & 8 deletions pydra/tasks/ants/v2/registration/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ class Registration(shell.Task["Registration.Outputs"]):
)
fixed_image_mask: File | None = shell.arg(
help="Mask used to limit metric sampling region of the fixed imagein all stages",
formatter="fixed_image_mask_formatter",
formatter=fixed_image_mask_formatter,
)
fixed_image_masks: MultiInputObj = shell.arg(
help='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)'
Expand All @@ -648,15 +648,15 @@ class Registration(shell.Task["Registration.Outputs"]):
)
initial_moving_transform: list[TextMatrix] = shell.arg(
help="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.",
formatter="initial_moving_transform_formatter",
formatter=initial_moving_transform_formatter,
)
invert_initial_moving_transform: MultiInputObj = shell.arg(
help="One boolean or a list of booleans that indicatewhether the inverse(s) of the transform(s) definedin initial_moving_transform should be used.",
requires=["initial_moving_transform"],
)
initial_moving_transform_com: ty.Any | None = shell.arg(
help="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).",
formatter="initial_moving_transform_com_formatter",
formatter=initial_moving_transform_com_formatter,
)
metric_item_trait: ty.Any = shell.arg(help="")
metric_stage_trait: ty.Any = shell.arg(help="")
Expand Down Expand Up @@ -694,7 +694,7 @@ class Registration(shell.Task["Registration.Outputs"]):
help="Histogram match the images before registration.", default=True
)
interpolation: ty.Any = shell.arg(
help="", formatter="interpolation_formatter", default="Linear"
help="", formatter=interpolation_formatter, default="Linear"
)
interpolation_parameters: ty.Any = shell.arg(help="")
write_composite_transform: bool = shell.arg(
Expand All @@ -715,7 +715,7 @@ class Registration(shell.Task["Registration.Outputs"]):
float: bool = shell.arg(
help="Use float instead of double for computations.", argstr="--float {float:d}"
)
transforms: list[ty.Any] = shell.arg(help="", formatter="transforms_formatter")
transforms: list[ty.Any] = shell.arg(help="", formatter=transforms_formatter)
transform_parameters: list[ty.Any] = shell.arg(help="")
restrict_deformation: list[list[ty.Any]] = shell.arg(
help="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."
Expand All @@ -733,20 +733,20 @@ class Registration(shell.Task["Registration.Outputs"]):
help="", requires=["convergence_threshold"], default=[10]
)
output_transform_prefix: str = shell.arg(
help="", formatter="output_transform_prefix_formatter", default="transform"
help="", formatter=output_transform_prefix_formatter, default="transform"
)
output_warped_image: ty.Any = shell.arg(help="")
output_inverse_warped_image: ty.Any = shell.arg(
help="", requires=["output_warped_image"]
)
winsorize_upper_quantile: ty.Any = shell.arg(
help="The Upper quantile to clip image ranges",
formatter="winsorize_upper_quantile_formatter",
formatter=winsorize_upper_quantile_formatter,
default=1.0,
)
winsorize_lower_quantile: ty.Any = shell.arg(
help="The Lower quantile to clip image ranges",
formatter="winsorize_lower_quantile_formatter",
formatter=winsorize_lower_quantile_formatter,
default=0.0,
)
random_seed: int = shell.arg(
Expand Down
2 changes: 1 addition & 1 deletion pydra/tasks/ants/v2/registration/registration_syn_quick.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class RegistrationSynQuick(shell.Task["RegistrationSynQuick.Outputs"]):
)
precision_type: ty.Any = shell.arg(
help="precision type (default = double)",
formatter="precision_type_formatter",
formatter=precision_type_formatter,
default="double",
)
random_seed: int = shell.arg(help="fixed random seed", argstr="-e {random_seed}")
Expand Down
6 changes: 3 additions & 3 deletions pydra/tasks/ants/v2/resampling/apply_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ class ApplyTransforms(shell.Task["ApplyTransforms.Outputs"]):
argstr="--reference-image {reference_image}",
)
interpolation: ty.Any = shell.arg(
help="", formatter="interpolation_formatter", default="Linear"
help="", formatter=interpolation_formatter, default="Linear"
)
interpolation_parameters: ty.Any = shell.arg(help="")
transforms: MultiInputObj = shell.arg(
help="transform files: will be applied in reverse order. For example, the last specified transform will be applied first.",
formatter="transforms_formatter",
formatter=transforms_formatter,
)
invert_transform_flags: MultiInputObj = shell.arg(help="")
default_value: float = shell.arg(
Expand All @@ -168,7 +168,7 @@ class Outputs(shell.Outputs):
output_image: str = shell.outarg(
help="output file name",
path_template="output_image",
formatter="output_image_formatter",
formatter=output_image_formatter,
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ApplyTransformsToPoints(shell.Task["ApplyTransformsToPoints.Outputs"]):
)
transforms: list[TextMatrix] = shell.arg(
help="transforms that will be applied to the points",
formatter="transforms_formatter",
formatter=transforms_formatter,
)
invert_transform_flags: list[bool] = shell.arg(
help="list indicating if a transform should be reversed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class WarpImageMultiTransform(shell.Task["WarpImageMultiTransform.Outputs"]):
transformation_series: list[TextFile | NiftiGz] = shell.arg(
help="transformation file(s) to be applied",
position=-1,
formatter="transformation_series_formatter",
formatter=transformation_series_formatter,
)
invert_affine: list[int] = shell.arg(
help='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.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class WarpTimeSeriesImageMultiTransform(
)
out_postfix: str = shell.arg(
help="Postfix that is prepended to all output files (default = _wtsimt)",
formatter="out_postfix_formatter",
formatter=out_postfix_formatter,
default="_wtsimt",
)
reference_image: File | None = shell.arg(
Expand All @@ -137,7 +137,7 @@ class WarpTimeSeriesImageMultiTransform(
)
transformation_series: list[NiftiGz] = shell.arg(
help="transformation file(s) to be applied",
formatter="transformation_series_formatter",
formatter=transformation_series_formatter,
)
invert_affine: list[int] = shell.arg(
help='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.'
Expand Down
12 changes: 6 additions & 6 deletions pydra/tasks/ants/v2/segmentation/atropos.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class Atropos(shell.Task["Atropos.Outputs"]):
initialization: ty.Any = shell.arg(
help="",
requires=["number_of_tissue_classes"],
formatter="initialization_formatter",
formatter=initialization_formatter,
)
kmeans_init_centers: list[ty.Any] = shell.arg(help="")
prior_image: ty.Any = shell.arg(
Expand All @@ -299,19 +299,19 @@ class Atropos(shell.Task["Atropos.Outputs"]):
help="", argstr="--likelihood-model {likelihood_model}"
)
mrf_smoothing_factor: float = shell.arg(
help="", formatter="mrf_smoothing_factor_formatter"
help="", formatter=mrf_smoothing_factor_formatter
)
mrf_radius: list[int] = shell.arg(help="", requires=["mrf_smoothing_factor"])
icm_use_synchronous_update: bool = shell.arg(
help="", formatter="icm_use_synchronous_update_formatter"
help="", formatter=icm_use_synchronous_update_formatter
)
maximum_number_of_icm_terations: int = shell.arg(
help="", requires=["icm_use_synchronous_update"]
)
n_iterations: int = shell.arg(help="", formatter="n_iterations_formatter")
n_iterations: int = shell.arg(help="", formatter=n_iterations_formatter)
convergence_threshold: float = shell.arg(help="", requires=["n_iterations"])
posterior_formulation: str = shell.arg(
help="", formatter="posterior_formulation_formatter"
help="", formatter=posterior_formulation_formatter
)
use_random_seed: bool = shell.arg(
help="use random seed value over constant",
Expand All @@ -322,7 +322,7 @@ class Atropos(shell.Task["Atropos.Outputs"]):
help="", requires=["posterior_formulation"]
)
out_classified_image_name: Path = shell.arg(
help="", formatter="out_classified_image_name_formatter"
help="", formatter=out_classified_image_name_formatter
)
save_posteriors: bool = shell.arg(help="")
output_posteriors_name_template: str = shell.arg(
Expand Down
12 changes: 6 additions & 6 deletions pydra/tasks/ants/v2/segmentation/cortical_thickness.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,22 +257,22 @@ class CorticalThickness(shell.Task["CorticalThickness.Outputs"]):
)
anatomical_image: File = shell.arg(
help="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.",
formatter="anatomical_image_formatter",
formatter=anatomical_image_formatter,
)
brain_template: NiftiGz = shell.arg(
help="Anatomical *intensity* template (possibly created using a population data set with buildtemplateparallel.sh in ANTs). This template is *not* skull-stripped.",
formatter="brain_template_formatter",
formatter=brain_template_formatter,
)
brain_probability_mask: File = shell.arg(
help="brain probability mask in template space",
formatter="brain_probability_mask_formatter",
formatter=brain_probability_mask_formatter,
)
segmentation_priors: list[NiftiGz] = shell.arg(
help="", formatter="segmentation_priors_formatter"
help="", formatter=segmentation_priors_formatter
)
out_prefix: str = shell.arg(
help="Prefix that is prepended to all output files",
formatter="out_prefix_formatter",
formatter=out_prefix_formatter,
default="antsCT_",
)
image_suffix: str = shell.arg(
Expand All @@ -282,7 +282,7 @@ class CorticalThickness(shell.Task["CorticalThickness.Outputs"]):
)
t1_registration_template: File = shell.arg(
help="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.",
formatter="t1_registration_template_formatter",
formatter=t1_registration_template_formatter,
)
extraction_registration_mask: File = shell.arg(
help="Mask (defined in the template space) used during registration for brain extraction.",
Expand Down
2 changes: 1 addition & 1 deletion pydra/tasks/ants/v2/segmentation/denoise_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Outputs(shell.Outputs):
output_image: Path = shell.outarg(
help="The output consists of the noise corrected version of the input image.",
path_template="{input_image}_noise_corrected",
formatter="output_image_formatter",
formatter=output_image_formatter,
)
noise_image: Path | None = shell.outarg(
help="Filename for the estimated noise.",
Expand Down
Loading