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

import typing
import pathlib
from styxdefs import *
import dataclasses

BETA2SXA_METADATA = Metadata(
    id="715f661699d8a42e26b57d5896f55ec5edf8d5d2.boutiques",
    name="beta2sxa",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class Beta2sxaOutputs(typing.NamedTuple):
    """
    Output object returned when calling `beta2sxa(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    sxa_output_file: OutputPathType
    """Output file for tkmedit or tksurfer visualization."""


def beta2sxa(
    beta_files: list[InputPathType],
    number_of_conditions: float,
    number_of_per_subjects: float,
    sxa_output: str | None = "h.beta",
    runner: Runner | None = None,
) -> Beta2sxaOutputs:
    """
    A script to create files for plotting in tkmedit or tksurfer based on tabular
    data.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        beta_files: Input beta files, e.g., data.nii.
        number_of_conditions: Number of groups or conditions.
        number_of_per_subjects: Number of subjects per group.
        sxa_output: Output sxa file. Default is h.beta.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `Beta2sxaOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(BETA2SXA_METADATA)
    cargs = []
    cargs.append("beta2sxa")
    cargs.extend([
        "--b",
        *[execution.input_file(f) for f in beta_files]
    ])
    cargs.extend([
        "--nc",
        str(number_of_conditions)
    ])
    cargs.extend([
        "--nper",
        str(number_of_per_subjects)
    ])
    if sxa_output is not None:
        cargs.extend([
            "--o",
            sxa_output
        ])
    ret = Beta2sxaOutputs(
        root=execution.output_file("."),
        sxa_output_file=execution.output_file("h.[MASK].nii"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "BETA2SXA_METADATA",
    "Beta2sxaOutputs",
    "beta2sxa",
]
