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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_CA_DEFORM_METADATA = Metadata(
    id="7a76a6060e94710386328206ab18f500335fc348.boutiques",
    name="mris_ca_deform",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisCaDeformOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_ca_deform(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    deformed_surface: OutputPathType
    """The result of the deformation process, output surface file."""


def mris_ca_deform(
    input_surface: InputPathType,
    label_vol: InputPathType,
    transform: InputPathType,
    intensity_vol: InputPathType,
    output_surface: str,
    runner: Runner | None = None,
) -> MrisCaDeformOutputs:
    """
    Deforms a surface to match it to a volumetric map of cortical labels.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_surface: The input surface file to be deformed.
        label_vol: The input volumetric label map.
        transform: The transform file, typically a matrix that aligns the\
            volumes.
        intensity_vol: The intensity volume that is used in the deformation\
            process.
        output_surface: The file name for the output, deformed surface.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisCaDeformOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_CA_DEFORM_METADATA)
    cargs = []
    cargs.append("mris_ca_deform")
    cargs.append(execution.input_file(input_surface))
    cargs.append(execution.input_file(label_vol))
    cargs.append(execution.input_file(transform))
    cargs.append(execution.input_file(intensity_vol))
    cargs.append(output_surface)
    ret = MrisCaDeformOutputs(
        root=execution.output_file("."),
        deformed_surface=execution.output_file(output_surface),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_CA_DEFORM_METADATA",
    "MrisCaDeformOutputs",
    "mris_ca_deform",
]
