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

import typing
import pathlib
from styxdefs import *

VOLUME_PALETTE_METADATA = Metadata(
    id="e4d48e09652e2a3420ac6c01dde2735f59b8d4ba.workbench",
    name="volume-palette",
    package="workbench",
    container_image_tag="nx10x/workbench:2.1.0",
)


_VolumePalettePosPercentParamsDictNoTag = typing.TypedDict('_VolumePalettePosPercentParamsDictNoTag', {
    "pos-min-%": float,
    "pos-max-%": float,
})
VolumePalettePosPercentParamsDictTagged = typing.TypedDict('VolumePalettePosPercentParamsDictTagged', {
    "@type": typing.Literal["pos-percent"],
    "pos-min-%": float,
    "pos-max-%": float,
})
VolumePalettePosPercentParamsDict = _VolumePalettePosPercentParamsDictNoTag | VolumePalettePosPercentParamsDictTagged


_VolumePaletteNegPercentParamsDictNoTag = typing.TypedDict('_VolumePaletteNegPercentParamsDictNoTag', {
    "neg-min-%": float,
    "neg-max-%": float,
})
VolumePaletteNegPercentParamsDictTagged = typing.TypedDict('VolumePaletteNegPercentParamsDictTagged', {
    "@type": typing.Literal["neg-percent"],
    "neg-min-%": float,
    "neg-max-%": float,
})
VolumePaletteNegPercentParamsDict = _VolumePaletteNegPercentParamsDictNoTag | VolumePaletteNegPercentParamsDictTagged


_VolumePalettePosUserParamsDictNoTag = typing.TypedDict('_VolumePalettePosUserParamsDictNoTag', {
    "pos-min-user": float,
    "pos-max-user": float,
})
VolumePalettePosUserParamsDictTagged = typing.TypedDict('VolumePalettePosUserParamsDictTagged', {
    "@type": typing.Literal["pos-user"],
    "pos-min-user": float,
    "pos-max-user": float,
})
VolumePalettePosUserParamsDict = _VolumePalettePosUserParamsDictNoTag | VolumePalettePosUserParamsDictTagged


_VolumePaletteNegUserParamsDictNoTag = typing.TypedDict('_VolumePaletteNegUserParamsDictNoTag', {
    "neg-min-user": float,
    "neg-max-user": float,
})
VolumePaletteNegUserParamsDictTagged = typing.TypedDict('VolumePaletteNegUserParamsDictTagged', {
    "@type": typing.Literal["neg-user"],
    "neg-min-user": float,
    "neg-max-user": float,
})
VolumePaletteNegUserParamsDict = _VolumePaletteNegUserParamsDictNoTag | VolumePaletteNegUserParamsDictTagged


_VolumePaletteThresholdingParamsDictNoTag = typing.TypedDict('_VolumePaletteThresholdingParamsDictNoTag', {
    "type": str,
    "test": str,
    "min": float,
    "max": float,
})
VolumePaletteThresholdingParamsDictTagged = typing.TypedDict('VolumePaletteThresholdingParamsDictTagged', {
    "@type": typing.Literal["thresholding"],
    "type": str,
    "test": str,
    "min": float,
    "max": float,
})
VolumePaletteThresholdingParamsDict = _VolumePaletteThresholdingParamsDictNoTag | VolumePaletteThresholdingParamsDictTagged


