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

import typing
import pathlib
from styxdefs import *
import dataclasses

POLYORDER_METADATA = Metadata(
    id="3c8b24e1442e41d2305967e2496acc7a689b044a.boutiques",
    name="polyorder",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


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


def polyorder(
    ntp: float,
    tr: float,
    cutoff: float,
    runner: Runner | None = None,
) -> PolyorderOutputs:
    """
    Computes the order of polynomial regressors needed to achieve a highpass filter
    with the given cutoff frequency.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        ntp: Number of time points (i.e., number of TRs).
        tr: TR in seconds.
        cutoff: Cutoff frequency in Hz.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `PolyorderOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(POLYORDER_METADATA)
    cargs = []
    cargs.append("polyorder")
    cargs.extend([
        "--ntp",
        str(ntp)
    ])
    cargs.extend([
        "--TR",
        str(tr)
    ])
    cargs.extend([
        "--cutoff",
        str(cutoff)
    ])
    ret = PolyorderOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "POLYORDER_METADATA",
    "PolyorderOutputs",
    "polyorder",
]
