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

import typing
import pathlib
from styxdefs import *
import dataclasses

FTOZ_METADATA = Metadata(
    id="f01afa9b8431b1163d41919afd62f2c7b9f742dd.boutiques",
    name="ftoz",
    package="fsl",
    container_image_tag="mcin/fsl:6.0.5",
)


class FtozOutputs(typing.NamedTuple):
    """
    Output object returned when calling `ftoz(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_zscores: OutputPathType | None
    """File containing the converted Z-scores"""


def ftoz(
    input_file: InputPathType,
    dof1: float,
    dof2: float,
    output_file: InputPathType | None = None,
    runner: Runner | None = None,
) -> FtozOutputs:
    """
    Convert F-statistics to Z-scores.
    
    Author: Unknown
    
    Args:
        input_file: File containing F-statistics.
        dof1: Degrees of freedom 1 for F-to-Z conversion.
        dof2: Degrees of freedom 2 for F-to-Z conversion.
        output_file: Output file for Z-scores.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `FtozOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(FTOZ_METADATA)
    cargs = []
    cargs.append("ftoz")
    cargs.append(execution.input_file(input_file))
    cargs.append(str(dof1))
    cargs.append(str(dof2))
    if output_file is not None:
        cargs.extend([
            "-zout",
            execution.input_file(output_file)
        ])
    ret = FtozOutputs(
        root=execution.output_file("."),
        output_zscores=execution.output_file(pathlib.Path(output_file).name) if (output_file is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "FTOZ_METADATA",
    "FtozOutputs",
    "ftoz",
]
