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

import typing
import pathlib
from styxdefs import *
import dataclasses

VOLUME_VECTOR_OPERATION_METADATA = Metadata(
    id="659c860de35d61543458fd69cdcc014c15293fe8.boutiques",
    name="volume-vector-operation",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


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


def volume_vector_operation(
    vectors_a: InputPathType,
    vectors_b: InputPathType,
    operation: str,
    volume_out: str,
    opt_normalize_a: bool = False,
    opt_normalize_b: bool = False,
    opt_normalize_output: bool = False,
    opt_magnitude: bool = False,
    runner: Runner | None = None,
) -> VolumeVectorOperationOutputs:
    """
    Do a vector operation on volume files.
    
    Does a vector operation on two volume files (that must have a multiple of 3
    subvolumes). Either of the inputs may have multiple vectors (more than 3
    subvolumes), but not both (at least one must have exactly 3 subvolumes). The
    -magnitude and -normalize-output options may not be specified together, or
    with the DOT operation. The <operation> parameter must be one of the
    following:
    
    DOT
    CROSS
    ADD
    SUBTRACT.
    
    Author: Connectome Workbench Developers
    
    URL: https://github.com/Washington-University/workbench
    
    Args:
        vectors_a: first vector input file.
        vectors_b: second vector input file.
        operation: what vector operation to do.
        volume_out: the output file.
        opt_normalize_a: normalize vectors of first input.
        opt_normalize_b: normalize vectors of second input.
        opt_normalize_output: normalize output vectors (not valid for dot\
            product).
        opt_magnitude: output the magnitude of the result (not valid for dot\
            product).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VolumeVectorOperationOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(VOLUME_VECTOR_OPERATION_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-volume-vector-operation")
    cargs.append(execution.input_file(vectors_a))
    cargs.append(execution.input_file(vectors_b))
    cargs.append(operation)
    cargs.append(volume_out)
    if opt_normalize_a:
        cargs.append("-normalize-a")
    if opt_normalize_b:
        cargs.append("-normalize-b")
    if opt_normalize_output:
        cargs.append("-normalize-output")
    if opt_magnitude:
        cargs.append("-magnitude")
    ret = VolumeVectorOperationOutputs(
        root=execution.output_file("."),
        volume_out=execution.output_file(volume_out),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VOLUME_VECTOR_OPERATION_METADATA",
    "VolumeVectorOperationOutputs",
    "volume_vector_operation",
]
