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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_SURF_MASK_METADATA = Metadata(
    id="b8441ef0584a7bf83b118f6db3b81eb258eacb78.boutiques",
    name="3dSurfMask",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dSurfMaskOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_surf_mask(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_mask: OutputPathType
    """Main output mask dataset."""
    distance_dataset: OutputPathType
    """Dataset reflecting voxel shortest distances to the surface."""


def v_3d_surf_mask(
    runner: Runner | None = None,
) -> V3dSurfMaskOutputs:
    """
    Creates volumetric datasets marking voxels based on their location relative to a
    surface.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dSurfMask.html
    
    Args:
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dSurfMaskOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_SURF_MASK_METADATA)
    cargs = []
    cargs.append("3dSurfMask")
    cargs.append("<-i_TYPE")
    cargs.append("SURFACE>")
    cargs.append("<-prefix")
    cargs.append("PREFIX>")
    cargs.append("<-grid_parent")
    cargs.append("GRID_VOL>")
    cargs.append("[<fill_method>")
    cargs.append("<SURF_VOL>")
    cargs.append("<mask_only>")
    cargs.append("<flip_orientation>")
    cargs.append("<no_dist>]")
    ret = V3dSurfMaskOutputs(
        root=execution.output_file("."),
        output_mask=execution.output_file("[PREFIX].m+orig.BRIK"),
        distance_dataset=execution.output_file("[PREFIX].d+orig.BRIK"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dSurfMaskOutputs",
    "V_3D_SURF_MASK_METADATA",
    "v_3d_surf_mask",
]
