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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3DEDGE3_METADATA = Metadata(
    id="9db60bfb5c26a62877afdc35578a2c2b8a065792.boutiques",
    name="3dedge3",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dedge3Outputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3dedge3(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType | None
    """Output dataset"""


def v_3dedge3(
    input_file: InputPathType,
    prefix: str | None = None,
    datum: str | None = None,
    scale_floats: float | None = None,
    runner: Runner | None = None,
) -> V3dedge3Outputs:
    """
    Does 3D Edge detection using the library 3DEdge.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dedge3.html
    
    Args:
        input_file: Input dataset.
        prefix: Sets the prefix of the output dataset.
        datum: Sets the datum of the output dataset.
        scale_floats: Multiply input by VAL, but only if the input datum is\
            float.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dedge3Outputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3DEDGE3_METADATA)
    cargs = []
    cargs.append("3dedge3")
    cargs.extend([
        "-input",
        execution.input_file(input_file)
    ])
    cargs.append("[VERBOSE_FLAG]")
    if prefix is not None:
        cargs.extend([
            "-prefix",
            prefix
        ])
    if datum is not None:
        cargs.extend([
            "-datum",
            datum
        ])
    cargs.append("[FSCALE_FLAG]")
    cargs.append("[GSCALE_FLAG]")
    cargs.append("[NSCALE_FLAG]")
    if scale_floats is not None:
        cargs.extend([
            "-scale_floats",
            str(scale_floats)
        ])
    cargs.append("[AUTOMASK_FLAG]")
    ret = V3dedge3Outputs(
        root=execution.output_file("."),
        output_file=execution.output_file(prefix + ".nii.gz") if (prefix is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dedge3Outputs",
    "V_3DEDGE3_METADATA",
    "v_3dedge3",
]
