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

import typing
import pathlib
from styxdefs import *
import dataclasses

CIFTI_CREATE_DENSE_TIMESERIES_METADATA = Metadata(
    id="5456f1c9282ce73af081351a9260762fc07d7440.boutiques",
    name="cifti-create-dense-timeseries",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


@dataclasses.dataclass
class CiftiCreateDenseTimeseriesVolume:
    """
    volume component.
    """
    volume_data: InputPathType
    """volume file containing all voxel data for all volume structures"""
    structure_label_volume: InputPathType
    """label volume file containing labels for cifti structures"""
    
    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("-volume")
        cargs.append(execution.input_file(self.volume_data))
        cargs.append(execution.input_file(self.structure_label_volume))
        return cargs


@dataclasses.dataclass
class CiftiCreateDenseTimeseriesLeftMetric:
    """
    metric for left surface.
    """
    metric: InputPathType
    """the metric file"""
    opt_roi_left_roi_metric: InputPathType | None = None
    """roi of vertices to use from left surface: the ROI as a metric 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("-left-metric")
        cargs.append(execution.input_file(self.metric))
        if self.opt_roi_left_roi_metric is not None:
            cargs.extend([
                "-roi-left",
                execution.input_file(self.opt_roi_left_roi_metric)
            ])
        return cargs


@dataclasses.dataclass
class CiftiCreateDenseTimeseriesRightMetric:
    """
    metric for left surface.
    """
    metric: InputPathType
    """the metric file"""
    opt_roi_right_roi_metric: InputPathType | None = None
    """roi of vertices to use from right surface: the ROI as a metric 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("-right-metric")
        cargs.append(execution.input_file(self.metric))
        if self.opt_roi_right_roi_metric is not None:
            cargs.extend([
                "-roi-right",
                execution.input_file(self.opt_roi_right_roi_metric)
            ])
        return cargs


@dataclasses.dataclass
class CiftiCreateDenseTimeseriesCerebellumMetric:
    """
    metric for the cerebellum.
    """
    metric: InputPathType
    """the metric file"""
    opt_roi_cerebellum_roi_metric: InputPathType | None = None
    """roi of vertices to use from right surface: the ROI as a metric 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("-cerebellum-metric")
        cargs.append(execution.input_file(self.metric))
        if self.opt_roi_cerebellum_roi_metric is not None:
            cargs.extend([
                "-roi-cerebellum",
                execution.input_file(self.opt_roi_cerebellum_roi_metric)
            ])
        return cargs


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


def cifti_create_dense_timeseries(
    cifti_out: str,
    volume: CiftiCreateDenseTimeseriesVolume | None = None,
    left_metric: CiftiCreateDenseTimeseriesLeftMetric | None = None,
    right_metric: CiftiCreateDenseTimeseriesRightMetric | None = None,
    cerebellum_metric: CiftiCreateDenseTimeseriesCerebellumMetric | None = None,
    opt_timestep_interval: float | None = None,
    opt_timestart_start: float | None = None,
    opt_unit_unit: str | None = None,
    runner: Runner | None = None,
) -> CiftiCreateDenseTimeseriesOutputs:
    """
    Create a cifti dense timeseries.
    
    All input files must have the same number of columns/subvolumes. Only the
    specified components will be in the output cifti. At least one component
    must be specified.
    
    See -volume-label-import and -volume-help for format details of label volume
    files. The structure-label-volume should have some of the label names from
    this list, all other label names will be ignored:
    
    CORTEX_LEFT
    CORTEX_RIGHT
    CEREBELLUM
    ACCUMBENS_LEFT
    ACCUMBENS_RIGHT
    ALL_GREY_MATTER
    ALL_WHITE_MATTER
    AMYGDALA_LEFT
    AMYGDALA_RIGHT
    BRAIN_STEM
    CAUDATE_LEFT
    CAUDATE_RIGHT
    CEREBELLAR_WHITE_MATTER_LEFT
    CEREBELLAR_WHITE_MATTER_RIGHT
    CEREBELLUM_LEFT
    CEREBELLUM_RIGHT
    CEREBRAL_WHITE_MATTER_LEFT
    CEREBRAL_WHITE_MATTER_RIGHT
    CORTEX
    DIENCEPHALON_VENTRAL_LEFT
    DIENCEPHALON_VENTRAL_RIGHT
    HIPPOCAMPUS_LEFT
    HIPPOCAMPUS_RIGHT
    INVALID
    OTHER
    OTHER_GREY_MATTER
    OTHER_WHITE_MATTER
    PALLIDUM_LEFT
    PALLIDUM_RIGHT
    PUTAMEN_LEFT
    PUTAMEN_RIGHT
    THALAMUS_LEFT
    THALAMUS_RIGHT
    
    The -unit option accepts these values:
    
    SECOND
    HERTZ
    METER
    RADIAN.
    
    Author: Washington University School of Medicin
    
    Args:
        cifti_out: the output cifti file.
        volume: volume component.
        left_metric: metric for left surface.
        right_metric: metric for left surface.
        cerebellum_metric: metric for the cerebellum.
        opt_timestep_interval: set the timestep: the timestep, in seconds\
            (default 1.0).
        opt_timestart_start: set the start time: the time at the first frame,\
            in seconds (default 0.0).
        opt_unit_unit: use a unit other than time: unit identifier (default\
            SECOND).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `CiftiCreateDenseTimeseriesOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(CIFTI_CREATE_DENSE_TIMESERIES_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-cifti-create-dense-timeseries")
    cargs.append(cifti_out)
    if volume is not None:
        cargs.extend(volume.run(execution))
    if left_metric is not None:
        cargs.extend(left_metric.run(execution))
    if right_metric is not None:
        cargs.extend(right_metric.run(execution))
    if cerebellum_metric is not None:
        cargs.extend(cerebellum_metric.run(execution))
    if opt_timestep_interval is not None:
        cargs.extend([
            "-timestep",
            str(opt_timestep_interval)
        ])
    if opt_timestart_start is not None:
        cargs.extend([
            "-timestart",
            str(opt_timestart_start)
        ])
    if opt_unit_unit is not None:
        cargs.extend([
            "-unit",
            opt_unit_unit
        ])
    ret = CiftiCreateDenseTimeseriesOutputs(
        root=execution.output_file("."),
        cifti_out=execution.output_file(cifti_out),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "CIFTI_CREATE_DENSE_TIMESERIES_METADATA",
    "CiftiCreateDenseTimeseriesCerebellumMetric",
    "CiftiCreateDenseTimeseriesLeftMetric",
    "CiftiCreateDenseTimeseriesOutputs",
    "CiftiCreateDenseTimeseriesRightMetric",
    "CiftiCreateDenseTimeseriesVolume",
    "cifti_create_dense_timeseries",
]
