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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_FILL_METADATA = Metadata(
    id="c5656563cf43beb0f218120cdf33a3244a656aa3.boutiques",
    name="mris_fill",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisFillOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_fill(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    filled_volume: OutputPathType
    """The resulting filled volume output."""


def mris_fill(
    input_surface: InputPathType,
    output_volume: str,
    resolution: float | None = None,
    conform: bool = False,
    runner: Runner | None = None,
) -> MrisFillOutputs:
    """
    A tool that floodfills the interior of a surface and writes the results into a
    volume of specified resolution.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_surface: Input surface file.
        output_volume: Output volume file.
        resolution: Set the resolution of the output volume (default = 0.250\
            mm/voxel).
        conform: Conform the volume before writing.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisFillOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_FILL_METADATA)
    cargs = []
    cargs.append("mris_fill")
    if resolution is not None:
        cargs.extend([
            "-r",
            str(resolution)
        ])
    if conform:
        cargs.append("-c")
    cargs.append(execution.input_file(input_surface))
    cargs.append(output_volume)
    ret = MrisFillOutputs(
        root=execution.output_file("."),
        filled_volume=execution.output_file(output_volume),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_FILL_METADATA",
    "MrisFillOutputs",
    "mris_fill",
]
