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

import typing
import pathlib
from styxdefs import *
import dataclasses

RECON_ALL_EXVIVO_METADATA = Metadata(
    id="ab8a5243b725eb3269bc328c28f826e76302edba.boutiques",
    name="recon-all-exvivo",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def recon_all_exvivo(
    subject_id: str,
    hemisphere: str | None = None,
    nocerebellum: bool = False,
    runner: Runner | None = None,
) -> ReconAllExvivoOutputs:
    """
    A script to perform an ex vivo reconstruction with FreeSurfer.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subject_id: Subject identifier.
        hemisphere: Specify hemisphere: -lh for left, -rh for right hemisphere.
        nocerebellum: Do not process cerebellum.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `ReconAllExvivoOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(RECON_ALL_EXVIVO_METADATA)
    cargs = []
    cargs.append("recon-all-exvivo")
    cargs.extend([
        "-s",
        subject_id
    ])
    if hemisphere is not None:
        cargs.extend([
            "-[lr]h",
            hemisphere
        ])
    if nocerebellum:
        cargs.append("-nocerebellum")
    ret = ReconAllExvivoOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "RECON_ALL_EXVIVO_METADATA",
    "ReconAllExvivoOutputs",
    "recon_all_exvivo",
]