_VolumePaletteParamsDictNoTag = typing.TypedDict('_VolumePaletteParamsDictNoTag', {
    "volume": str,
    "mode": str,
    "pos-percent": typing.NotRequired[VolumePalettePosPercentParamsDict | None],
    "neg-percent": typing.NotRequired[VolumePaletteNegPercentParamsDict | None],
    "pos-user": typing.NotRequired[VolumePalettePosUserParamsDict | None],
    "neg-user": typing.NotRequired[VolumePaletteNegUserParamsDict | None],
    "thresholding": typing.NotRequired[VolumePaletteThresholdingParamsDict | None],
    "type": typing.NotRequired[str | None],
    "type": typing.NotRequired[str | None],
    "name": typing.NotRequired[str | None],
    "display": typing.NotRequired[bool | None],
    "display": typing.NotRequired[bool | None],
    "display": typing.NotRequired[bool | None],
    "interpolate": typing.NotRequired[bool | None],
    "subvolume": typing.NotRequired[str | None],
})
VolumePaletteParamsDictTagged = typing.TypedDict('VolumePaletteParamsDictTagged', {
    "@type": typing.Literal["workbench/volume-palette"],
    "volume": str,
    "mode": str,
    "pos-percent": typing.NotRequired[VolumePalettePosPercentParamsDict | None],
    "neg-percent": typing.NotRequired[VolumePaletteNegPercentParamsDict | None],
    "pos-user": typing.NotRequired[VolumePalettePosUserParamsDict | None],
    "neg-user": typing.NotRequired[VolumePaletteNegUserParamsDict | None],
    "thresholding": typing.NotRequired[VolumePaletteThresholdingParamsDict | None],
    "type": typing.NotRequired[str | None],
    "type": typing.NotRequired[str | None],
    "name": typing.NotRequired[str | None],
    "display": typing.NotRequired[bool | None],
    "display": typing.NotRequired[bool | None],
    "display": typing.NotRequired[bool | None],
    "interpolate": typing.NotRequired[bool | None],
    "subvolume": typing.NotRequired[str | None],
})
VolumePaletteParamsDict = _VolumePaletteParamsDictNoTag | VolumePaletteParamsDictTagged


def volume_palette_pos_percent(
    pos_min__: float,
    pos_max__: float,
) -> VolumePalettePosPercentParamsDictTagged:
    """
    Build parameters.
    
    Args:
        pos_min__: the percentile for the least positive data.
        pos_max__: the percentile for the most positive data.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "pos-percent",
        "pos-min-%": pos_min__,
        "pos-max-%": pos_max__,
    }
    return params


def volume_palette_pos_percent_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `VolumePalettePosPercentParamsDict` 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("pos-min-%", None) is None:
        raise StyxValidationError("`pos-min-%` must not be None")
    if not isinstance(params["pos-min-%"], (float, int)):
        raise StyxValidationError(f'`pos-min-%` has the wrong type: Received `{type(params.get("pos-min-%", None))}` expected `float`')
    if params.get("pos-max-%", None) is None:
        raise StyxValidationError("`pos-max-%` must not be None")
    if not isinstance(params["pos-max-%"], (float, int)):
        raise StyxValidationError(f'`pos-max-%` has the wrong type: Received `{type(params.get("pos-max-%", None))}` expected `float`')


def volume_palette_pos_percent_cargs(
    params: VolumePalettePosPercentParamsDict,
    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([
        "-pos-percent",
        str(params.get("pos-min-%", None)),
        str(params.get("pos-max-%", None))
    ])
    return cargs


def volume_palette_neg_percent(
    neg_min__: float,
    neg_max__: float,
) -> VolumePaletteNegPercentParamsDictTagged:
    """
    Build parameters.
    
    Args:
        neg_min__: the percentile for the least negative data.
        neg_max__: the percentile for the most negative data.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "neg-percent",
        "neg-min-%": neg_min__,
        "neg-max-%": neg_max__,
    }
    return params


def volume_palette_neg_percent_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `VolumePaletteNegPercentParamsDict` 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("neg-min-%", None) is None:
        raise StyxValidationError("`neg-min-%` must not be None")
    if not isinstance(params["neg-min-%"], (float, int)):
        raise StyxValidationError(f'`neg-min-%` has the wrong type: Received `{type(params.get("neg-min-%", None))}` expected `float`')
    if params.get("neg-max-%", None) is None:
        raise StyxValidationError("`neg-max-%` must not be None")
    if not isinstance(params["neg-max-%"], (float, int)):
        raise StyxValidationError(f'`neg-max-%` has the wrong type: Received `{type(params.get("neg-max-%", None))}` expected `float`')


