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

import typing
import pathlib
from styxdefs import *
import dataclasses

VOLUME_REORIENT_METADATA = Metadata(
    id="1afac12c05724e2c743ea9a8c888ea025d603263.boutiques",
    name="volume-reorient",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


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


def volume_reorient(
    volume: InputPathType,
    orient_string: str,
    volume_out: str,
    runner: Runner | None = None,
) -> VolumeReorientOutputs:
    """
    Change voxel order of a volume file.
    
    Changes the voxel order and the header spacing/origin information such that
    the value of any spatial point is unchanged. Orientation strings look like
    'LPI', which means first index is left to right, second is posterior to
    anterior, and third is inferior to superior. The valid characters are:
    
    L left to right
    R right to left
    P posterior to anterior
    A anterior to posterior
    I inferior to superior
    S superior to inferior.
    
    Author: Washington University School of Medicin
    
    Args:
        volume: the volume to reorient.
        orient_string: the desired orientation.
        volume_out: out - the reoriented volume.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VolumeReorientOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(VOLUME_REORIENT_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-volume-reorient")
    cargs.append(execution.input_file(volume))
    cargs.append(orient_string)
    cargs.append(volume_out)
    ret = VolumeReorientOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VOLUME_REORIENT_METADATA",
    "VolumeReorientOutputs",
    "volume_reorient",
]
