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

import typing
import pathlib
from styxdefs import *
import dataclasses

FOCI_CREATE_METADATA = Metadata(
    id="f54b92ca66ce06ab8acae5b43f6f0c242d214886.boutiques",
    name="foci-create",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


@dataclasses.dataclass
class FociCreateClass:
    """
    specify class input data.
    """
    class_name: str
    """name of class"""
    foci_list_file: str
    """text file containing foci names, coordinates, and colors"""
    surface: InputPathType
    """surface file for projection of foci list file"""
    
    def run(
        self,
        execution: Execution,
    ) -> list[str]:
        """
        Build command line arguments. This method is called by the main command.
        
        Args:
            execution: The execution object.
        Returns:
            Command line arguments
        """
        cargs = []
        cargs.append("-class")
        cargs.append(self.class_name)
        cargs.append(self.foci_list_file)
        cargs.append(execution.input_file(self.surface))
        return cargs


class FociCreateOutputs(typing.NamedTuple):
    """
    Output object returned when calling `foci_create(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output: OutputPathType
    """the output foci file"""


def foci_create(
    output: str,
    class_: list[FociCreateClass] | None = None,
    runner: Runner | None = None,
) -> FociCreateOutputs:
    """
    Create a foci file.
    
    Creates a foci file from names, coordinates, and RGB values in a text file.
    The text file must have the following format (2 lines per focus):
    
    <focus-name>
    <red> <green> <blue> <x> <y> <z>
    ...
    
    Foci names are specified on a separate line from their coordinates and
    color, in order to let foci names contain spaces. Whitespace is trimmed from
    both ends of the foci name, but is kept if it is in the middle of a name.
    The values of <red>, <green>, <blue> and must be integers from 0 to 255, and
    will specify the color the foci is drawn as.
    
    Foci are grouped into classes and the name for the class is specified using
    the <class-name> parameter.
    
    All foci within one text file must be associated with the structure
    contained in the <surface> parameter and are projected to that surface.
    
    Author: Connectome Workbench Developers
    
    URL: https://github.com/Washington-University/workbench
    
    Args:
        output: the output foci file.
        class_: specify class input data.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FociCreateOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FOCI_CREATE_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-foci-create")
    cargs.append(output)
    if class_ is not None:
        cargs.extend([a for c in [s.run(execution) for s in class_] for a in c])
    ret = FociCreateOutputs(
        root=execution.output_file("."),
        output=execution.output_file(output),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FOCI_CREATE_METADATA",
    "FociCreateClass",
    "FociCreateOutputs",
    "foci_create",
]
