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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_REMOVE_VARIANCE_METADATA = Metadata(
    id="179ff3984d2be9f6ba0b11909b268c8560dc15ee.boutiques",
    name="mris_remove_variance",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisRemoveVarianceOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_remove_variance(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    resulting_curvature_file: OutputPathType
    """The resulting curvature file after removing variance."""


def mris_remove_variance(
    input_surface_file: InputPathType,
    curvature_file: InputPathType,
    curvature_file_to_remove: InputPathType,
    output_curvature_file: str,
    runner: Runner | None = None,
) -> MrisRemoveVarianceOutputs:
    """
    This program removes the linear component of the variance accounted for by one
    curvature vector from another.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_surface_file: The input surface file.
        curvature_file: The curvature file.
        curvature_file_to_remove: The curvature file to remove from the input\
            curvature.
        output_curvature_file: The output curvature file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisRemoveVarianceOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_REMOVE_VARIANCE_METADATA)
    cargs = []
    cargs.append("mris_remove_variance")
    cargs.append(execution.input_file(input_surface_file))
    cargs.append(execution.input_file(curvature_file))
    cargs.append(execution.input_file(curvature_file_to_remove))
    cargs.append(output_curvature_file)
    ret = MrisRemoveVarianceOutputs(
        root=execution.output_file("."),
        resulting_curvature_file=execution.output_file(output_curvature_file),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_REMOVE_VARIANCE_METADATA",
    "MrisRemoveVarianceOutputs",
    "mris_remove_variance",
]
