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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_THREETO_RGB_METADATA = Metadata(
    id="0e50efb1e4d4adac2b47669f62f58516c895a1cf.boutiques",
    name="3dThreetoRGB",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dThreetoRgbOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_threeto_rgb(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_dataset_head: OutputPathType | None
    """RGB-valued dataset output"""
    output_dataset_brik: OutputPathType | None
    """RGB-valued dataset output"""


def v_3d_threeto_rgb(
    input_dataset: InputPathType,
    output_prefix: str | None = None,
    scale_factor: float | None = None,
    mask_dataset: InputPathType | None = None,
    fim: bool = False,
    anat: bool = False,
    input_dataset2: InputPathType | None = None,
    input_dataset3: InputPathType | None = None,
    runner: Runner | None = None,
) -> V3dThreetoRgbOutputs:
    """
    Converts 3 sub-bricks of input to an RGB-valued dataset.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        input_dataset: Input dataset or first dataset if three datasets are\
            provided.
        output_prefix: Write output into dataset with specified prefix.
        scale_factor: Multiply input values by this factor before using as RGB.
        mask_dataset: Only output nonzero values where the mask dataset is\
            nonzero.
        fim: Write result as a 'fim' type dataset (default behavior).
        anat: Write result as a anatomical type dataset.
        input_dataset2: Second dataset, required only if three datasets are\
            provided.
        input_dataset3: Third dataset, required only if three datasets are\
            provided.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dThreetoRgbOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_THREETO_RGB_METADATA)
    cargs = []
    cargs.append("3dThreetoRGB")
    if output_prefix is not None:
        cargs.extend([
            "-prefix",
            output_prefix
        ])
    if scale_factor is not None:
        cargs.extend([
            "-scale",
            str(scale_factor)
        ])
    if mask_dataset is not None:
        cargs.extend([
            "-mask",
            execution.input_file(mask_dataset)
        ])
    if fim:
        cargs.append("-fim")
    if anat:
        cargs.append("-anat")
    cargs.append(execution.input_file(input_dataset))
    cargs.append("[DATASET1]")
    if input_dataset2 is not None:
        cargs.append(execution.input_file(input_dataset2))
    if input_dataset3 is not None:
        cargs.append(execution.input_file(input_dataset3))
    ret = V3dThreetoRgbOutputs(
        root=execution.output_file("."),
        output_dataset_head=execution.output_file(output_prefix + "+rgb.HEAD") if (output_prefix is not None) else None,
        output_dataset_brik=execution.output_file(output_prefix + "+rgb.BRIK") if (output_prefix is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dThreetoRgbOutputs",
    "V_3D_THREETO_RGB_METADATA",
    "v_3d_threeto_rgb",
]
