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

import typing
import pathlib
from styxdefs import *
import dataclasses

MAKE_SYMMETRIC_METADATA = Metadata(
    id="0edab2e26b68afca9fa6531a0a4823dd6acee05b.boutiques",
    name="make_symmetric",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MakeSymmetricOutputs(typing.NamedTuple):
    """
    Output object returned when calling `make_symmetric(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    processed_output: OutputPathType
    """Output image file after processing."""
    map_output: OutputPathType
    """Transformation map file mapping the input to the upright space."""


def make_symmetric(
    hemi: str,
    input_file: InputPathType,
    output_file: str,
    transform_map: str,
    runner: Runner | None = None,
) -> MakeSymmetricOutputs:
    """
    Registers an input image to its left/right reversed version using
    mri_robust_register in a half-way space and mirrors the selected hemisphere.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        hemi: The hemisphere to mirror; accepted values are 'lh' for left\
            hemisphere or 'rh' for right hemisphere.
        input_file: Input image in .mgz format.
        output_file: Output image in .mgz format resulting from the symmetric\
            processing.
        transform_map: Transformation map in .lta format mapping the input to\
            the upright space.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MakeSymmetricOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MAKE_SYMMETRIC_METADATA)
    cargs = []
    cargs.append("make_symmetric")
    cargs.append(hemi)
    cargs.append(execution.input_file(input_file))
    cargs.append(output_file)
    cargs.append(transform_map)
    ret = MakeSymmetricOutputs(
        root=execution.output_file("."),
        processed_output=execution.output_file(output_file),
        map_output=execution.output_file(transform_map),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MAKE_SYMMETRIC_METADATA",
    "MakeSymmetricOutputs",
    "make_symmetric",
]
