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

import typing
import pathlib
from styxdefs import *

CIFTI_CREATE_DENSE_SCALAR_METADATA = Metadata(
    id="e17e9d7682a88404f1c7e8f47d1454ee199d7b6e.workbench",
    name="cifti-create-dense-scalar",
    package="workbench",
    container_image_tag="nx10x/workbench:2.1.0",
)


_CiftiCreateDenseScalarVolumeParamsDictNoTag = typing.TypedDict('_CiftiCreateDenseScalarVolumeParamsDictNoTag', {
    "volume-data": InputPathType,
    "structure-label-volume": InputPathType,
})
CiftiCreateDenseScalarVolumeParamsDictTagged = typing.TypedDict('CiftiCreateDenseScalarVolumeParamsDictTagged', {
    "@type": typing.Literal["volume"],
    "volume-data": InputPathType,
    "structure-label-volume": InputPathType,
})
CiftiCreateDenseScalarVolumeParamsDict = _CiftiCreateDenseScalarVolumeParamsDictNoTag | CiftiCreateDenseScalarVolumeParamsDictTagged


_CiftiCreateDenseScalarLeftMetricParamsDictNoTag = typing.TypedDict('_CiftiCreateDenseScalarLeftMetricParamsDictNoTag', {
    "metric": InputPathType,
    "roi-metric": typing.NotRequired[InputPathType | None],
})
CiftiCreateDenseScalarLeftMetricParamsDictTagged = typing.TypedDict('CiftiCreateDenseScalarLeftMetricParamsDictTagged', {
    "@type": typing.Literal["left-metric"],
    "metric": InputPathType,
    "roi-metric": typing.NotRequired[InputPathType | None],
})
CiftiCreateDenseScalarLeftMetricParamsDict = _CiftiCreateDenseScalarLeftMetricParamsDictNoTag | CiftiCreateDenseScalarLeftMetricParamsDictTagged


_CiftiCreateDenseScalarRightMetricParamsDictNoTag = typing.TypedDict('_CiftiCreateDenseScalarRightMetricParamsDictNoTag', {
    "metric": InputPathType,
    "roi-metric": typing.NotRequired[InputPathType | None],
})
CiftiCreateDenseScalarRightMetricParamsDictTagged = typing.TypedDict('CiftiCreateDenseScalarRightMetricParamsDictTagged', {
    "@type": typing.Literal["right-metric"],
    "metric": InputPathType,
    "roi-metric": typing.NotRequired[InputPathType | None],
})
CiftiCreateDenseScalarRightMetricParamsDict = _CiftiCreateDenseScalarRightMetricParamsDictNoTag | CiftiCreateDenseScalarRightMetricParamsDictTagged


_CiftiCreateDenseScalarCerebellumMetricParamsDictNoTag = typing.TypedDict('_CiftiCreateDenseScalarCerebellumMetricParamsDictNoTag', {
    "metric": InputPathType,
    "roi-metric": typing.NotRequired[InputPathType | None],
})
CiftiCreateDenseScalarCerebellumMetricParamsDictTagged = typing.TypedDict('CiftiCreateDenseScalarCerebellumMetricParamsDictTagged', {
    "@type": typing.Literal["cerebellum-metric"],
    "metric": InputPathType,
    "roi-metric": typing.NotRequired[InputPathType | None],
})
CiftiCreateDenseScalarCerebellumMetricParamsDict = _CiftiCreateDenseScalarCerebellumMetricParamsDictNoTag | CiftiCreateDenseScalarCerebellumMetricParamsDictTagged


_CiftiCreateDenseScalarMetricParamsDictNoTag = typing.TypedDict('_CiftiCreateDenseScalarMetricParamsDictNoTag', {
    "structure": str,
    "metric": InputPathType,
    "roi-metric": typing.NotRequired[InputPathType | None],
})
CiftiCreateDenseScalarMetricParamsDictTagged = typing.TypedDict('CiftiCreateDenseScalarMetricParamsDictTagged', {
    "@type": typing.Literal["metric"],
    "structure": str,
    "metric": InputPathType,
    "roi-metric": typing.NotRequired[InputPathType | None],
})
CiftiCreateDenseScalarMetricParamsDict = _CiftiCreateDenseScalarMetricParamsDictNoTag | CiftiCreateDenseScalarMetricParamsDictTagged


