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

import typing
import pathlib
from styxdefs import *
import dataclasses

READ_MATLAB_FILES_PY_METADATA = Metadata(
    id="228461aad9e4f1abdf8c4f6cdf4dda42da06fc96.boutiques",
    name="read_matlab_files.py",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class ReadMatlabFilesPyOutputs(typing.NamedTuple):
    """
    Output object returned when calling `read_matlab_files_py(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    converted_1d_file: OutputPathType | None
    """Converted 1D format file"""


def read_matlab_files_py(
    infiles: list[str],
    prefix: str | None = None,
    overwrite: bool = False,
    help_: bool = False,
    history: bool = False,
    version: bool = False,
    runner: Runner | None = None,
) -> ReadMatlabFilesPyOutputs:
    """
    Describe or convert MATLAB files (.mat) to 1D format.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        infiles: Input MATLAB files to be processed.
        prefix: Prefix for output file names.
        overwrite: Overwrite any existing output files.
        help_: Show help message.
        history: Show revision history.
        version: Show version number.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `ReadMatlabFilesPyOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(READ_MATLAB_FILES_PY_METADATA)
    cargs = []
    cargs.append("read_matlab_files.py")
    cargs.extend(infiles)
    if prefix is not None:
        cargs.extend([
            "-prefix",
            prefix
        ])
    if overwrite:
        cargs.append("-overwrite")
    if help_:
        cargs.append("-help")
    if history:
        cargs.append("-hist")
    if version:
        cargs.append("-ver")
    ret = ReadMatlabFilesPyOutputs(
        root=execution.output_file("."),
        converted_1d_file=execution.output_file(prefix + ".[INDEX].[KEY].1D") if (prefix is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "READ_MATLAB_FILES_PY_METADATA",
    "ReadMatlabFilesPyOutputs",
    "read_matlab_files_py",
]