def volume_palette_neg_percent_cargs(
    params: VolumePaletteNegPercentParamsDict,
    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([
        "-neg-percent",
        str(params.get("neg-min-%", None)),
        str(params.get("neg-max-%", None))
    ])
    return cargs


def volume_palette_pos_user(
    pos_min_user: float,
    pos_max_user: float,
) -> VolumePalettePosUserParamsDictTagged:
    """
    Build parameters.
    
    Args:
        pos_min_user: the value for the least positive data.
        pos_max_user: the value for the most positive data.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "pos-user",
        "pos-min-user": pos_min_user,
        "pos-max-user": pos_max_user,
    }
    return params


def volume_palette_pos_user_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `VolumePalettePosUserParamsDict` 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("pos-min-user", None) is None:
        raise StyxValidationError("`pos-min-user` must not be None")
    if not isinstance(params["pos-min-user"], (float, int)):
        raise StyxValidationError(f'`pos-min-user` has the wrong type: Received `{type(params.get("pos-min-user", None))}` expected `float`')
    if params.get("pos-max-user", None) is None:
        raise StyxValidationError("`pos-max-user` must not be None")
    if not isinstance(params["pos-max-user"], (float, int)):
        raise StyxValidationError(f'`pos-max-user` has the wrong type: Received `{type(params.get("pos-max-user", None))}` expected `float`')


def volume_palette_pos_user_cargs(
    params: VolumePalettePosUserParamsDict,
    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([
        "-pos-user",
        str(params.get("pos-min-user", None)),
        str(params.get("pos-max-user", None))
    ])
    return cargs


def volume_palette_neg_user(
    neg_min_user: float,
    neg_max_user: float,
) -> VolumePaletteNegUserParamsDictTagged:
    """
    Build parameters.
    
    Args:
        neg_min_user: the value for the least negative data.
        neg_max_user: the value for the most negative data.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "neg-user",
        "neg-min-user": neg_min_user,
        "neg-max-user": neg_max_user,
    }
    return params


def volume_palette_neg_user_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `VolumePaletteNegUserParamsDict` 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("neg-min-user", None) is None:
        raise StyxValidationError("`neg-min-user` must not be None")
    if not isinstance(params["neg-min-user"], (float, int)):
        raise StyxValidationError(f'`neg-min-user` has the wrong type: Received `{type(params.get("neg-min-user", None))}` expected `float`')
    if params.get("neg-max-user", None) is None:
        raise StyxValidationError("`neg-max-user` must not be None")
    if not isinstance(params["neg-max-user"], (float, int)):
        raise StyxValidationError(f'`neg-max-user` has the wrong type: Received `{type(params.get("neg-max-user", None))}` expected `float`')


