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

import typing
import pathlib
from styxdefs import *
import dataclasses

FAT_ROI_ROW_PY_METADATA = Metadata(
    id="cada95873436e89bd665259b6c2d18bfee6eb649.boutiques",
    name="fat_roi_row.py",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class FatRoiRowPyOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fat_roi_row_py(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType
    """Selected ROI row output file in .row format."""


def fat_roi_row_py(
    roi: str,
    matrix_files: str | None = None,
    list_file: InputPathType | None = None,
    extern_labs_no: bool = False,
    runner: Runner | None = None,
) -> FatRoiRowPyOutputs:
    """
    Select a single ROI's row out of a connectivity matrix file (*.grid or *.netcc)
    for viewing and/or further analysis.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/fat_roi_row.py.html
    
    Args:
        roi: Specify which ROI's row of connectivity you want to select out. If\
            labeltables were used, you may select the ROI by either the string\
            label or the ROI mask number.
        matrix_files: Provide the set of matrix (*.grid or *.netcc) files by\
            searchable path. This can be a globbable entry in quotes containing\
            wildcard characters.
        list_file: Provide the set of matrix (*.grid or *.netcc) files by\
            explicit path in a text file. The LIST text file must contain at least\
            one column with the path to subject matrix file.
        extern_labs_no: Switch to turn off the writing/usage of user-defined\
            labels in the *.grid/*.netcc files.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FatRoiRowPyOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FAT_ROI_ROW_PY_METADATA)
    cargs = []
    cargs.append("fat_roi_row.py")
    cargs.append("-r")
    cargs.extend([
        "-r",
        roi
    ])
    cargs.append("{")
    cargs.append("-m")
    if matrix_files is not None:
        cargs.extend([
            "-m",
            matrix_files
        ])
    cargs.append("|")
    cargs.append("-l")
    if list_file is not None:
        cargs.extend([
            "-l",
            execution.input_file(list_file)
        ])
    cargs.append("}")
    cargs.append("-E")
    if extern_labs_no:
        cargs.append("-E")
    ret = FatRoiRowPyOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file(roi + "_selected.row"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FAT_ROI_ROW_PY_METADATA",
    "FatRoiRowPyOutputs",
    "fat_roi_row_py",
]
