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

import typing
import pathlib
from styxdefs import *
import dataclasses

FSLSWAPDIM_FSL_METADATA = Metadata(
    id="7302b08bc4d86f9914f7a8203cbaf36cc9515b0c.boutiques",
    name="fslswapdim.fsl",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class FslswapdimFslOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fslswapdim_fsl(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_image: OutputPathType | None
    """Output image with swapped dimensions"""


def fslswapdim_fsl(
    input_file: InputPathType,
    axis_a: str,
    axis_b: str,
    axis_c: str,
    output_file: str | None = None,
    runner: Runner | None = None,
) -> FslswapdimFslOutputs:
    """
    FSLSwapdim allows swapping and flipping of dimensions of an image.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_file: Input image file.
        axis_a: New X-axis in terms of the old axes; can be one of -x, x, y,\
            -y, z, -z or RL, LR, AP, PA, SI, IS.
        axis_b: New Y-axis in terms of the old axes; can be one of -x, x, y,\
            -y, z, -z or RL, LR, AP, PA, SI, IS.
        axis_c: New Z-axis in terms of the old axes; can be one of -x, x, y,\
            -y, z, -z or RL, LR, AP, PA, SI, IS.
        output_file: Output image file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FslswapdimFslOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FSLSWAPDIM_FSL_METADATA)
    cargs = []
    cargs.append("fslswapdim")
    cargs.append(execution.input_file(input_file))
    cargs.append(axis_a)
    cargs.append(axis_b)
    cargs.append(axis_c)
    if output_file is not None:
        cargs.append(output_file)
    ret = FslswapdimFslOutputs(
        root=execution.output_file("."),
        output_image=execution.output_file(output_file) if (output_file is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FSLSWAPDIM_FSL_METADATA",
    "FslswapdimFslOutputs",
    "fslswapdim_fsl",
]
