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

import typing
import pathlib
from styxdefs import *
import dataclasses

VERTEXVOL_METADATA = Metadata(
    id="43f2f0ece18dc9707df38e81102c8d727e4682e9.boutiques",
    name="vertexvol",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class VertexvolOutputs(typing.NamedTuple):
    """
    Output object returned when calling `vertexvol(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_volume_file: OutputPathType | None
    """Output file containing vertex-wise volume"""


def vertexvol(
    subject: str,
    right_hemisphere: bool = False,
    output_file: str | None = "?h.volume",
    no_th3: bool = False,
    runner: Runner | None = None,
) -> VertexvolOutputs:
    """
    Computes vertex-wise volume (and mid.area).
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subject: Subject identifier.
        right_hemisphere: Select right hemisphere.
        output_file: Output file name, default is ?h.volume.
        no_th3: Don't use TH3 method for computation.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VertexvolOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(VERTEXVOL_METADATA)
    cargs = []
    cargs.append("vertexvol")
    cargs.extend([
        "--s",
        subject
    ])
    if right_hemisphere:
        cargs.append("--rh")
    if output_file is not None:
        cargs.extend([
            "--o",
            output_file
        ])
    if no_th3:
        cargs.append("--no-th3")
    ret = VertexvolOutputs(
        root=execution.output_file("."),
        output_volume_file=execution.output_file(output_file) if (output_file is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VERTEXVOL_METADATA",
    "VertexvolOutputs",
    "vertexvol",
]
