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

import typing
import pathlib
from styxdefs import *
import dataclasses

FSLPSPEC_METADATA = Metadata(
    id="034df51dc010372ef67f2310d915e1175d89e8c6.boutiques",
    name="fslpspec",
    package="fsl",
    container_image_tag="mcin/fsl:6.0.5",
)


class FslpspecOutputs(typing.NamedTuple):
    """
    Output object returned when calling `fslpspec(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_pspec: OutputPathType | None
    """Output power spectrum image"""


def fslpspec(
    infile: InputPathType,
    outfile: str | None = None,
    runner: Runner | None = None,
) -> FslpspecOutputs:
    """
    Estimate the power spectrum of 4D fMRI time series data.
    
    Author: Oxford Centre for Functional MRI of the Brain (FMRIB)
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FSL
    
    Args:
        infile: Input 4D fMRI time series image (e.g. fMRI_data.nii.gz).
        outfile: Output power spectrum image (e.g. pspec_data.nii.gz).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FslpspecOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FSLPSPEC_METADATA)
    cargs = []
    cargs.append("fslpspec")
    cargs.append(execution.input_file(infile))
    if outfile is not None:
        cargs.append(outfile)
    cargs.append("[OPTIONS]")
    ret = FslpspecOutputs(
        root=execution.output_file("."),
        output_pspec=execution.output_file(outfile) if (outfile is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FSLPSPEC_METADATA",
    "FslpspecOutputs",
    "fslpspec",
]
