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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_EXTRACT_VALUES_METADATA = Metadata(
    id="d71ebcb707ea3a328def8029909fffc5889d56d6.boutiques",
    name="mris_extract_values",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisExtractValuesOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_extract_values(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_csv: OutputPathType
    """The CSV file generated by the tool"""


def mris_extract_values(
    surface: InputPathType,
    overlay: InputPathType,
    annotation: InputPathType,
    csvfile: str,
    num_images: float,
    image_files: list[InputPathType],
    runner: Runner | None = None,
) -> MrisExtractValuesOutputs:
    """
    Extracts values from surface, overlay, and annotation files and outputs them to
    a CSV file.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        surface: Path to the surface file.
        overlay: Path to the overlay file.
        annotation: Path to the annotation file.
        csvfile: Name of the output CSV file.
        num_images: Number of image files to process.
        image_files: List of image files.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisExtractValuesOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_EXTRACT_VALUES_METADATA)
    cargs = []
    cargs.append("mris_extract_values")
    cargs.extend([
        "-i",
        execution.input_file(surface)
    ])
    cargs.extend([
        "-v",
        execution.input_file(overlay)
    ])
    cargs.extend([
        "-a",
        execution.input_file(annotation)
    ])
    cargs.extend([
        "-o",
        csvfile
    ])
    cargs.extend([
        "-m",
        str(num_images)
    ])
    cargs.extend([
        "--images",
        *[execution.input_file(f) for f in image_files]
    ])
    ret = MrisExtractValuesOutputs(
        root=execution.output_file("."),
        output_csv=execution.output_file(csvfile),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_EXTRACT_VALUES_METADATA",
    "MrisExtractValuesOutputs",
    "mris_extract_values",
]
