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

import typing
import pathlib
from styxdefs import *
import dataclasses

ZERO_LT_4DFP_METADATA = Metadata(
    id="5af9fb53b5beb7937f30eebe316bb87929b7202b.boutiques",
    name="zero_lt_4dfp",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class ZeroLt4dfpOutputs(typing.NamedTuple):
    """
    Output object returned when calling `zero_lt_4dfp(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_4dfp: OutputPathType | None
    """Output 4dfp file with values less than the threshold zeroed."""


def zero_lt_4dfp(
    flt_value: float,
    file_4dfp: InputPathType,
    outroot: str | None = None,
    endianness: str | None = None,
    runner: Runner | None = None,
) -> ZeroLt4dfpOutputs:
    """
    A tool to process 4dfp image files by zeroing values less than a given float
    threshold.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        flt_value: Floating point threshold value. Values less than this in the\
            4dfp file will be zeroed.
        file_4dfp: Input 4dfp file.
        outroot: Output root name for 4dfp file. If not specified, defaults to\
            input file root with 'z' appended.
        endianness: Specify output endian format: 'b' for big endian or 'l' for\
            little endian. Defaults to input endian.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `ZeroLt4dfpOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(ZERO_LT_4DFP_METADATA)
    cargs = []
    cargs.append("zero_lt_4dfp")
    cargs.append(str(flt_value))
    cargs.append(execution.input_file(file_4dfp))
    if outroot is not None:
        cargs.append(outroot)
    if endianness is not None:
        cargs.extend([
            "-@",
            endianness
        ])
    ret = ZeroLt4dfpOutputs(
        root=execution.output_file("."),
        output_4dfp=execution.output_file(outroot + ".4dfp") if (outroot is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "ZERO_LT_4DFP_METADATA",
    "ZeroLt4dfpOutputs",
    "zero_lt_4dfp",
]
