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

import typing
import pathlib
from styxdefs import *

VOLUME_COPY_EXTENSIONS_METADATA = Metadata(
    id="1105ee211cb759964c59c0d9326f8fd29db4b9a2.boutiques",
    name="volume-copy-extensions",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


VolumeCopyExtensionsParameters = typing.TypedDict('VolumeCopyExtensionsParameters', {
    "@type": typing.NotRequired[typing.Literal["workbench/volume-copy-extensions"]],
    "data_volume": InputPathType,
    "extension_volume": InputPathType,
    "volume_out": str,
    "opt_drop_unknown": bool,
})
VolumeCopyExtensionsParametersTagged = typing.TypedDict('VolumeCopyExtensionsParametersTagged', {
    "@type": typing.Literal["workbench/volume-copy-extensions"],
    "data_volume": InputPathType,
    "extension_volume": InputPathType,
    "volume_out": str,
    "opt_drop_unknown": bool,
})


class VolumeCopyExtensionsOutputs(typing.NamedTuple):
    """
    Output object returned when calling `VolumeCopyExtensionsParameters(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    volume_out: OutputPathType
    """the output volume"""


def volume_copy_extensions_params(
    data_volume: InputPathType,
    extension_volume: InputPathType,
    volume_out: str,
    opt_drop_unknown: bool = False,
) -> VolumeCopyExtensionsParametersTagged:
    """
    Build parameters.
    
    Args:
        data_volume: the volume file containing the voxel data to use.
        extension_volume: the volume file containing the extensions to use.
        volume_out: the output volume.
        opt_drop_unknown: don't copy extensions that workbench doesn't\
            understand.
    Returns:
        Parameter dictionary
    """
    params = {
        "@type": "workbench/volume-copy-extensions",
        "data_volume": data_volume,
        "extension_volume": extension_volume,
        "volume_out": volume_out,
        "opt_drop_unknown": opt_drop_unknown,
    }
    return params


def volume_copy_extensions_cargs(
    params: VolumeCopyExtensionsParameters,
    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.append("wb_command")
    cargs.append("-volume-copy-extensions")
    cargs.append(execution.input_file(params.get("data_volume", None)))
    cargs.append(execution.input_file(params.get("extension_volume", None)))
    cargs.append(params.get("volume_out", None))
    if params.get("opt_drop_unknown", False):
        cargs.append("-drop-unknown")
    return cargs


def volume_copy_extensions_outputs(
    params: VolumeCopyExtensionsParameters,
    execution: Execution,
) -> VolumeCopyExtensionsOutputs:
    """
    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 = VolumeCopyExtensionsOutputs(
        root=execution.output_file("."),
        volume_out=execution.output_file(params.get("volume_out", None)),
    )
    return ret


def volume_copy_extensions_execute(
    params: VolumeCopyExtensionsParameters,
    runner: Runner | None = None,
) -> VolumeCopyExtensionsOutputs:
    """
    volume-copy-extensions
    
    Copy extended data to another volume file.
    
    This command copies the information in a volume file that isn't a critical
    part of the standard header or data matrix, e.g. map names, palette
    settings, label tables. If -drop-unknown is not specified, it also copies
    similar kinds of information set by other software.
    
    Author: Connectome Workbench Developers
    
    URL: https://github.com/Washington-University/workbench
    
    Args:
        params: The parameters.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VolumeCopyExtensionsOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(VOLUME_COPY_EXTENSIONS_METADATA)
    params = execution.params(params)
    cargs = volume_copy_extensions_cargs(params, execution)
    ret = volume_copy_extensions_outputs(params, execution)
    execution.run(cargs)
    return ret


def volume_copy_extensions(
    data_volume: InputPathType,
    extension_volume: InputPathType,
    volume_out: str,
    opt_drop_unknown: bool = False,
    runner: Runner | None = None,
) -> VolumeCopyExtensionsOutputs:
    """
    volume-copy-extensions
    
    Copy extended data to another volume file.
    
    This command copies the information in a volume file that isn't a critical
    part of the standard header or data matrix, e.g. map names, palette
    settings, label tables. If -drop-unknown is not specified, it also copies
    similar kinds of information set by other software.
    
    Author: Connectome Workbench Developers
    
    URL: https://github.com/Washington-University/workbench
    
    Args:
        data_volume: the volume file containing the voxel data to use.
        extension_volume: the volume file containing the extensions to use.
        volume_out: the output volume.
        opt_drop_unknown: don't copy extensions that workbench doesn't\
            understand.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VolumeCopyExtensionsOutputs`).
    """
    params = volume_copy_extensions_params(
        data_volume=data_volume,
        extension_volume=extension_volume,
        volume_out=volume_out,
        opt_drop_unknown=opt_drop_unknown,
    )
    return volume_copy_extensions_execute(params, runner)


__all__ = [
    "VOLUME_COPY_EXTENSIONS_METADATA",
    "VolumeCopyExtensionsOutputs",
    "volume_copy_extensions",
    "volume_copy_extensions_execute",
    "volume_copy_extensions_params",
]
