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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_CALC_METADATA = Metadata(
    id="0f04865341178eeb624695b7ff33be523bb926b5.boutiques",
    name="mris_calc",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisCalcOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_calc(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_curv_file: OutputPathType | None
    """The resulting FreeSurfer curvature overlay or volume file."""


def mris_calc(
    input_file1: InputPathType,
    action: str,
    input_file2_or_float: InputPathType | None = None,
    output_file: str | None = None,
    label_file: InputPathType | None = None,
    verbosity: str | None = None,
    runner: Runner | None = None,
) -> MrisCalcOutputs:
    """
    Simple calculator that operates on FreeSurfer curvatures and volumes.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_file1: The name of a FreeSurfer curvature overlay (e.g., rh.curv)\
            or volume file (e.g., orig.mgz).
        action: Mathematical action to perform on the input file(s), written as\
            a text string.
        input_file2_or_float: The second input for the calculation. Can be a\
            file (e.g., rh.thickness) or a float number if the file does not exist.
        output_file: Specify the output file name for the result of the\
            calculation.
        label_file: Constrain the calculation to vertices defined in the\
            FreeSurfer label file.
        verbosity: Set the verbosity of the program.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisCalcOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_CALC_METADATA)
    cargs = []
    cargs.append("mris_calc")
    cargs.append(execution.input_file(input_file1))
    cargs.append(action)
    if input_file2_or_float is not None:
        cargs.append(execution.input_file(input_file2_or_float))
    if output_file is not None:
        cargs.extend([
            "--output",
            output_file
        ])
    if label_file is not None:
        cargs.extend([
            "--label",
            execution.input_file(label_file)
        ])
    if verbosity is not None:
        cargs.extend([
            "--verbosity",
            verbosity
        ])
    ret = MrisCalcOutputs(
        root=execution.output_file("."),
        output_curv_file=execution.output_file(output_file) if (output_file is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_CALC_METADATA",
    "MrisCalcOutputs",
    "mris_calc",
]
