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

import typing
import pathlib
from styxdefs import *
import dataclasses

V__ROI_DECLUSTER_METADATA = Metadata(
    id="9f3d049396f0d326df99a0da9701f22c54f456e3.boutiques",
    name="@ROI_decluster",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VRoiDeclusterOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__roi_decluster(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType
    """Final output dataset"""


def v__roi_decluster(
    runner: Runner | None = None,
) -> VRoiDeclusterOutputs:
    """
    Script to remove small clusters or standalone voxels from an ROI/atlas dataset.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/@ROI_decluster.html
    
    Args:
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VRoiDeclusterOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__ROI_DECLUSTER_METADATA)
    cargs = []
    cargs.append("@ROI_decluster")
    cargs.append("-input")
    cargs.append("<input>")
    cargs.append("-outdir")
    cargs.append("<outdir>")
    cargs.append("-prefix")
    cargs.append("<prefix>")
    cargs.append("-nvox_thresh")
    cargs.append("<nvox_thresh>")
    cargs.append("-frac_thresh")
    cargs.append("<frac_thresh>")
    cargs.append("-NN")
    cargs.append("<NN>")
    ret = VRoiDeclusterOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file("[PREFIX].nii.gz"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VRoiDeclusterOutputs",
    "V__ROI_DECLUSTER_METADATA",
    "v__roi_decluster",
]
