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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_FUNCVITS_METADATA = Metadata(
    id="a906844e0fb427ee5992ebd3da45e1f05aaf100a.boutiques",
    name="mri-funcvits",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriFuncvitsOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_funcvits(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def mri_funcvits(
    stem: str,
    outdir: str,
    reg: str | None = None,
    paintsurf: str | None = "white",
    sphere: str | None = "sphere",
    icosize: int | None = 10242,
    hemi: list[str] | None = ["lh", "rh"],
    svitdir: str | None = None,
    icodir: str | None = "/usr/local/freesurfer/lib/bem",
    umask: str | None = None,
    mail: str | None = None,
    noforce: bool = False,
    runner: Runner | None = None,
) -> MriFuncvitsOutputs:
    """
    Tool for functional volume to surface conversion in neuroimaging analysis.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        stem: Template stem.
        outdir: Output directory.
        reg: Registration file.
        paintsurf: Surface upon which to paint.
        sphere: Spherical surface.
        icosize: Icosahedron size.
        hemi: Hemifield(s).
        svitdir: SVIT directory.
        icodir: ICO directory.
        umask: New umask.
        mail: User email for notifications.
        noforce: Do not create if output already exists.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriFuncvitsOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_FUNCVITS_METADATA)
    cargs = []
    cargs.append("mri-funcvits")
    cargs.extend([
        "--stem",
        stem
    ])
    cargs.extend([
        "--outdir",
        outdir
    ])
    if reg is not None:
        cargs.extend([
            "--reg",
            reg
        ])
    if paintsurf is not None:
        cargs.extend([
            "--paintsurf",
            paintsurf
        ])
    if sphere is not None:
        cargs.extend([
            "--sphere",
            sphere
        ])
    if icosize is not None:
        cargs.extend([
            "--icosize",
            str(icosize)
        ])
    if hemi is not None:
        cargs.extend([
            "--hemi",
            *hemi
        ])
    if svitdir is not None:
        cargs.extend([
            "--svitdir",
            svitdir
        ])
    if icodir is not None:
        cargs.extend([
            "--icodir",
            icodir
        ])
    if umask is not None:
        cargs.extend([
            "--umask",
            umask
        ])
    if mail is not None:
        cargs.extend([
            "--mail",
            mail
        ])
    if noforce:
        cargs.append("--noforce")
    ret = MriFuncvitsOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_FUNCVITS_METADATA",
    "MriFuncvitsOutputs",
    "mri_funcvits",
]
