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

import typing
import pathlib
from styxdefs import *
import dataclasses

FAT_MVM_GRIDCONV_PY_METADATA = Metadata(
    id="8ae9f4629987e35362a12cb081ce643576e4a5c4.boutiques",
    name="fat_mvm_gridconv.py",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class FatMvmGridconvPyOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fat_mvm_gridconv_py(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    converted_grid_files: OutputPathType
    """Output converted grid files, with '_MOD.grid' postfix or custom output
    name provided in the list file."""


def fat_mvm_gridconv_py(
    matrix_files: str | None = None,
    list_file: InputPathType | None = None,
    runner: Runner | None = None,
) -> FatMvmGridconvPyOutputs:
    """
    Preprocess 'old school' *.grid files for statistical modeling using 3dMVM.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        matrix_files: Provide the set of matrix (*.grid) files as a searchable\
            path. This can be a globbable entry in quotes containing wildcard\
            characters.
        list_file: Provide the matrix (*.grid) files by explicit path in a text\
            file. The LIST text file must contain at least one column (path to\
            subject matrix file) with an optional second column (output file\
            names). If no second column is given, the default '_MOD.grid' postfix\
            is applied.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FatMvmGridconvPyOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FAT_MVM_GRIDCONV_PY_METADATA)
    cargs = []
    cargs.append("fat_mvm_gridconv.py")
    if matrix_files is not None:
        cargs.extend([
            "-m",
            matrix_files
        ])
    if list_file is not None:
        cargs.extend([
            "-l",
            execution.input_file(list_file)
        ])
    ret = FatMvmGridconvPyOutputs(
        root=execution.output_file("."),
        converted_grid_files=execution.output_file("*_MOD.grid"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FAT_MVM_GRIDCONV_PY_METADATA",
    "FatMvmGridconvPyOutputs",
    "fat_mvm_gridconv_py",
]
