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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_LINEAR_ALIGN_BINARY_METADATA = Metadata(
    id="8f952429c373760f2ebf14b9f290bc6f0c53127a.boutiques",
    name="mri_linear_align_binary",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriLinearAlignBinaryOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_linear_align_binary(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_xform_file: OutputPathType
    """The output transformation file"""


def mri_linear_align_binary(
    source: InputPathType,
    target: InputPathType,
    output_xform: str,
    target_label: str | None = None,
    runner: Runner | None = None,
) -> MriLinearAlignBinaryOutputs:
    """
    A tool for linear alignment of MRI images.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        source: Source image file.
        target: Target image file.
        output_xform: Output transformation file.
        target_label: Target label, assume source is high-resolution\
            hippocampal labeling.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriLinearAlignBinaryOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_LINEAR_ALIGN_BINARY_METADATA)
    cargs = []
    cargs.append("mri_linear_align_binary")
    cargs.append(execution.input_file(source))
    cargs.append(execution.input_file(target))
    cargs.append(output_xform)
    if target_label is not None:
        cargs.extend([
            "-h",
            target_label
        ])
    ret = MriLinearAlignBinaryOutputs(
        root=execution.output_file("."),
        output_xform_file=execution.output_file(output_xform),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_LINEAR_ALIGN_BINARY_METADATA",
    "MriLinearAlignBinaryOutputs",
    "mri_linear_align_binary",
]
