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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_INFLATE_METADATA = Metadata(
    id="43f3d6dc1b42aaf5d8e8b357955f64c384b5d241.boutiques",
    name="mris_inflate",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisInflateOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_inflate(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_surface_file: OutputPathType
    """Output surface file"""


def mris_inflate(
    input_surface: InputPathType,
    output_surface: str,
    max_iterations: float | None = None,
    snapshot_interval: float | None = None,
    dist_coefficient: float | None = None,
    no_save_sulc: bool = False,
    sulcname: str | None = None,
    mm_flag: bool = False,
    scale_flag: float | None = None,
    runner: Runner | None = None,
) -> MrisInflateOutputs:
    """
    Cortical surface inflation tool.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_surface: Input surface file.
        output_surface: Output surface file.
        max_iterations: Set the maximum number of iterations (default: 10).
        snapshot_interval: Write out a snapshot of the inflation every\
            specified time step.
        dist_coefficient: Specify the relative strength of the metric\
            preserving term in the cost functional versus the smoothing term\
            (default: 0.1).
        no_save_sulc: Do not save ?h.sulc.
        sulcname: Save to ?h.sulcname.
        mm_flag: Compute sulc in mm without zero meaning or scaling.
        scale_flag: Disable or enable scaling of inflated brain.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisInflateOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_INFLATE_METADATA)
    cargs = []
    cargs.append("mris_inflate")
    cargs.append(execution.input_file(input_surface))
    cargs.append(output_surface)
    if max_iterations is not None:
        cargs.extend([
            "-n",
            str(max_iterations)
        ])
    if snapshot_interval is not None:
        cargs.extend([
            "-w",
            str(snapshot_interval)
        ])
    if dist_coefficient is not None:
        cargs.extend([
            "-dist",
            str(dist_coefficient)
        ])
    if no_save_sulc:
        cargs.append("-no-save-sulc")
    if sulcname is not None:
        cargs.extend([
            "-sulc",
            sulcname
        ])
    if mm_flag:
        cargs.append("-mm")
    if scale_flag is not None:
        cargs.extend([
            "-scale",
            str(scale_flag)
        ])
    ret = MrisInflateOutputs(
        root=execution.output_file("."),
        output_surface_file=execution.output_file(output_surface),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_INFLATE_METADATA",
    "MrisInflateOutputs",
    "mris_inflate",
]
