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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_SHRINKWRAP_METADATA = Metadata(
    id="12ec14d079d6b626e78773a4c0b060c225cdd33f.boutiques",
    name="mris_shrinkwrap",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisShrinkwrapOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_shrinkwrap(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    inner_skull: OutputPathType
    """Output surface file representing the inner skull."""
    outer_skull: OutputPathType
    """Output surface file representing the outer skull."""
    outer_skin: OutputPathType
    """Output surface file representing the outer skin."""


def mris_shrinkwrap(
    volume: InputPathType,
    output_name: str,
    threshold: float | None = None,
    runner: Runner | None = None,
) -> MrisShrinkwrapOutputs:
    """
    Generate shrink-wrapped tessellations of the input volume.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        volume: Input image volume for shrink wrap.
        output_name: Base name for output surface files.
        threshold: Apply threshold to image before deforming on distance\
            transform.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisShrinkwrapOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_SHRINKWRAP_METADATA)
    cargs = []
    cargs.append("mris_shrinkwrap")
    cargs.append(execution.input_file(volume))
    cargs.append(output_name)
    if threshold is not None:
        cargs.extend([
            "-t",
            str(threshold)
        ])
    ret = MrisShrinkwrapOutputs(
        root=execution.output_file("."),
        inner_skull=execution.output_file(output_name + "_inner_skull.tri"),
        outer_skull=execution.output_file(output_name + "_outer_skull.tri"),
        outer_skin=execution.output_file(output_name + "_outer_skin.tri"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_SHRINKWRAP_METADATA",
    "MrisShrinkwrapOutputs",
    "mris_shrinkwrap",
]
