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

import typing
import pathlib
from styxdefs import *
import dataclasses

V__DJUNCT_VOL_3SLICE_SELECT_METADATA = Metadata(
    id="14c908b477bccc5760d0b939cfdb6b12f3cc2ce8.boutiques",
    name="@djunct_vol_3slice_select",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class VDjunctVol3sliceSelectOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v__djunct_vol_3slice_select(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    ijk_output: OutputPathType
    """File that contains the output indices i j k."""


def v__djunct_vol_3slice_select(
    dataset_file: InputPathType,
    coord_x: float,
    coord_y: float,
    coord_z: float,
    runner: Runner | None = None,
) -> VDjunctVol3sliceSelectOutputs:
    """
    Helper script to convert (x, y, z) coordinates to (i, j, k) indices for a
    dataset. It will return an error if any indices are outside the dataset's
    matrix.
    
    Author: AFNI Team
    
    URL:
    https://afni.nimh.nih.gov/pub/dist/doc/program_help/@djunct_vol_3slice_select.html
    
    Args:
        dataset_file: The name of the dataset file.
        coord_x: The x-coordinate in the dataset.
        coord_y: The y-coordinate in the dataset.
        coord_z: The z-coordinate in the dataset.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `VDjunctVol3sliceSelectOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V__DJUNCT_VOL_3SLICE_SELECT_METADATA)
    cargs = []
    cargs.append("adjunct_vol_3slice_select")
    cargs.append(execution.input_file(dataset_file))
    cargs.append(str(coord_x))
    cargs.append(str(coord_y))
    cargs.append(str(coord_z))
    ret = VDjunctVol3sliceSelectOutputs(
        root=execution.output_file("."),
        ijk_output=execution.output_file("ijk_indices.txt"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "VDjunctVol3sliceSelectOutputs",
    "V__DJUNCT_VOL_3SLICE_SELECT_METADATA",
    "v__djunct_vol_3slice_select",
]
