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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3DTO_XDATASET_METADATA = Metadata(
    id="9011efe4c33ad7bf18deb6c5c1803fd3a072d632.boutiques",
    name="3dtoXdataset",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dtoXdatasetOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3dto_xdataset(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_sdat: OutputPathType
    """Output file in .sdat format"""


def v_3dto_xdataset(
    prefix: str,
    mask: InputPathType,
    input_files: list[InputPathType],
    runner: Runner | None = None,
) -> V3dtoXdatasetOutputs:
    """
    Convert input datasets to the format needed for 3dClustSimX.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dtoXdataset.html
    
    Args:
        prefix: Prefix for the output file.
        mask: Mask dataset file.
        input_files: Input datasets to be converted.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dtoXdatasetOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3DTO_XDATASET_METADATA)
    cargs = []
    cargs.append("3dtoXdataset")
    cargs.append("-prefix")
    cargs.append(prefix)
    cargs.append(execution.input_file(mask))
    cargs.extend([execution.input_file(f) for f in input_files])
    ret = V3dtoXdatasetOutputs(
        root=execution.output_file("."),
        output_sdat=execution.output_file(prefix + ".sdat"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dtoXdatasetOutputs",
    "V_3DTO_XDATASET_METADATA",
    "v_3dto_xdataset",
]
