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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_AFNITO_NIFTI_METADATA = Metadata(
    id="fb3d635db1319933a6531cd04ac8e966302fa609.boutiques",
    name="3dAFNItoNIFTI",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dAfnitoNiftiOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_afnito_nifti(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_nifti: OutputPathType | None
    """Output NIfTI file."""


def v_3d_afnito_nifti(
    input_dataset: InputPathType,
    prefix: str | None = None,
    verbose: bool = False,
    force_float: bool = False,
    pure: bool = False,
    denote: bool = False,
    oldid: bool = False,
    newid: bool = False,
    runner: Runner | None = None,
) -> V3dAfnitoNiftiOutputs:
    """
    Converts an AFNI dataset to a NIfTI-1.1 file.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dAFNItoNIFTI.html
    
    Args:
        input_dataset: Input AFNI dataset.
        prefix: Output NIfTI file prefix.
        verbose: Print progress messages (increases verbosity if repeated).
        force_float: Force the output dataset to be 32-bit floats.
        pure: Do not write an AFNI extension field into the output file.
        denote: Remove text notes from AFNI extension field that might contain\
            identifying information.
        oldid: Retain the input dataset's AFNI ID code.
        newid: Assign a new AFNI ID code to the dataset (default action).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dAfnitoNiftiOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_AFNITO_NIFTI_METADATA)
    cargs = []
    cargs.append("3dAFNItoNIFTI")
    cargs.append(execution.input_file(input_dataset))
    if prefix is not None:
        cargs.extend([
            "-prefix",
            prefix
        ])
    if verbose:
        cargs.append("-verb")
    if force_float:
        cargs.append("-float")
    if pure:
        cargs.append("-pure")
    if denote:
        cargs.append("-denote")
    if oldid:
        cargs.append("-oldid")
    if newid:
        cargs.append("-newid")
    ret = V3dAfnitoNiftiOutputs(
        root=execution.output_file("."),
        output_nifti=execution.output_file(prefix + ".nii") if (prefix is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dAfnitoNiftiOutputs",
    "V_3D_AFNITO_NIFTI_METADATA",
    "v_3d_afnito_nifti",
]
