# 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="fe3fd0a09e1cb0531678dcf999710e6d7163d194.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,
    dataset_option: str | None = None,
    ball_radius: float | None = None,
    spheroid_axes: list[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 Developers
    
    URL: https://afni.nimh.nih.gov/
    
    Args:
        input_dataset: Input dataset (e.g., Fred.nii).
        radius: Radius of the 3D ball to match (in mm).
        dataset_option: Specifies the input dataset.
        ball_radius: Set the radius of the 3D ball to match (mm).
        spheroid_axes: Match with a spheroid of revolution, with principal axis\
            radius 'a' and secondary axes radii 'b'.
        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(execution.input_file(input_dataset))
    if radius is not None:
        cargs.append(str(radius))
    if dataset_option is not None:
        cargs.extend([
            "-input",
            dataset_option
        ])
    if ball_radius is not None:
        cargs.extend([
            "-ball",
            str(ball_radius)
        ])
    if spheroid_axes is not None:
        cargs.extend([
            "-spheroid",
            *map(str, spheroid_axes)
        ])
    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",
]
