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

import typing
import pathlib
from styxdefs import *
import dataclasses

FSL2ASCII_METADATA = Metadata(
    id="4148252e7c8dae4324e50749f3366f693fc6020c.boutiques",
    name="fsl2ascii",
    package="fsl",
    container_image_tag="mcin/fsl:6.0.5",
)


class Fsl2asciiOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fsl2ascii(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_ascii_file: OutputPathType
    """Output ASCII text file"""


def fsl2ascii(
    input_file: InputPathType,
    output_file: str,
    runner: Runner | None = None,
) -> Fsl2asciiOutputs:
    """
    Convert NIfTI image or analyze 7.5 format file to ASCII text file.
    
    Author: Oxford Centre for Functional MRI of the Brain (FMRIB)
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/Fslutils
    
    Args:
        input_file: Input NIfTI (or analyze 7.5 format) image.
        output_file: Output ASCII text file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `Fsl2asciiOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FSL2ASCII_METADATA)
    cargs = []
    cargs.append("fsl2ascii")
    cargs.append(execution.input_file(input_file))
    cargs.append(output_file)
    ret = Fsl2asciiOutputs(
        root=execution.output_file("."),
        output_ascii_file=execution.output_file(output_file),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FSL2ASCII_METADATA",
    "Fsl2asciiOutputs",
    "fsl2ascii",
]
