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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_MEF_SURFACES_METADATA = Metadata(
    id="02223303295326924a357b3a06e1f9463f061c83.boutiques",
    name="mris_mef_surfaces",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def mris_mef_surfaces(
    subject_name: str,
    hemisphere: str,
    omit_self_intersection: bool = False,
    curvature: bool = False,
    average_curvature: float | None = None,
    white_only: bool = False,
    runner: Runner | None = None,
) -> MrisMefSurfacesOutputs:
    """
    Positions the tessellation of the cortical surface at the white matter surface,
    then the gray matter surface and generates surface files for these surfaces.
    Also generates 'curvature' file for cortical thickness and a surface file
    approximating layer IV of the cortical sheet.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subject_name: Name of the subject.
        hemisphere: Hemisphere (e.g., left or right).
        omit_self_intersection: Omit self-intersection and only generate\
            gray/white surface.
        curvature: Create curvature and area files from the white matter\
            surface.
        average_curvature: Average curvature values specified number of times,\
            default is 10.
        white_only: Only generate the white matter surface.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisMefSurfacesOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_MEF_SURFACES_METADATA)
    cargs = []
    cargs.append("mris_mef_surfaces")
    cargs.append(subject_name)
    cargs.append(hemisphere)
    if omit_self_intersection:
        cargs.append("-q")
    if curvature:
        cargs.append("-c")
    if average_curvature is not None:
        cargs.extend([
            "-a",
            str(average_curvature)
        ])
    if white_only:
        cargs.append("-whiteonly")
    ret = MrisMefSurfacesOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_MEF_SURFACES_METADATA",
    "MrisMefSurfacesOutputs",
    "mris_mef_surfaces",
]
