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

import typing
import pathlib
from styxdefs import *
import dataclasses

FIND_VARIANCE_LINES_TCSH_METADATA = Metadata(
    id="d945d03baa65a3eb582f1efc1233dd5c40de2056.boutiques",
    name="find_variance_lines.tcsh",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class FindVarianceLinesTcshOutputs(typing.NamedTuple):
    """
    Output object returned when calling `find_variance_lines_tcsh(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    variance_maps: OutputPathType
    """Variance maps per run"""
    scaled_variance_maps: OutputPathType
    """Scaled variance maps per run"""
    cluster_reports: OutputPathType
    """Cluster reports"""
    jpeg_images: OutputPathType
    """JPEG images showing locations of high variance"""


def find_variance_lines_tcsh(
    input_files: list[InputPathType],
    runner: Runner | None = None,
) -> FindVarianceLinesTcshOutputs:
    """
    Look for bars of high variance that might suggest scanner interference in EPI
    datasets.
    
    Author: AFNI Team
    
    URL:
    https://afni.nimh.nih.gov/pub/dist/doc/program_help/find_variance_lines.tcsh.html
    
    Args:
        input_files: Input EPI datasets.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FindVarianceLinesTcshOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FIND_VARIANCE_LINES_TCSH_METADATA)
    cargs = []
    cargs.append("find_variance_lines.tcsh")
    cargs.extend([execution.input_file(f) for f in input_files])
    cargs.append("[OPTIONS]")
    ret = FindVarianceLinesTcshOutputs(
        root=execution.output_file("."),
        variance_maps=execution.output_file("[OUTPUT_DIR]/variance_map_run*.nii.gz"),
        scaled_variance_maps=execution.output_file("[OUTPUT_DIR]/scaled_variance_map_run*.nii.gz"),
        cluster_reports=execution.output_file("[OUTPUT_DIR]/cluster_report_run*.txt"),
        jpeg_images=execution.output_file("[OUTPUT_DIR]/*.jpg"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FIND_VARIANCE_LINES_TCSH_METADATA",
    "FindVarianceLinesTcshOutputs",
    "find_variance_lines_tcsh",
]
