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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_POLV_METADATA = Metadata(
    id="ee8644189f031978bc3740be0222cfee554fee9b.boutiques",
    name="mri_polv",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriPolvOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_polv(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def mri_polv(
    input_image: InputPathType,
    output_image: InputPathType,
    window_size: float | None = None,
    runner: Runner | None = None,
) -> MriPolvOutputs:
    """
    Calculate an image specifying the plane of least variance at each point in the
    input image.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_image: The input image file for processing.
        output_image: The output image file specifying the plane of least\
            variance.
        window_size: Specify the window size to be used in the calculation of\
            the central plane of least variance (default=5).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriPolvOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_POLV_METADATA)
    cargs = []
    cargs.append("mri_polv")
    if window_size is not None:
        cargs.extend([
            "-w",
            str(window_size)
        ])
    cargs.append(execution.input_file(input_image))
    cargs.append(execution.input_file(output_image))
    ret = MriPolvOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_POLV_METADATA",
    "MriPolvOutputs",
    "mri_polv",
]