_CiftiCreateDenseScalarParamsDictNoTag = typing.TypedDict('_CiftiCreateDenseScalarParamsDictNoTag', {
    "cifti-out": str,
    "volume": typing.NotRequired[CiftiCreateDenseScalarVolumeParamsDict | None],
    "left-metric": typing.NotRequired[CiftiCreateDenseScalarLeftMetricParamsDict | None],
    "right-metric": typing.NotRequired[CiftiCreateDenseScalarRightMetricParamsDict | None],
    "cerebellum-metric": typing.NotRequired[CiftiCreateDenseScalarCerebellumMetricParamsDict | None],
    "metric": typing.NotRequired[list[CiftiCreateDenseScalarMetricParamsDict] | None],
    "file": typing.NotRequired[str | None],
})
CiftiCreateDenseScalarParamsDictTagged = typing.TypedDict('CiftiCreateDenseScalarParamsDictTagged', {
    "@type": typing.Literal["workbench/cifti-create-dense-scalar"],
    "cifti-out": str,
    "volume": typing.NotRequired[CiftiCreateDenseScalarVolumeParamsDict | None],
    "left-metric": typing.NotRequired[CiftiCreateDenseScalarLeftMetricParamsDict | None],
    "right-metric": typing.NotRequired[CiftiCreateDenseScalarRightMetricParamsDict | None],
    "cerebellum-metric": typing.NotRequired[CiftiCreateDenseScalarCerebellumMetricParamsDict | None],
    "metric": typing.NotRequired[list[CiftiCreateDenseScalarMetricParamsDict] | None],
    "file": typing.NotRequired[str | None],
})
CiftiCreateDenseScalarParamsDict = _CiftiCreateDenseScalarParamsDictNoTag | CiftiCreateDenseScalarParamsDictTagged


def cifti_create_dense_scalar_volume(
    volume_data: InputPathType,
    structure_label_volume: InputPathType,
) -> CiftiCreateDenseScalarVolumeParamsDictTagged:
    """
    Build parameters.
    
    Args:
        volume_data: volume file containing all voxel data for all volume\
            structures.
        structure_label_volume: label volume file containing labels for cifti\
            structures.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "volume",
        "volume-data": volume_data,
        "structure-label-volume": structure_label_volume,
    }
    return params


def cifti_create_dense_scalar_volume_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `CiftiCreateDenseScalarVolumeParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("volume-data", None) is None:
        raise StyxValidationError("`volume-data` must not be None")
    if not isinstance(params["volume-data"], (pathlib.Path, str)):
        raise StyxValidationError(f'`volume-data` has the wrong type: Received `{type(params.get("volume-data", None))}` expected `InputPathType`')
    if params.get("structure-label-volume", None) is None:
        raise StyxValidationError("`structure-label-volume` must not be None")
    if not isinstance(params["structure-label-volume"], (pathlib.Path, str)):
        raise StyxValidationError(f'`structure-label-volume` has the wrong type: Received `{type(params.get("structure-label-volume", None))}` expected `InputPathType`')


def cifti_create_dense_scalar_volume_cargs(
    params: CiftiCreateDenseScalarVolumeParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.extend([
        "-volume",
        execution.input_file(params.get("volume-data", None)),
        execution.input_file(params.get("structure-label-volume", None))
    ])
    return cargs


def cifti_create_dense_scalar_left_metric(
    metric: InputPathType,
    roi_metric: InputPathType | None = None,
) -> CiftiCreateDenseScalarLeftMetricParamsDictTagged:
    """
    Build parameters.
    
    Args:
        metric: the metric file.
        roi_metric: roi of vertices to use from left surface\
            \
            the ROI as a metric file.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "left-metric",
        "metric": metric,
    }
    if roi_metric is not None:
        params["roi-metric"] = roi_metric
    return params