def volume_palette_neg_user_cargs(
    params: VolumePaletteNegUserParamsDict,
    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([
        "-neg-user",
        str(params.get("neg-min-user", None)),
        str(params.get("neg-max-user", None))
    ])
    return cargs


def volume_palette_thresholding(
    type_: str,
    test: str,
    min_: float,
    max_: float,
) -> VolumePaletteThresholdingParamsDictTagged:
    """
    Build parameters.
    
    Args:
        type_: thresholding setting.
        test: show values inside or outside thresholds.
        min_: lower threshold.
        max_: upper threshold.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "thresholding",
        "type": type_,
        "test": test,
        "min": min_,
        "max": max_,
    }
    return params


def volume_palette_thresholding_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `VolumePaletteThresholdingParamsDict` 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("type", None) is None:
        raise StyxValidationError("`type` must not be None")
    if not isinstance(params["type"], str):
        raise StyxValidationError(f'`type` has the wrong type: Received `{type(params.get("type", None))}` expected `str`')
    if params.get("test", None) is None:
        raise StyxValidationError("`test` must not be None")
    if not isinstance(params["test"], str):
        raise StyxValidationError(f'`test` has the wrong type: Received `{type(params.get("test", None))}` expected `str`')
    if params.get("min", None) is None:
        raise StyxValidationError("`min` must not be None")
    if not isinstance(params["min"], (float, int)):
        raise StyxValidationError(f'`min` has the wrong type: Received `{type(params.get("min", None))}` expected `float`')
    if params.get("max", None) is None:
        raise StyxValidationError("`max` must not be None")
    if not isinstance(params["max"], (float, int)):
        raise StyxValidationError(f'`max` has the wrong type: Received `{type(params.get("max", None))}` expected `float`')


def volume_palette_thresholding_cargs(
    params: VolumePaletteThresholdingParamsDict,
    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([
        "-thresholding",
        params.get("type", None),
        params.get("test", None),
        str(params.get("min", None)),
        str(params.get("max", None))
    ])
    return cargs


class VolumePaletteOutputs(typing.NamedTuple):
    """
    Output object returned when calling `VolumePaletteParamsDict(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def volume_palette_params(
    volume: str,
    mode: str,
    pos_percent: VolumePalettePosPercentParamsDict | None = None,
    neg_percent: VolumePaletteNegPercentParamsDict | None = None,
    pos_user: VolumePalettePosUserParamsDict | None = None,
    neg_user: VolumePaletteNegUserParamsDict | None = None,
    thresholding: VolumePaletteThresholdingParamsDict | None = None,
    type_: str | None = None,
    type_2: str | None = None,
    name: str | None = None,
    display: bool | None = None,
    display_: bool | None = None,
    display_2: bool | None = None,
    interpolate: bool | None = None,
    subvolume: str | None = None,
) -> VolumePaletteParamsDictTagged:
    """
    Build parameters.
    
    Args:
        volume: the volume file to modify.
        mode: the mapping mode.
        pos_percent: percentage min/max for positive data coloring.
        neg_percent: percentage min/max for negative data coloring.
        pos_user: user min/max values for positive data coloring.
        neg_user: user min/max values for negative data coloring.
        thresholding: set the thresholding.
        type_: specify normalization mode (NOTE: this is always a file-wide\
            setting, NOT per-map)\
            \
            the normalization mode.
        type_2: specify palette inversion\
            \
            the type of inversion.
        name: set the palette used\
            \
            the name of the palette.
        display: display data closer to zero than the min cutoff\
            \
            boolean, whether to display.
        display_: display positive data\
            \
            boolean, whether to display.
        display_2: display positive data\
            \
            boolean, whether to display.
        interpolate: interpolate colors\
            \
            boolean, whether to interpolate.
        subvolume: select a single subvolume\
            \
            the subvolume number or name.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "workbench/volume-palette",
        "volume": volume,
        "mode": mode,
    }
    if pos_percent is not None:
        params["pos-percent"] = pos_percent
    if neg_percent is not None:
        params["neg-percent"] = neg_percent
    if pos_user is not None:
        params["pos-user"] = pos_user
    if neg_user is not None:
        params["neg-user"] = neg_user
    if thresholding is not None:
        params["thresholding"] = thresholding
    if type_ is not None:
        params["type"] = type_
    if type_2 is not None:
        params["type"] = type_2
    if name is not None:
        params["name"] = name
    if display is not None:
        params["display"] = display
    if display_ is not None:
        params["display"] = display_
    if display_2 is not None:
        params["display"] = display_2
    if interpolate is not None:
        params["interpolate"] = interpolate
    if subvolume is not None:
        params["subvolume"] = subvolume
    return params


def volume_palette_validate(
    params: typing.Any,
) -> None:
    """
    Validate parameters. Throws an error if `params` is not a valid
    `VolumePaletteParamsDict` 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", None) is None:
        raise StyxValidationError("`volume` must not be None")
    if not isinstance(params["volume"], str):
        raise StyxValidationError(f'`volume` has the wrong type: Received `{type(params.get("volume", None))}` expected `str`')
    if params.get("mode", None) is None:
        raise StyxValidationError("`mode` must not be None")
    if not isinstance(params["mode"], str):
        raise StyxValidationError(f'`mode` has the wrong type: Received `{type(params.get("mode", None))}` expected `str`')
    if params.get("pos-percent", None) is not None:
        volume_palette_pos_percent_validate(params["pos-percent"])
    if params.get("neg-percent", None) is not None:
        volume_palette_neg_percent_validate(params["neg-percent"])
    if params.get("pos-user", None) is not None:
        volume_palette_pos_user_validate(params["pos-user"])
    if params.get("neg-user", None) is not None:
        volume_palette_neg_user_validate(params["neg-user"])
    if params.get("thresholding", None) is not None:
        volume_palette_thresholding_validate(params["thresholding"])
    if params.get("type", None) is not None:
        if not isinstance(params["type"], str):
            raise StyxValidationError(f'`type` has the wrong type: Received `{type(params.get("type", None))}` expected `str | None`')
    if params.get("type", None) is not None:
        if not isinstance(params["type"], str):
            raise StyxValidationError(f'`type` has the wrong type: Received `{type(params.get("type", None))}` expected `str | None`')
    if params.get("name", None) is not None:
        if not isinstance(params["name"], str):
            raise StyxValidationError(f'`name` has the wrong type: Received `{type(params.get("name", None))}` expected `str | None`')
    if params.get("display", None) is not None:
        if not isinstance(params["display"], bool):
            raise StyxValidationError(f'`display` has the wrong type: Received `{type(params.get("display", None))}` expected `bool | None`')
    if params.get("display", None) is not None:
        if not isinstance(params["display"], bool):
            raise StyxValidationError(f'`display` has the wrong type: Received `{type(params.get("display", None))}` expected `bool | None`')
    if params.get("display", None) is not None:
        if not isinstance(params["display"], bool):
            raise StyxValidationError(f'`display` has the wrong type: Received `{type(params.get("display", None))}` expected `bool | None`')
    if params.get("interpolate", None) is not None:
        if not isinstance(params["interpolate"], bool):
            raise StyxValidationError(f'`interpolate` has the wrong type: Received `{type(params.get("interpolate", None))}` expected `bool | None`')
    if params.get("subvolume", None) is not None:
        if not isinstance(params["subvolume"], str):
            raise StyxValidationError(f'`subvolume` has the wrong type: Received `{type(params.get("subvolume", None))}` expected `str | None`')


def volume_palette_cargs(
    params: VolumePaletteParamsDict,
    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",
        "-volume-palette"
    ])
    cargs.append(params.get("volume", None))
    cargs.append(params.get("mode", None))
    if params.get("pos-percent", None) is not None or params.get("neg-percent", None) is not None or params.get("pos-user", None) is not None or params.get("neg-user", None) is not None or params.get("thresholding", None) is not None:
        cargs.extend([
            *(volume_palette_pos_percent_cargs(params.get("pos-percent", None), execution) if (params.get("pos-percent", None) is not None) else []),
            *(volume_palette_neg_percent_cargs(params.get("neg-percent", None), execution) if (params.get("neg-percent", None) is not None) else []),
            *(volume_palette_pos_user_cargs(params.get("pos-user", None), execution) if (params.get("pos-user", None) is not None) else []),
            *(volume_palette_neg_user_cargs(params.get("neg-user", None), execution) if (params.get("neg-user", None) is not None) else []),
            *(volume_palette_thresholding_cargs(params.get("thresholding", None), execution) if (params.get("thresholding", None) is not None) else [])
        ])
    if params.get("type", None) is not None:
        cargs.extend([
            "-normalization",
            params.get("type", None)
        ])
    if params.get("type", None) is not None:
        cargs.extend([
            "-inversion",
            params.get("type", None)
        ])
    if params.get("name", None) is not None:
        cargs.extend([
            "-palette-name",
            params.get("name", None)
        ])
    if params.get("display", None) is not None:
        cargs.extend([
            "-disp-zero",
            ("true" if params.get("display", None) else "false")
        ])
    if params.get("display", None) is not None:
        cargs.extend([
            "-disp-neg",
            ("true" if params.get("display", None) else "false")
        ])
    if params.get("display", None) is not None:
        cargs.extend([
            "-disp-pos",
            ("true" if params.get("display", None) else "false")
        ])
    if params.get("interpolate", None) is not None:
        cargs.extend([
            "-interpolate",
            ("true" if params.get("interpolate", None) else "false")
        ])
    if params.get("subvolume", None) is not None:
        cargs.extend([
            "-subvolume",
            params.get("subvolume", None)
        ])
    return cargs


def volume_palette_outputs(
    params: VolumePaletteParamsDict,
    execution: Execution,
) -> VolumePaletteOutputs:
    """
    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 = VolumePaletteOutputs(
        root=execution.output_file("."),
    )
    return ret


def volume_palette_execute(
    params: VolumePaletteParamsDict,
    runner: Runner | None = None,
) -> VolumePaletteOutputs:
    """
    SET THE PALETTE OF A VOLUME FILE.
    
    The original volume file is overwritten with the modified version. By
    default, all columns of the volume file are adjusted to the new settings,
    use the -subvolume option to change only one subvolume. Mapping settings not
    specified in options will be taken from the first subvolume. The <mode>
    argument must be one of the following:
    
    MODE_AUTO_SCALE
    MODE_AUTO_SCALE_ABSOLUTE_PERCENTAGE
    MODE_AUTO_SCALE_PERCENTAGE
    MODE_USER_SCALE
    
    The <name> argument to -palette-name must be one of the following:
    
    ROY-BIG-BL
    videen_style
    Gray_Interp_Positive
    Gray_Interp
    PSYCH-FIXED
    RBGYR20
    RBGYR20P
    RYGBR4_positive
    RGRBR_mirror90_pos
    Orange-Yellow
    POS_NEG_ZERO
    red-yellow
    blue-lightblue
    FSL
    power_surf
    black-red
    black-green
    black-blue
    black-red-positive
    black-green-positive
    black-blue-positive
    blue-black-green
    blue-black-red
    red-black-green
    fsl_red
    fsl_green
    fsl_blue
    fsl_yellow
    RedWhiteBlue
    cool-warm
    spectral
    RY-BC-BL
    magma
    JET256
    PSYCH
    PSYCH-NO-NONE
    ROY-BIG
    clear_brain
    fidl
    raich4_clrmid
    raich6_clrmid
    HSB8_clrmid
    POS_NEG
    Special-RGB-Volume
    
    The <type> argument to -thresholding must be one of the following:
    
    THRESHOLD_TYPE_OFF
    THRESHOLD_TYPE_NORMAL
    THRESHOLD_TYPE_FILE
    
    The <test> argument to -thresholding must be one of the following:
    
    THRESHOLD_TEST_SHOW_OUTSIDE
    THRESHOLD_TEST_SHOW_INSIDE
    
    The <type> argument to -inversion must be one of the following:
    
    OFF
    POSITIVE_WITH_NEGATIVE
    POSITIVE_NEGATIVE_SEPARATE
    
    The <type> argument to -normalization must be one of the following:
    
    NORMALIZATION_ALL_MAP_DATA
    NORMALIZATION_SELECTED_MAP_DATA
    .
    
    Args:
        params: The parameters.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VolumePaletteOutputs`).
    """
    volume_palette_validate(params)
    runner = runner or get_global_runner()
    execution = runner.start_execution(VOLUME_PALETTE_METADATA)
    params = execution.params(params)
    cargs = volume_palette_cargs(params, execution)
    ret = volume_palette_outputs(params, execution)
    execution.run(cargs)
    return ret


def volume_palette(
    volume: str,
    mode: str,
    pos_percent: VolumePalettePosPercentParamsDict | None = None,
    neg_percent: VolumePaletteNegPercentParamsDict | None = None,
    pos_user: VolumePalettePosUserParamsDict | None = None,
    neg_user: VolumePaletteNegUserParamsDict | None = None,
    thresholding: VolumePaletteThresholdingParamsDict | None = None,
    type_: str | None = None,
    type_2: str | None = None,
    name: str | None = None,
    display: bool | None = None,
    display_: bool | None = None,
    display_2: bool | None = None,
    interpolate: bool | None = None,
    subvolume: str | None = None,
    runner: Runner | None = None,
) -> VolumePaletteOutputs:
    """
    SET THE PALETTE OF A VOLUME FILE.
    
    The original volume file is overwritten with the modified version. By
    default, all columns of the volume file are adjusted to the new settings,
    use the -subvolume option to change only one subvolume. Mapping settings not
    specified in options will be taken from the first subvolume. The <mode>
    argument must be one of the following:
    
    MODE_AUTO_SCALE
    MODE_AUTO_SCALE_ABSOLUTE_PERCENTAGE
    MODE_AUTO_SCALE_PERCENTAGE
    MODE_USER_SCALE
    
    The <name> argument to -palette-name must be one of the following:
    
    ROY-BIG-BL
    videen_style
    Gray_Interp_Positive
    Gray_Interp
    PSYCH-FIXED
    RBGYR20
    RBGYR20P
    RYGBR4_positive
    RGRBR_mirror90_pos
    Orange-Yellow
    POS_NEG_ZERO
    red-yellow
    blue-lightblue
    FSL
    power_surf
    black-red
    black-green
    black-blue
    black-red-positive
    black-green-positive
    black-blue-positive
    blue-black-green
    blue-black-red
    red-black-green
    fsl_red
    fsl_green
    fsl_blue
    fsl_yellow
    RedWhiteBlue
    cool-warm
    spectral
    RY-BC-BL
    magma
    JET256
    PSYCH
    PSYCH-NO-NONE
    ROY-BIG
    clear_brain
    fidl
    raich4_clrmid
    raich6_clrmid
    HSB8_clrmid
    POS_NEG
    Special-RGB-Volume
    
    The <type> argument to -thresholding must be one of the following:
    
    THRESHOLD_TYPE_OFF
    THRESHOLD_TYPE_NORMAL
    THRESHOLD_TYPE_FILE
    
    The <test> argument to -thresholding must be one of the following:
    
    THRESHOLD_TEST_SHOW_OUTSIDE
    THRESHOLD_TEST_SHOW_INSIDE
    
    The <type> argument to -inversion must be one of the following:
    
    OFF
    POSITIVE_WITH_NEGATIVE
    POSITIVE_NEGATIVE_SEPARATE
    
    The <type> argument to -normalization must be one of the following:
    
    NORMALIZATION_ALL_MAP_DATA
    NORMALIZATION_SELECTED_MAP_DATA
    .
    
    Args:
        volume: the volume file to modify.
        mode: the mapping mode.
        pos_percent: percentage min/max for positive data coloring.
        neg_percent: percentage min/max for negative data coloring.
        pos_user: user min/max values for positive data coloring.
        neg_user: user min/max values for negative data coloring.
        thresholding: set the thresholding.
        type_: specify normalization mode (NOTE: this is always a file-wide\
            setting, NOT per-map)\
            \
            the normalization mode.
        type_2: specify palette inversion\
            \
            the type of inversion.
        name: set the palette used\
            \
            the name of the palette.
        display: display data closer to zero than the min cutoff\
            \
            boolean, whether to display.
        display_: display positive data\
            \
            boolean, whether to display.
        display_2: display positive data\
            \
            boolean, whether to display.
        interpolate: interpolate colors\
            \
            boolean, whether to interpolate.
        subvolume: select a single subvolume\
            \
            the subvolume number or name.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VolumePaletteOutputs`).
    """
    params = volume_palette_params(
        volume=volume,
        mode=mode,
        pos_percent=pos_percent,
        neg_percent=neg_percent,
        pos_user=pos_user,
        neg_user=neg_user,
        thresholding=thresholding,
        type_=type_,
        type_2=type_2,
        name=name,
        display=display,
        display_=display_,
        display_2=display_2,
        interpolate=interpolate,
        subvolume=subvolume,
    )
    return volume_palette_execute(params, runner)


__all__ = [
    "VOLUME_PALETTE_METADATA",
    "VolumePaletteNegPercentParamsDict",
    "VolumePaletteNegPercentParamsDictTagged",
    "VolumePaletteNegUserParamsDict",
    "VolumePaletteNegUserParamsDictTagged",
    "VolumePaletteOutputs",
    "VolumePaletteParamsDict",
    "VolumePaletteParamsDictTagged",
    "VolumePalettePosPercentParamsDict",
    "VolumePalettePosPercentParamsDictTagged",
    "VolumePalettePosUserParamsDict",
    "VolumePalettePosUserParamsDictTagged",
    "VolumePaletteThresholdingParamsDict",
    "VolumePaletteThresholdingParamsDictTagged",
    "volume_palette",
    "volume_palette_execute",
    "volume_palette_neg_percent",
    "volume_palette_neg_user",
    "volume_palette_params",
    "volume_palette_pos_percent",
    "volume_palette_pos_user",
    "volume_palette_thresholding",
]
