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

import typing
import pathlib
from styxdefs import *
import dataclasses

CIFTI_CREATE_SCALAR_SERIES_METADATA = Metadata(
    id="731ab0e93ff863505c9e8a32b724b941eadf5abd.boutiques",
    name="cifti-create-scalar-series",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


@dataclasses.dataclass
class CiftiCreateScalarSeriesSeries:
    """
    set the units and values of the series.
    """
    unit: str
    """the unit to use"""
    start: float
    """the value at the first series point"""
    step: float
    """the interval between series points"""
    
    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("-series")
        cargs.append(self.unit)
        cargs.append(str(self.start))
        cargs.append(str(self.step))
        return cargs


class CiftiCreateScalarSeriesOutputs(typing.NamedTuple):
    """
    Output object returned when calling `cifti_create_scalar_series(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    cifti_out: OutputPathType
    """output cifti file"""


def cifti_create_scalar_series(
    input_: str,
    cifti_out: str,
    opt_transpose: bool = False,
    opt_name_file_file: str | None = None,
    series: CiftiCreateScalarSeriesSeries | None = None,
    runner: Runner | None = None,
) -> CiftiCreateScalarSeriesOutputs:
    """
    Import series data into cifti.
    
    Convert a text file containing series of equal length into a cifti file. The
    text file should have lines made up of numbers separated by whitespace, with
    no extra newlines between lines.
    
    The <unit> argument must be one of the following:
    
    SECOND
    HERTZ
    METER
    RADIAN.
    
    Author: Washington University School of Medicin
    
    Args:
        input_: input file.
        cifti_out: output cifti file.
        opt_transpose: use if the rows of the text file are along the scalar\
            dimension.
        opt_name_file_file: use a text file to set names on scalar dimension:\
            text file containing names, one per line.
        series: set the units and values of the series.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `CiftiCreateScalarSeriesOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(CIFTI_CREATE_SCALAR_SERIES_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-cifti-create-scalar-series")
    cargs.append(input_)
    cargs.append(cifti_out)
    if opt_transpose:
        cargs.append("-transpose")
    if opt_name_file_file is not None:
        cargs.extend([
            "-name-file",
            opt_name_file_file
        ])
    if series is not None:
        cargs.extend(series.run(execution))
    ret = CiftiCreateScalarSeriesOutputs(
        root=execution.output_file("."),
        cifti_out=execution.output_file(cifti_out),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "CIFTI_CREATE_SCALAR_SERIES_METADATA",
    "CiftiCreateScalarSeriesOutputs",
    "CiftiCreateScalarSeriesSeries",
    "cifti_create_scalar_series",
]