def cifti_create_dense_scalar_left_metric_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `CiftiCreateDenseScalarLeftMetricParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("metric", None) is None:
        raise StyxValidationError("`metric` must not be None")
    if not isinstance(params["metric"], (pathlib.Path, str)):
        raise StyxValidationError(f'`metric` has the wrong type: Received `{type(params.get("metric", None))}` expected `InputPathType`')
    if params.get("roi-metric", None) is not None:
        if not isinstance(params["roi-metric"], (pathlib.Path, str)):
            raise StyxValidationError(f'`roi-metric` has the wrong type: Received `{type(params.get("roi-metric", None))}` expected `InputPathType | None`')


def cifti_create_dense_scalar_left_metric_cargs(
    params: CiftiCreateDenseScalarLeftMetricParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.extend([
        "-left-metric",
        execution.input_file(params.get("metric", None))
    ])
    if params.get("roi-metric", None) is not None:
        cargs.extend([
            "-roi-left",
            execution.input_file(params.get("roi-metric", None))
        ])
    return cargs


def cifti_create_dense_scalar_right_metric(
    metric: InputPathType,
    roi_metric: InputPathType | None = None,
) -> CiftiCreateDenseScalarRightMetricParamsDictTagged:
    """
    Build parameters.
    
    Args:
        metric: the metric file.
        roi_metric: roi of vertices to use from right surface\
            \
            the ROI as a metric file.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "right-metric",
        "metric": metric,
    }
    if roi_metric is not None:
        params["roi-metric"] = roi_metric
    return params


def cifti_create_dense_scalar_right_metric_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `CiftiCreateDenseScalarRightMetricParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("metric", None) is None:
        raise StyxValidationError("`metric` must not be None")
    if not isinstance(params["metric"], (pathlib.Path, str)):
        raise StyxValidationError(f'`metric` has the wrong type: Received `{type(params.get("metric", None))}` expected `InputPathType`')
    if params.get("roi-metric", None) is not None:
        if not isinstance(params["roi-metric"], (pathlib.Path, str)):
            raise StyxValidationError(f'`roi-metric` has the wrong type: Received `{type(params.get("roi-metric", None))}` expected `InputPathType | None`')


def cifti_create_dense_scalar_right_metric_cargs(
    params: CiftiCreateDenseScalarRightMetricParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.extend([
        "-right-metric",
        execution.input_file(params.get("metric", None))
    ])
    if params.get("roi-metric", None) is not None:
        cargs.extend([
            "-roi-right",
            execution.input_file(params.get("roi-metric", None))
        ])
    return cargs


def cifti_create_dense_scalar_cerebellum_metric(
    metric: InputPathType,
    roi_metric: InputPathType | None = None,
) -> CiftiCreateDenseScalarCerebellumMetricParamsDictTagged:
    """
    Build parameters.
    
    Args:
        metric: the metric file.
        roi_metric: roi of vertices to use from right surface\
            \
            the ROI as a metric file.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "cerebellum-metric",
        "metric": metric,
    }
    if roi_metric is not None:
        params["roi-metric"] = roi_metric
    return params


def cifti_create_dense_scalar_cerebellum_metric_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `CiftiCreateDenseScalarCerebellumMetricParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("metric", None) is None:
        raise StyxValidationError("`metric` must not be None")
    if not isinstance(params["metric"], (pathlib.Path, str)):
        raise StyxValidationError(f'`metric` has the wrong type: Received `{type(params.get("metric", None))}` expected `InputPathType`')
    if params.get("roi-metric", None) is not None:
        if not isinstance(params["roi-metric"], (pathlib.Path, str)):
            raise StyxValidationError(f'`roi-metric` has the wrong type: Received `{type(params.get("roi-metric", None))}` expected `InputPathType | None`')


def cifti_create_dense_scalar_cerebellum_metric_cargs(
    params: CiftiCreateDenseScalarCerebellumMetricParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.extend([
        "-cerebellum-metric",
        execution.input_file(params.get("metric", None))
    ])
    if params.get("roi-metric", None) is not None:
        cargs.extend([
            "-roi-cerebellum",
            execution.input_file(params.get("roi-metric", None))
        ])
    return cargs


def cifti_create_dense_scalar_metric(
    structure: str,
    metric: InputPathType,
    roi_metric: InputPathType | None = None,
) -> CiftiCreateDenseScalarMetricParamsDictTagged:
    """
    Build parameters.
    
    Args:
        structure: the structure name.
        metric: the metric file.
        roi_metric: roi of vertices to use from this structure\
            \
            the ROI as a metric file.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "metric",
        "structure": structure,
        "metric": metric,
    }
    if roi_metric is not None:
        params["roi-metric"] = roi_metric
    return params


