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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_RF_LABEL_METADATA = Metadata(
    id="7f1e3e28634018fe4c2b21e53465fa3c07f2cb04.boutiques",
    name="mris_rf_label",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def mris_rf_label(
    subject: str,
    rf_classifier: str,
    output_name: str,
    hemi: str | None = None,
    surf: str | None = None,
    runner: Runner | None = None,
) -> MrisRfLabelOutputs:
    """
    A tool for labeling regions of a surface using random forest classification.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subject: Subject identifier.
        rf_classifier: Random Forest classifier.
        output_name: Output name.
        hemi: Process specified hemisphere instead of default (lh).
        surf: Change default surface name from 'white' to specified surface.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisRfLabelOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_RF_LABEL_METADATA)
    cargs = []
    cargs.append("mris_rf_label")
    cargs.append(subject)
    cargs.append(rf_classifier)
    cargs.append(output_name)
    if hemi is not None:
        cargs.extend([
            "--hemi",
            hemi
        ])
    if surf is not None:
        cargs.extend([
            "--surf",
            surf
        ])
    ret = MrisRfLabelOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_RF_LABEL_METADATA",
    "MrisRfLabelOutputs",
    "mris_rf_label",
]
