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

import typing
import pathlib
from styxdefs import *
import dataclasses

V__NOISY_SKULL_STRIP_METADATA = Metadata(
    id="a95b392481360cc4893886c77cddfcea221759d0.boutiques",
    name="@NoisySkullStrip",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VNoisySkullStripOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__noisy_skull_strip(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    anat_ns: OutputPathType
    """Skull stripped version of ANAT"""
    anat_air: OutputPathType
    """Special mask output - air"""
    anat_skl: OutputPathType
    """Special mask output - skull"""
    anat_lsp: OutputPathType
    """Volume used to threshold 'air' out of the volume to be stripped"""


def v__noisy_skull_strip(
    input_file: InputPathType,
    keep_tmp: bool = False,
    v_3dskullstrip_opts: str | None = None,
    runner: Runner | None = None,
) -> VNoisySkullStripOutputs:
    """
    Strips the skull of anatomical datasets with low SNR.
    
    Author: AFNI Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        input_file: The anatomical dataset.
        keep_tmp: Do not erase temporary files at the end.
        v_3dskullstrip_opts: Anything following this option is passed to\
            3dSkullStrip.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VNoisySkullStripOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__NOISY_SKULL_STRIP_METADATA)
    cargs = []
    cargs.append("@NoisySkullStrip")
    cargs.extend([
        "-input",
        execution.input_file(input_file)
    ])
    if keep_tmp:
        cargs.append("-keep_tmp")
    if v_3dskullstrip_opts is not None:
        cargs.extend([
            "-3dSkullStrip_opts",
            v_3dskullstrip_opts
        ])
    ret = VNoisySkullStripOutputs(
        root=execution.output_file("."),
        anat_ns=execution.output_file(pathlib.Path(input_file).name + ".ns"),
        anat_air=execution.output_file(pathlib.Path(input_file).name + ".air"),
        anat_skl=execution.output_file(pathlib.Path(input_file).name + ".skl"),
        anat_lsp=execution.output_file(pathlib.Path(input_file).name + ".lsp"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VNoisySkullStripOutputs",
    "V__NOISY_SKULL_STRIP_METADATA",
    "v__noisy_skull_strip",
]
