# This file was auto generated by Styx.
# Do not edit this file directly.

import typing
import pathlib
from styxdefs import *
import dataclasses

ANTS_INTRODUCTION_SH_METADATA = Metadata(
    id="ea6433a22b9e7d78a34c893edf721a839a07cf99.boutiques",
    name="antsIntroduction.sh",
    package="ants",
    container_image_tag="antsx/ants:v2.5.3",
)


class AntsIntroductionShOutputs(typing.NamedTuple):
    """
    Output object returned when calling `ants_introduction_sh(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def ants_introduction_sh(
    image_dimension: typing.Literal[2, 3],
    reference_image: InputPathType,
    input_image: InputPathType,
    force: typing.Literal[0, 1] | None = 1,
    labels_in_fixed_image_space: str | None = None,
    max_iterations: int | None = None,
    n4_bias_field_correction: typing.Literal[0, 1] | None = 0,
    outprefix: str | None = None,
    quality_check: typing.Literal[0, 1] | None = 0,
    similarity_metric: str | None = None,
    transformation_model: str | None = None,
    runner: Runner | None = None,
) -> AntsIntroductionShOutputs:
    """
    Script for registration using ANTS with compulsory and optional arguments.
    
    Author: ANTs Developers
    
    URL: https://github.com/ANTsX/ANTs
    
    Args:
        image_dimension: Image dimension for registration: 2 or 3.
        reference_image: Reference image for registration.
        input_image: Input image to be registered.
        force: Force script to proceed even if headers may be incompatible.
        labels_in_fixed_image_space: Labels in fixed image space to deform to\
            moving image.
        max_iterations: Maximum number of iterations.
        n4_bias_field_correction: N4 Bias Field Correction of moving image: 0\
            for off, 1 for on.
        outprefix: A prefix that is prepended to all output files.
        quality_check: Perform a Quality Check (QC) of the result: 0 for off, 1\
            for on.
        similarity_metric: Type of similarity metric used for registration.
        transformation_model: Type of transformation model used for\
            registration.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `AntsIntroductionShOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(ANTS_INTRODUCTION_SH_METADATA)
    cargs = []
    cargs.append("antsIntroduction.sh")
    cargs.extend([
        "-d",
        str(image_dimension)
    ])
    cargs.extend([
        "-r",
        execution.input_file(reference_image)
    ])
    cargs.extend([
        "-i",
        execution.input_file(input_image)
    ])
    if force is not None:
        cargs.extend([
            "-f",
            str(force)
        ])
    if labels_in_fixed_image_space is not None:
        cargs.extend([
            "-l",
            labels_in_fixed_image_space
        ])
    if max_iterations is not None:
        cargs.extend([
            "-m",
            str(max_iterations)
        ])
    if n4_bias_field_correction is not None:
        cargs.extend([
            "-n",
            str(n4_bias_field_correction)
        ])
    if outprefix is not None:
        cargs.extend([
            "-o",
            outprefix
        ])
    if quality_check is not None:
        cargs.extend([
            "-q",
            str(quality_check)
        ])
    if similarity_metric is not None:
        cargs.extend([
            "-s",
            similarity_metric
        ])
    if transformation_model is not None:
        cargs.extend([
            "-t",
            transformation_model
        ])
    ret = AntsIntroductionShOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "ANTS_INTRODUCTION_SH_METADATA",
    "AntsIntroductionShOutputs",
    "ants_introduction_sh",
]
