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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3DAXIALIZE_METADATA = Metadata(
    id="4a31bcf01d5f3abdd670e6d35ef8f5e3b5aec53c.boutiques",
    name="3daxialize",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3daxializeOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3daxialize(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    outfile: OutputPathType | None
    """Output dataset with axial slices orientation"""


def v_3daxialize(
    infile: InputPathType,
    prefix: str | None = None,
    verb: bool = False,
    sagittal: bool = False,
    coronal: bool = False,
    axial: bool = False,
    orient_code: str | None = None,
    frugal: bool = False,
    runner: Runner | None = None,
) -> V3daxializeOutputs:
    """
    Read and write dataset as new dataset with data brick oriented as axial slices.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3daxialize.html
    
    Args:
        infile: Dataset to be axially oriented.
        prefix: Use specified prefix for the new dataset. Default is\
            'axialize'.
        verb: Print out a progress report.
        sagittal: Write dataset in sagittal slice order.
        coronal: Write dataset in coronal slice order.
        axial: Write dataset in axial slice order, the default orientation.
        orient_code: Orientation code for output. 3 letters: one from {R,L},\
            {A,P}, {I,S}.
        frugal: Write data as it is rotated, saving memory. Not available with\
            NIFTI datasets.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3daxializeOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3DAXIALIZE_METADATA)
    cargs = []
    cargs.append("3daxialize")
    cargs.append("[OUTPUT_FILE]")
    cargs.append(execution.input_file(infile))
    if prefix is not None:
        cargs.extend([
            "-prefix",
            prefix
        ])
    if verb:
        cargs.append("-verb")
    if sagittal:
        cargs.append("-sagittal")
    if coronal:
        cargs.append("-coronal")
    if axial:
        cargs.append("-axial")
    if orient_code is not None:
        cargs.extend([
            "-orient",
            orient_code
        ])
    if frugal:
        cargs.append("-frugal")
    ret = V3daxializeOutputs(
        root=execution.output_file("."),
        outfile=execution.output_file(prefix + "+orig") if (prefix is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3daxializeOutputs",
    "V_3DAXIALIZE_METADATA",
    "v_3daxialize",
]
