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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRISP_PAINT_METADATA = Metadata(
    id="ee10714d3437e3ff63bdc4e23471b26ed9cb9121.boutiques",
    name="mrisp_paint",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrispPaintOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mrisp_paint(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType
    """Output file containing a surface-worth of per-vertex values in
    'curvature' format."""


def mrisp_paint(
    template_file: InputPathType,
    input_surface: InputPathType,
    output_name: str,
    subjects_dir: str | None = None,
    vertex_coords: str | None = None,
    average_flag: float | None = None,
    normalize_flag: bool = False,
    frame_number: float | None = None,
    square_root_flag: bool = False,
    variance_params: str | None = None,
    usage_flag: bool = False,
    birn_info_flag: bool = False,
    help_flag: bool = False,
    diag_vertex: float | None = None,
    version_flag: bool = False,
    diag_write_flag: bool = False,
    runner: Runner | None = None,
) -> MrispPaintOutputs:
    """
    A tool for extracting arrays from a surface-registration template file and
    sampling them onto a surface mesh.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        template_file: Full path to the template file. Template may contain\
            multiple parameters. Example: 'somepath/mytemplate.tif#1'.
        input_surface: Full path to the input surface file, which provides the\
            grid onto which the template data is sampled.
        output_name: Output file name. Saves the surface-worth of per-vertex\
            values.
        subjects_dir: Set the SUBJECTS_DIR. Default: use environment variable.
        vertex_coords: Treat overlay as a surface and write it into a 3 frame\
            parameterization.
        average_flag: Average curvature patterns a given number of times.
        normalize_flag: Normalize curvature by variance.
        frame_number: Paint the specified frame number to the output file.\
            Default: 0.
        square_root_flag: Take the square-root of the output variable.
        variance_params: Generate variance map. Requires subject name,\
            hemisphere, and field number.
        usage_flag: Print usage.
        birn_info_flag: Print BIRN-standard program information.
        help_flag: Print help message.
        diag_vertex: Invoke diagnostics for a specific vertex number.
        version_flag: Print version information.
        diag_write_flag: Write some diagnostics (DIAG_WRITE).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrispPaintOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRISP_PAINT_METADATA)
    cargs = []
    cargs.append("mrisp_paint")
    cargs.append(execution.input_file(template_file))
    cargs.append(execution.input_file(input_surface))
    cargs.append(output_name)
    if subjects_dir is not None:
        cargs.extend([
            "-SDIR",
            subjects_dir
        ])
    if vertex_coords is not None:
        cargs.extend([
            "-coords",
            vertex_coords
        ])
    if average_flag is not None:
        cargs.extend([
            "-A",
            str(average_flag)
        ])
    if normalize_flag:
        cargs.append("-N")
    if frame_number is not None:
        cargs.extend([
            "-f",
            str(frame_number)
        ])
    if square_root_flag:
        cargs.append("-S")
    if variance_params is not None:
        cargs.extend([
            "-variance",
            variance_params
        ])
    if usage_flag:
        cargs.append("-?")
    if birn_info_flag:
        cargs.append("--all-info")
    if help_flag:
        cargs.append("--help")
    if diag_vertex is not None:
        cargs.extend([
            "-V",
            str(diag_vertex)
        ])
    if version_flag:
        cargs.append("--version")
    if diag_write_flag:
        cargs.append("-W")
    ret = MrispPaintOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file(output_name),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRISP_PAINT_METADATA",
    "MrispPaintOutputs",
    "mrisp_paint",
]
