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

import typing
import pathlib
from styxdefs import *
import dataclasses

NIFTI_TOOL_METADATA = Metadata(
    id="d9f2616434f053b6e238d0eace87c16ce9d36fe0.boutiques",
    name="nifti_tool",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class NiftiToolOutputs(typing.NamedTuple):
    """
    Output object returned when calling `nifti_tool(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType
    """The nifti file generated as output."""


def nifti_tool(
    action: str,
    input_files: list[InputPathType] | None = None,
    runner: Runner | None = None,
) -> NiftiToolOutputs:
    """
    Display, modify, or compare nifti headers.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/nifti_tool.html
    
    Args:
        action: Action type that defines what nifti_tool will do.
        input_files: One or more input nifti files.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `NiftiToolOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(NIFTI_TOOL_METADATA)
    cargs = []
    cargs.append("nifti_tool")
    cargs.append(action)
    if input_files is not None:
        cargs.extend([
            "-infiles",
            *[execution.input_file(f) for f in input_files]
        ])
    cargs.append("[OPTIONS]")
    ret = NiftiToolOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file("[PREFIX].nii"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "NIFTI_TOOL_METADATA",
    "NiftiToolOutputs",
    "nifti_tool",
]
