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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_WM_VOLUME_METADATA = Metadata(
    id="9ae7b77a7d1b48992bd6d203bed29f888cde6271.boutiques",
    name="mris_wm_volume",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def mris_wm_volume(
    subject: str,
    hemi: str,
    subjects_dir: str | None = None,
    whitesurfname: str | None = None,
    asegname: str | None = None,
    verbose: bool = False,
    runner: Runner | None = None,
) -> MrisWmVolumeOutputs:
    """
    Computes the volume of the enclosed hemisphere white matter surface, ignoring
    non-white matter voxels in the aseg.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subject: Subject identifier.
        hemi: Hemisphere to compute volume for (e.g., lh or rh).
        subjects_dir: The SUBJECTS_DIR where the subject data is stored.
        whitesurfname: Name of the white surface file.
        asegname: Name of the aseg file.
        verbose: Output more messages.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisWmVolumeOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_WM_VOLUME_METADATA)
    cargs = []
    cargs.append("mris_wm_volume")
    cargs.append(subject)
    cargs.append(hemi)
    if subjects_dir is not None:
        cargs.extend([
            "-SDIR",
            subjects_dir
        ])
    if whitesurfname is not None:
        cargs.extend([
            "-white",
            whitesurfname
        ])
    if asegname is not None:
        cargs.extend([
            "-aseg",
            asegname
        ])
    if verbose:
        cargs.append("-v")
    ret = MrisWmVolumeOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_WM_VOLUME_METADATA",
    "MrisWmVolumeOutputs",
    "mris_wm_volume",
]
