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

import typing
import pathlib
from styxdefs import *
import dataclasses

V__ELECTRO_GRID_METADATA = Metadata(
    id="8d964e948445e43b1078948d73794b4d6f87e09a.boutiques",
    name="@ElectroGrid",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VElectroGridOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__electro_grid(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_surface: OutputPathType | None
    """Output surface file"""


def v__electro_grid(
    strip: int | None = None,
    grid: list[int] | None = None,
    prefix: str | None = None,
    coords: InputPathType | None = None,
    with_markers: bool = False,
    echo: bool = False,
    runner: Runner | None = None,
) -> VElectroGridOutputs:
    """
    Creates a mesh representation of an electrode grid for use with SUMA.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        strip: Make an Nx strip (array) of electrodes.
        grid: Make an Nx by Ny grid of electrodes. A node at (i,j) has a node\
            ID = i+Nx*j with 0<=i<Nx and 0<=j<=Ny.
        prefix: Use PREFIX for the output surface.
        coords: Specify the coordinates of the nodes on the grid, or the array.\
            XYZ.1D should have three columns, with each row specifying the\
            coordinates of one node.
        with_markers: Add markers to the surface at each electrode.
        echo: Set echo.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VElectroGridOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__ELECTRO_GRID_METADATA)
    cargs = []
    cargs.append("@ElectroGrid")
    if strip is not None:
        cargs.extend([
            "-strip",
            str(strip)
        ])
    if grid is not None:
        cargs.extend([
            "-grid",
            *map(str, grid)
        ])
    if prefix is not None:
        cargs.extend([
            "-prefix",
            prefix
        ])
    if coords is not None:
        cargs.extend([
            "-coords",
            execution.input_file(coords)
        ])
    if with_markers:
        cargs.append("-with_markers")
    if echo:
        cargs.append("-echo")
    ret = VElectroGridOutputs(
        root=execution.output_file("."),
        output_surface=execution.output_file(prefix + ".gii") if (prefix is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VElectroGridOutputs",
    "V__ELECTRO_GRID_METADATA",
    "v__electro_grid",
]
