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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_RIBBON_METADATA = Metadata(
    id="63d995760cf07991e31c0b77f7e67dbab7a6b9bb.boutiques",
    name="mri_ribbon",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriRibbonOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_ribbon(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    ribbon_output: OutputPathType
    """Output ribbon volume"""


def mri_ribbon(
    inner_surface: InputPathType,
    outer_surface: InputPathType,
    input_volume: str,
    output_volume: str,
    label_file: InputPathType | None = None,
    runner: Runner | None = None,
) -> MriRibbonOutputs:
    """
    MRI Ribbon tool to create ribbon volumes from surface files.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        inner_surface: File name of the inner surface.
        outer_surface: File name of the outer surface.
        input_volume: Prefix for the input volume file.
        output_volume: Prefix for the output volume file.
        label_file: Label file specifying regions of interest (optional).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriRibbonOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_RIBBON_METADATA)
    cargs = []
    cargs.append("mri_ribbon")
    if label_file is not None:
        cargs.extend([
            "-l",
            execution.input_file(label_file)
        ])
    cargs.append(execution.input_file(inner_surface))
    cargs.append(execution.input_file(outer_surface))
    cargs.append(input_volume)
    cargs.append(output_volume)
    ret = MriRibbonOutputs(
        root=execution.output_file("."),
        ribbon_output=execution.output_file(output_volume + "_ribbon.nii.gz"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_RIBBON_METADATA",
    "MriRibbonOutputs",
    "mri_ribbon",
]
