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

import typing
import pathlib
from styxdefs import *
import dataclasses

V__DJUNCT_MODAL_SMOOTHING_WITH_REP_METADATA = Metadata(
    id="3dfe64fe4b416974b4aa2cc3b180143c7a5ada1d.boutiques",
    name="@djunct_modal_smoothing_with_rep",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VDjunctModalSmoothingWithRepOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__djunct_modal_smoothing_with_rep(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file_head: OutputPathType
    """Output dataset after modal smoothing"""
    output_file_brik: OutputPathType
    """Output dataset after modal smoothing"""


def v__djunct_modal_smoothing_with_rep(
    input_file: InputPathType,
    output_prefix: str,
    modesmooth: float | None = None,
    help_view: bool = False,
    help_: bool = False,
    version: bool = False,
    overwrite: bool = False,
    no_clean: bool = False,
    runner: Runner | None = None,
) -> VDjunctModalSmoothingWithRepOutputs:
    """
    A script to perform modal smoothing of ROI maps and check for eliminated ROIs.
    If any ROIs are eliminated during smoothing, they are restored, potentially in a
    degraded form.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        input_file: Input dataset (assumes < 10^5 subbricks).
        output_prefix: Prefix for output dataset.
        modesmooth: Fill in X in: 3dLocalstat -nbhd "SPHERE(-X)" ...
        help_view: Display help in a viewable format.
        help_: Display help information.
        version: Display version information.
        overwrite: Overwrite existing output files.
        no_clean: Do not clean up intermediate files.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VDjunctModalSmoothingWithRepOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__DJUNCT_MODAL_SMOOTHING_WITH_REP_METADATA)
    cargs = []
    cargs.append("@djunct_modal_smoothing_with_rep")
    cargs.append(execution.input_file(input_file))
    cargs.append(output_prefix)
    if modesmooth is not None:
        cargs.extend([
            "-modesmooth",
            str(modesmooth)
        ])
    if help_view:
        cargs.append("-hview")
    if help_:
        cargs.append("-help")
    if version:
        cargs.append("-ver")
    if overwrite:
        cargs.append("-overwrite")
    if no_clean:
        cargs.append("-no_clean")
    ret = VDjunctModalSmoothingWithRepOutputs(
        root=execution.output_file("."),
        output_file_head=execution.output_file(output_prefix + "+tlrc.HEAD"),
        output_file_brik=execution.output_file(output_prefix + "+tlrc.BRIK"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VDjunctModalSmoothingWithRepOutputs",
    "V__DJUNCT_MODAL_SMOOTHING_WITH_REP_METADATA",
    "v__djunct_modal_smoothing_with_rep",
]
