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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_SURFACEMASK_METADATA = Metadata(
    id="b54f5cc796265da710c425a288cee6461dd77a00.boutiques",
    name="mri_surfacemask",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriSurfacemaskOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_surfacemask(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_volume_file: OutputPathType
    """The resulting surface-masked volume"""


def mri_surfacemask(
    input_volume: InputPathType,
    input_surface: InputPathType,
    output_volume: str,
    runner: Runner | None = None,
) -> MriSurfacemaskOutputs:
    """
    Tool to produce a new volume where all pixels outside the surface are set to
    zero.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_volume: Input volume which will be masked.
        input_surface: Surface file used for masking the volume.
        output_volume: Output volume file where pixels outside the surface are\
            set to zero.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriSurfacemaskOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_SURFACEMASK_METADATA)
    cargs = []
    cargs.append("mri_surfacemask")
    cargs.append(execution.input_file(input_volume))
    cargs.append(execution.input_file(input_surface))
    cargs.append(output_volume)
    ret = MriSurfacemaskOutputs(
        root=execution.output_file("."),
        output_volume_file=execution.output_file(output_volume),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_SURFACEMASK_METADATA",
    "MriSurfacemaskOutputs",
    "mri_surfacemask",
]