def cifti_create_dense_scalar_metric_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `CiftiCreateDenseScalarMetricParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("structure", None) is None:
        raise StyxValidationError("`structure` must not be None")
    if not isinstance(params["structure"], str):
        raise StyxValidationError(f'`structure` has the wrong type: Received `{type(params.get("structure", None))}` expected `str`')
    if params.get("metric", None) is None:
        raise StyxValidationError("`metric` must not be None")
    if not isinstance(params["metric"], (pathlib.Path, str)):
        raise StyxValidationError(f'`metric` has the wrong type: Received `{type(params.get("metric", None))}` expected `InputPathType`')
    if params.get("roi-metric", None) is not None:
        if not isinstance(params["roi-metric"], (pathlib.Path, str)):
            raise StyxValidationError(f'`roi-metric` has the wrong type: Received `{type(params.get("roi-metric", None))}` expected `InputPathType | None`')


def cifti_create_dense_scalar_metric_cargs(
    params: CiftiCreateDenseScalarMetricParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.extend([
        "-metric",
        params.get("structure", None),
        execution.input_file(params.get("metric", None))
    ])
    if params.get("roi-metric", None) is not None:
        cargs.extend([
            "-roi",
            execution.input_file(params.get("roi-metric", None))
        ])
    return cargs


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


def cifti_create_dense_scalar_params(
    cifti_out: str,
    volume: CiftiCreateDenseScalarVolumeParamsDict | None = None,
    left_metric: CiftiCreateDenseScalarLeftMetricParamsDict | None = None,
    right_metric: CiftiCreateDenseScalarRightMetricParamsDict | None = None,
    cerebellum_metric: CiftiCreateDenseScalarCerebellumMetricParamsDict | None = None,
    metric: list[CiftiCreateDenseScalarMetricParamsDict] | None = None,
    file: str | None = None,
) -> CiftiCreateDenseScalarParamsDictTagged:
    """
    Build parameters.
    
    Args:
        cifti_out: the output cifti file.
        volume: volume component.
        left_metric: metric for the left cortical surface.
        right_metric: metric for the right cortical surface.
        cerebellum_metric: metric for the cerebellum.
        metric: metric for a specified surface structure.
        file: use a text file to set all map names\
            \
            text file containing map names, one per line.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "workbench/cifti-create-dense-scalar",
        "cifti-out": cifti_out,
    }
    if volume is not None:
        params["volume"] = volume
    if left_metric is not None:
        params["left-metric"] = left_metric
    if right_metric is not None:
        params["right-metric"] = right_metric
    if cerebellum_metric is not None:
        params["cerebellum-metric"] = cerebellum_metric
    if metric is not None:
        params["metric"] = metric
    if file is not None:
        params["file"] = file
    return params


def cifti_create_dense_scalar_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `CiftiCreateDenseScalarParamsDict` object.
    
    Args:
        params: The parameters object to validate.
    """
    if params is None or not isinstance(params, dict):
        raise StyxValidationError(f'Params object has the wrong type \'{type(params)}\'')
    if params.get("cifti-out", None) is None:
        raise StyxValidationError("`cifti-out` must not be None")
    if not isinstance(params["cifti-out"], str):
        raise StyxValidationError(f'`cifti-out` has the wrong type: Received `{type(params.get("cifti-out", None))}` expected `str`')
    if params.get("volume", None) is not None:
        cifti_create_dense_scalar_volume_validate(params["volume"])
    if params.get("left-metric", None) is not None:
        cifti_create_dense_scalar_left_metric_validate(params["left-metric"])
    if params.get("right-metric", None) is not None:
        cifti_create_dense_scalar_right_metric_validate(params["right-metric"])
    if params.get("cerebellum-metric", None) is not None:
        cifti_create_dense_scalar_cerebellum_metric_validate(params["cerebellum-metric"])
    if params.get("metric", None) is not None:
        if not isinstance(params["metric"], list):
            raise StyxValidationError(f'`metric` has the wrong type: Received `{type(params.get("metric", None))}` expected `list[CiftiCreateDenseScalarMetricParamsDict] | None`')
        for e in params["metric"]:
            cifti_create_dense_scalar_metric_validate(e)
    if params.get("file", None) is not None:
        if not isinstance(params["file"], str):
            raise StyxValidationError(f'`file` has the wrong type: Received `{type(params.get("file", None))}` expected `str | None`')


def cifti_create_dense_scalar_cargs(
    params: CiftiCreateDenseScalarParamsDict,
    execution: Execution,
) -> list[str]:
    """
    Build command-line arguments from parameters.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Command-line arguments.
    """
    cargs = []
    cargs.extend([
        "wb_command",
        "-cifti-create-dense-scalar"
    ])
    cargs.append(params.get("cifti-out", None))
    if params.get("volume", None) is not None or params.get("left-metric", None) is not None or params.get("right-metric", None) is not None or params.get("cerebellum-metric", None) is not None or params.get("metric", None) is not None:
        cargs.extend([
            *(cifti_create_dense_scalar_volume_cargs(params.get("volume", None), execution) if (params.get("volume", None) is not None) else []),
            *(cifti_create_dense_scalar_left_metric_cargs(params.get("left-metric", None), execution) if (params.get("left-metric", None) is not None) else []),
            *(cifti_create_dense_scalar_right_metric_cargs(params.get("right-metric", None), execution) if (params.get("right-metric", None) is not None) else []),
            *(cifti_create_dense_scalar_cerebellum_metric_cargs(params.get("cerebellum-metric", None), execution) if (params.get("cerebellum-metric", None) is not None) else []),
            *([a for c in [cifti_create_dense_scalar_metric_cargs(s, execution) for s in params.get("metric", None)] for a in c] if (params.get("metric", None) is not None) else [])
        ])
    if params.get("file", None) is not None:
        cargs.extend([
            "-name-file",
            params.get("file", None)
        ])
    return cargs


def cifti_create_dense_scalar_outputs(
    params: CiftiCreateDenseScalarParamsDict,
    execution: Execution,
) -> CiftiCreateDenseScalarOutputs:
    """
    Build outputs object containing output file paths and possibly stdout/stderr.
    
    Args:
        params: The parameters.
        execution: The execution object for resolving input paths.
    Returns:
        Outputs object.
    """
    ret = CiftiCreateDenseScalarOutputs(
        root=execution.output_file("."),
        cifti_out=execution.output_file(params.get("cifti-out", None)),
    )
    return ret


def cifti_create_dense_scalar_execute(
    params: CiftiCreateDenseScalarParamsDict,
    runner: Runner | None = None,
) -> CiftiCreateDenseScalarOutputs:
    """
    CREATE A CIFTI DENSE SCALAR FILE.
    
    All input files must have the same number of columns/subvolumes. Only the
    specified components will be in the output cifti file. Map names will be
    taken from one of the input files. At least one component must be specified.
    
    See -volume-label-import and -volume-help for format details of label volume
    files. The -metric structure argument and labels in the
    structure-label-volume must use names from the below list (labels with other
    names are ignored, -metric arguments with other strings are an error):
    
    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
    HIPPOCAMPUS_DENTATE_LEFT
    HIPPOCAMPUS_DENTATE_RIGHT
    INVALID
    OTHER
    OTHER_GREY_MATTER
    OTHER_WHITE_MATTER
    PALLIDUM_LEFT
    PALLIDUM_RIGHT
    PUTAMEN_LEFT
    PUTAMEN_RIGHT
    THALAMUS_LEFT
    THALAMUS_RIGHT.
    
    Args:
        params: The parameters.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `CiftiCreateDenseScalarOutputs`).
    """
    cifti_create_dense_scalar_validate(params)
    runner = runner or get_global_runner()
    execution = runner.start_execution(CIFTI_CREATE_DENSE_SCALAR_METADATA)
    params = execution.params(params)
    cargs = cifti_create_dense_scalar_cargs(params, execution)
    ret = cifti_create_dense_scalar_outputs(params, execution)
    execution.run(cargs)
    return ret


def cifti_create_dense_scalar(
    cifti_out: str,
    volume: CiftiCreateDenseScalarVolumeParamsDict | None = None,
    left_metric: CiftiCreateDenseScalarLeftMetricParamsDict | None = None,
    right_metric: CiftiCreateDenseScalarRightMetricParamsDict | None = None,
    cerebellum_metric: CiftiCreateDenseScalarCerebellumMetricParamsDict | None = None,
    metric: list[CiftiCreateDenseScalarMetricParamsDict] | None = None,
    file: str | None = None,
    runner: Runner | None = None,
) -> CiftiCreateDenseScalarOutputs:
    """
    CREATE A CIFTI DENSE SCALAR FILE.
    
    All input files must have the same number of columns/subvolumes. Only the
    specified components will be in the output cifti file. Map names will be
    taken from one of the input files. At least one component must be specified.
    
    See -volume-label-import and -volume-help for format details of label volume
    files. The -metric structure argument and labels in the
    structure-label-volume must use names from the below list (labels with other
    names are ignored, -metric arguments with other strings are an error):
    
    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
    HIPPOCAMPUS_DENTATE_LEFT
    HIPPOCAMPUS_DENTATE_RIGHT
    INVALID
    OTHER
    OTHER_GREY_MATTER
    OTHER_WHITE_MATTER
    PALLIDUM_LEFT
    PALLIDUM_RIGHT
    PUTAMEN_LEFT
    PUTAMEN_RIGHT
    THALAMUS_LEFT
    THALAMUS_RIGHT.
    
    Args:
        cifti_out: the output cifti file.
        volume: volume component.
        left_metric: metric for the left cortical surface.
        right_metric: metric for the right cortical surface.
        cerebellum_metric: metric for the cerebellum.
        metric: metric for a specified surface structure.
        file: use a text file to set all map names\
            \
            text file containing map names, one per line.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `CiftiCreateDenseScalarOutputs`).
    """
    params = cifti_create_dense_scalar_params(
        cifti_out=cifti_out,
        volume=volume,
        left_metric=left_metric,
        right_metric=right_metric,
        cerebellum_metric=cerebellum_metric,
        metric=metric,
        file=file,
    )
    return cifti_create_dense_scalar_execute(params, runner)


__all__ = [
    "CIFTI_CREATE_DENSE_SCALAR_METADATA",
    "CiftiCreateDenseScalarCerebellumMetricParamsDict",
    "CiftiCreateDenseScalarCerebellumMetricParamsDictTagged",
    "CiftiCreateDenseScalarLeftMetricParamsDict",
    "CiftiCreateDenseScalarLeftMetricParamsDictTagged",
    "CiftiCreateDenseScalarMetricParamsDict",
    "CiftiCreateDenseScalarMetricParamsDictTagged",
    "CiftiCreateDenseScalarOutputs",
    "CiftiCreateDenseScalarParamsDict",
    "CiftiCreateDenseScalarParamsDictTagged",
    "CiftiCreateDenseScalarRightMetricParamsDict",
    "CiftiCreateDenseScalarRightMetricParamsDictTagged",
    "CiftiCreateDenseScalarVolumeParamsDict",
    "CiftiCreateDenseScalarVolumeParamsDictTagged",
    "cifti_create_dense_scalar",
    "cifti_create_dense_scalar_cerebellum_metric",
    "cifti_create_dense_scalar_execute",
    "cifti_create_dense_scalar_left_metric",
    "cifti_create_dense_scalar_metric",
    "cifti_create_dense_scalar_params",
    "cifti_create_dense_scalar_right_metric",
    "cifti_create_dense_scalar_volume",
]
