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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_BALL_MATCH_METADATA = Metadata(
    id="ec86e9d0ff8252e6076f6e6033b6c38607b33cd2.boutiques",
    name="3dBallMatch",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dBallMatchOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_ball_match(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_stdout: OutputPathType
    """Output containing matching coordinates and related data"""


def v_3d_ball_match(
    input_dataset: InputPathType,
    radius: float | None = None,
    runner: Runner | None = None,
) -> V3dBallMatchOutputs:
    """
    A tool to find a good match between a ball (filled sphere) of the given radius
    and a dataset to determine a crude approximate center of the brain quickly.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dBallMatch.html
    
    Args:
        input_dataset: Input dataset (e.g., Fred.nii).
        radius: Radius of the 3D ball to match (in mm).
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dBallMatchOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_BALL_MATCH_METADATA)
    cargs = []
    cargs.append("3dBallMatch")
    cargs.append("[OPTIONS]")
    cargs.append(execution.input_file(input_dataset))
    if radius is not None:
        cargs.append(str(radius))
    ret = V3dBallMatchOutputs(
        root=execution.output_file("."),
        output_stdout=execution.output_file("stdout"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dBallMatchOutputs",
    "V_3D_BALL_MATCH_METADATA",
    "v_3d_ball_match",
]
