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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_CREATE_TESTS_METADATA = Metadata(
    id="8ce88e171c28b9dd055727016c3b5d136019a784.boutiques",
    name="mri_create_tests",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def mri_create_tests(
    input_file: InputPathType,
    out_src: str,
    out_target: str,
    input_target: InputPathType | None = None,
    lta_in: str | None = None,
    mask: InputPathType | None = None,
    noise: float | None = None,
    outlier: float | None = None,
    outlier_box: float | None = None,
    translation_flag: bool = False,
    transdist: float | None = None,
    rotation_flag: bool = False,
    maxdeg: float | None = None,
    intensity_flag: bool = False,
    iscale: float | None = None,
    lta_out: str | None = None,
    lta_outs: str | None = None,
    lta_outt: str | None = None,
    iscale_out: str | None = None,
    runner: Runner | None = None,
) -> MriCreateTestsOutputs:
    """
    Creates test cases for the registration by mapping the input to a source (half
    way backward) and to a target (half way forward).
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_file: Input volume to be modified.
        out_src: Output source volume name.
        out_target: Output target volume name.
        input_target: Input target volume to be modified, must be in the same\
            space as input volume. Default: use input volume to create output\
            target.
        lta_in: Specify LTA for mapping input to output target. Cannot be used\
            with --rotation or --translation.
        mask: Mask source MRI with mask file.
        noise: Add global Gaussian noise.
        outlier: Add random outlier voxels.
        outlier_box: Add box containing random voxels.
        translation_flag: Apply random translation.
        transdist: Set maximal translation distance in mm. Default is 11.
        rotation_flag: Apply random rotation.
        maxdeg: Maximal rotation in degrees. Default is 25.
        intensity_flag: Apply random intensity scaling.
        iscale: Use fixed intensity scaling parameter.
        lta_out: Write used random transform to LTA.
        lta_outs: Write halfway LTA for source.
        lta_outt: Write halfway LTA for target.
        iscale_out: Write used intensity scaling parameter.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriCreateTestsOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_CREATE_TESTS_METADATA)
    cargs = []
    cargs.append("mri_create_tests")
    cargs.extend([
        "--in",
        execution.input_file(input_file)
    ])
    cargs.extend([
        "--outs",
        out_src
    ])
    cargs.extend([
        "--outt",
        out_target
    ])
    if input_target is not None:
        cargs.extend([
            "--int",
            execution.input_file(input_target)
        ])
    if lta_in is not None:
        cargs.extend([
            "--lta-in",
            lta_in
        ])
    if mask is not None:
        cargs.extend([
            "--mask",
            execution.input_file(mask)
        ])
    if noise is not None:
        cargs.extend([
            "--noise",
            str(noise)
        ])
    if outlier is not None:
        cargs.extend([
            "--outlier",
            str(outlier)
        ])
    if outlier_box is not None:
        cargs.extend([
            "--outlier-box",
            str(outlier_box)
        ])
    if translation_flag:
        cargs.append("--translation")
    if transdist is not None:
        cargs.extend([
            "--transdist",
            str(transdist)
        ])
    if rotation_flag:
        cargs.append("--rotation")
    if maxdeg is not None:
        cargs.extend([
            "--maxdeg",
            str(maxdeg)
        ])
    if intensity_flag:
        cargs.append("--intensity")
    if iscale is not None:
        cargs.extend([
            "--iscale",
            str(iscale)
        ])
    if lta_out is not None:
        cargs.extend([
            "--lta-out",
            lta_out
        ])
    if lta_outs is not None:
        cargs.extend([
            "--lta-outs",
            lta_outs
        ])
    if lta_outt is not None:
        cargs.extend([
            "--lta-outt",
            lta_outt
        ])
    if iscale_out is not None:
        cargs.extend([
            "--iscale-out",
            iscale_out
        ])
    ret = MriCreateTestsOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_CREATE_TESTS_METADATA",
    "MriCreateTestsOutputs",
    "mri_create_tests",
]
