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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_INFO_METADATA = Metadata(
    id="f8473bd4b6a90f8c8b3dbe8a7c1e45f9016b4d73.boutiques",
    name="mris_info",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisInfoOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_info(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType | None
    """Output file containing saved data"""
    output_edge_file: OutputPathType | None
    """File containing edge info"""


def mris_info(
    surfacefile: InputPathType,
    outfile: InputPathType | None = None,
    subject_hemi_surfname: str | None = None,
    patchfile: InputPathType | None = None,
    vertex_number: float | None = None,
    extended_vertex_number: float | None = None,
    curvfile: InputPathType | None = None,
    annotfile: InputPathType | None = None,
    edge_stats_id: str | None = None,
    edge_number: float | None = None,
    vtxno: str | None = None,
    matrix_format: str | None = None,
    mask_file: InputPathType | None = None,
    label_file: InputPathType | None = None,
    edge_file: InputPathType | None = None,
    talairach_xfm_flag: bool = False,
    rescale_flag: bool = False,
    area_stats_flag: bool = False,
    quality_stats_flag: bool = False,
    intersections_flag: bool = False,
    nogifti_flag: bool = False,
    version_flag: bool = False,
    help_flag: bool = False,
    runner: Runner | None = None,
) -> MrisInfoOutputs:
    """
    Prints out information about a surface file.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        surfacefile: Surface file to process.
        outfile: Save some data to outfile.
        subject_hemi_surfname: Instead of surfacefile.
        patchfile: Load patch before reporting.
        vertex_number: Print out vertex information for vertex vnum.
        extended_vertex_number: Print out extended vertex information for\
            vertex vnum.
        curvfile: Check if curvature file vertices match surface vertices.
        annotfile: Check if annotation file vertices match surface vertices;\
            dump colortable.
        edge_stats_id: Compute stats on edge metric (n, mean, std, min, max);\
            id=0=length, id=1=dot, id=2=angle, id<0= all.
        edge_number: Print out extended information about edge.
        vtxno: Write Matlab file to plot vertex neighborhood.
        matrix_format: Set format for matrix printing (e.g., %12.8f).
        mask_file: Only compute edge and area stats using vertices in mask.
        label_file: Only compute edge and area stats using vertices in label.
        edge_file: Print edge info for all edges into file.
        talairach_xfm_flag: Apply talairach xfm before reporting info.
        rescale_flag: Rescale group surface to match average metrics.
        area_stats_flag: Compute stats on triangle area (n, mean, std, min,\
            max).
        quality_stats_flag: Print out surface quality stats.
        intersections_flag: Print the number of vertices that belong to a face\
            that intersects another face.
        nogifti_flag: No dump of GIFTI struct, read .gii as surface instead.
        version_flag: Print version and exits.
        help_flag: No clue what this does.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisInfoOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_INFO_METADATA)
    cargs = []
    cargs.append("mris_info")
    cargs.append(execution.input_file(surfacefile))
    if outfile is not None:
        cargs.extend([
            "--o",
            execution.input_file(outfile)
        ])
    if subject_hemi_surfname is not None:
        cargs.extend([
            "--s",
            subject_hemi_surfname
        ])
    if patchfile is not None:
        cargs.extend([
            "--patch",
            execution.input_file(patchfile)
        ])
    if vertex_number is not None:
        cargs.extend([
            "--v",
            str(vertex_number)
        ])
    if extended_vertex_number is not None:
        cargs.extend([
            "--vx",
            str(extended_vertex_number)
        ])
    if curvfile is not None:
        cargs.extend([
            "--c",
            execution.input_file(curvfile)
        ])
    if annotfile is not None:
        cargs.extend([
            "--a",
            execution.input_file(annotfile)
        ])
    if edge_stats_id is not None:
        cargs.extend([
            "--edge-stats",
            edge_stats_id
        ])
    if edge_number is not None:
        cargs.extend([
            "--ex",
            str(edge_number)
        ])
    if vtxno is not None:
        cargs.extend([
            "--v-matlab",
            vtxno
        ])
    if matrix_format is not None:
        cargs.extend([
            "--mtx-fmt",
            matrix_format
        ])
    if mask_file is not None:
        cargs.extend([
            "--mask",
            execution.input_file(mask_file)
        ])
    if label_file is not None:
        cargs.extend([
            "--label",
            execution.input_file(label_file)
        ])
    if edge_file is not None:
        cargs.extend([
            "--edge-file",
            execution.input_file(edge_file)
        ])
    if talairach_xfm_flag:
        cargs.append("--t")
    if rescale_flag:
        cargs.append("--r")
    if area_stats_flag:
        cargs.append("--area-stats")
    cargs.append("[EDGE_STATS_FLAG]")
    if quality_stats_flag:
        cargs.append("--quality")
    if intersections_flag:
        cargs.append("--intersections")
    if nogifti_flag:
        cargs.append("--nogifti-disp-image")
    if version_flag:
        cargs.append("--version")
    if help_flag:
        cargs.append("--help")
    ret = MrisInfoOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file(pathlib.Path(outfile).name) if (outfile is not None) else None,
        output_edge_file=execution.output_file(pathlib.Path(edge_file).name) if (edge_file is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_INFO_METADATA",
    "MrisInfoOutputs",
    "mris_info",
]
