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

import typing
import pathlib
from styxdefs import *
import dataclasses

V__SUMA_RENUMBER_FS_METADATA = Metadata(
    id="c19b88d98568eb300b3deddf6a92cffe231ec7b8.boutiques",
    name="@SUMA_renumber_FS",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VSumaRenumberFsOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__suma_renumber_fs(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    ren_all: OutputPathType
    """Whole parcellation/segmentation file with renumbered ROIs."""
    ren_gm: OutputPathType
    """Gray matter tissue segmentation map."""
    ren_wmat: OutputPathType
    """White matter tissue segmentation map."""
    ren_csf: OutputPathType
    """Cerebrospinal fluid tissue segmentation map."""
    ren_vent: OutputPathType
    """Ventricles and choroid plexus tissue segmentation map."""
    ren_othr: OutputPathType
    """Other tissue segmentation map (optic chiasm, non-WM-hypointens, etc.)."""
    ren_unkn: OutputPathType
    """Unknown tissue segmentation map (FS-defined 'unknown', with voxel value
    >0)."""
    ren_gmrois: OutputPathType
    """Gray matter ROIs without '*-Cerebral-Cortex' dots."""
    fs_ap_wm: OutputPathType
    """White matter mask (excluding the dotted part from FS)."""
    fs_ap_latvent: OutputPathType
    """Lateral ventricles mask ('*-Lateral-Ventricle')."""
    ren_lbl_table: OutputPathType
    """Labeltable of the new ROI values."""


def v__suma_renumber_fs(
    sumadir: str,
    runner: Runner | None = None,
) -> VSumaRenumberFsOutputs:
    """
    This script processes FreeSurfer-generated parcellation files and produces
    various derived datasets and segmentation maps.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        sumadir: Path to the 'SUMA/' directory created by @SUMA_Make_Spec_FS.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VSumaRenumberFsOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__SUMA_RENUMBER_FS_METADATA)
    cargs = []
    cargs.append("@SUMA_renumber_FS")
    cargs.append(sumadir)
    ret = VSumaRenumberFsOutputs(
        root=execution.output_file("."),
        ren_all=execution.output_file("*_REN_all.nii.gz"),
        ren_gm=execution.output_file("*_REN_gm.nii.gz"),
        ren_wmat=execution.output_file("*_REN_wmat.nii.gz"),
        ren_csf=execution.output_file("*_REN_csf.nii.gz"),
        ren_vent=execution.output_file("*_REN_vent.nii.gz"),
        ren_othr=execution.output_file("*_REN_othr.nii.gz"),
        ren_unkn=execution.output_file("*_REN_unkn.nii.gz"),
        ren_gmrois=execution.output_file("*_REN_gmrois.nii.gz"),
        fs_ap_wm=execution.output_file("fs_ap_wm.nii.gz"),
        fs_ap_latvent=execution.output_file("fs_ap_latvent.nii.gz"),
        ren_lbl_table=execution.output_file("*_REN_all.niml.lt"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VSumaRenumberFsOutputs",
    "V__SUMA_RENUMBER_FS_METADATA",
    "v__suma_renumber_fs",
]
