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

import typing
import pathlib
from styxdefs import *
import dataclasses

FSLASCII2IMG_METADATA = Metadata(
    id="05f4f1fe8989e2b97f3ccc41cb0004a9c7d240be.boutiques",
    name="fslascii2img",
    package="fsl",
    container_image_tag="mcin/fsl:6.0.5",
)


class Fslascii2imgOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fslascii2img(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    outfile: OutputPathType
    """Converted NIfTI file from ASCII input"""


def fslascii2img(
    infile: InputPathType,
    xsize: int,
    ysize: int,
    zsize: int,
    tsize: int,
    xdim: float,
    ydim: float,
    zdim: float,
    tr: float,
    outfile: str = "output",
    runner: Runner | None = None,
) -> Fslascii2imgOutputs:
    """
    Convert data from ASCII format to NIfTI format.
    
    Author: Oxford Centre for Functional MRI of the Brain (FMRIB)
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Fslutils
    
    Args:
        infile: Input ASCII file.
        xsize: Size in the x dimension (in voxels).
        ysize: Size in the y dimension (in voxels).
        zsize: Size in the z dimension (in voxels).
        tsize: Size in the t dimension (in voxels).
        xdim: Dimension size in the x dimension (in mm).
        ydim: Dimension size in the y dimension (in mm).
        zdim: Dimension size in the z dimension (in mm).
        tr: Repetition time (TR) in seconds.
        outfile: Output NIfTI file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `Fslascii2imgOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FSLASCII2IMG_METADATA)
    cargs = []
    cargs.append("fslascii2img")
    cargs.append(execution.input_file(infile))
    cargs.append(str(xsize))
    cargs.append(str(ysize))
    cargs.append(str(zsize))
    cargs.append(str(tsize))
    cargs.append(str(xdim))
    cargs.append(str(ydim))
    cargs.append(str(zdim))
    cargs.append(str(tr))
    cargs.append(outfile)
    ret = Fslascii2imgOutputs(
        root=execution.output_file("."),
        outfile=execution.output_file(outfile),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FSLASCII2IMG_METADATA",
    "Fslascii2imgOutputs",
    "fslascii2img",
]
