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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_DEFORM_METADATA = Metadata(
    id="ea5061ef18cb76bb82c43acc63761667972d145b.boutiques",
    name="mris_deform",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisDeformOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_deform(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    deformed_surface: OutputPathType
    """Deformed surface file output by mris_deform"""


def mris_deform(
    input_surface: InputPathType,
    input_volume: InputPathType,
    xform: InputPathType,
    output_surface: str,
    runner: Runner | None = None,
) -> MrisDeformOutputs:
    """
    A tool for deforming surface meshes using volumetric information from an
    auxiliary volume.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_surface: Input surface file (e.g., lh.white).
        input_volume: Input volume file (e.g., brain.mgz).
        xform: Transformation file (e.g., talairach.xfm).
        output_surface: Output surface file (e.g., lh.white.deformed).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisDeformOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_DEFORM_METADATA)
    cargs = []
    cargs.append("mris_deform")
    cargs.append(execution.input_file(input_surface))
    cargs.append(execution.input_file(input_volume))
    cargs.append(execution.input_file(xform))
    cargs.append(output_surface)
    ret = MrisDeformOutputs(
        root=execution.output_file("."),
        deformed_surface=execution.output_file(output_surface),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_DEFORM_METADATA",
    "MrisDeformOutputs",
    "mris_deform",
]
