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

import typing
import pathlib
from styxdefs import *
import dataclasses

ICO_SUPERSAMPLE_METADATA = Metadata(
    id="14aa48c095a4ad3f4f834bf5d2084bdf9092540a.boutiques",
    name="ico_supersample",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class IcoSupersampleOutputs(typing.NamedTuple):
    """
    Output object returned when calling `ico_supersample(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType
    """The output file containing the refined icosahedron mesh."""


def ico_supersample(
    refine: bool = False,
    radius: float | None = None,
    projection_point: list[float] | None = None,
    runner: Runner | None = None,
) -> IcoSupersampleOutputs:
    """
    A tool for refining icosahedron meshes with user-specified parameters.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        refine: Refine the icosahedron mesh.
        radius: Radius of the sphere onto which the icosahedron is projected.
        projection_point: Projection point for the icosahedron refinement.\
            Enter three floating point values separated by spaces.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `IcoSupersampleOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(ICO_SUPERSAMPLE_METADATA)
    cargs = []
    cargs.append("ico_supersample")
    if refine:
        cargs.append("-y")
    if radius is not None:
        cargs.append(str(radius))
    if projection_point is not None:
        cargs.extend(map(str, projection_point))
    ret = IcoSupersampleOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file("refined_icosahedron.obj"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "ICO_SUPERSAMPLE_METADATA",
    "IcoSupersampleOutputs",
    "ico_supersample",
]
