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

import typing
import pathlib
from styxdefs import *
import dataclasses

DISTANCEMAP_METADATA = Metadata(
    id="dba579c3fbd3d6218ecbc9a45322438109192f08.boutiques",
    name="distancemap",
    package="fsl",
    container_image_tag="mcin/fsl:6.0.5",
)


class DistancemapOutputs(typing.NamedTuple):
    """
    Output object returned when calling `distancemap(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_distancemap: OutputPathType
    """Output distance map image"""
    output_local_maxima: OutputPathType
    """Output local maxima image"""
    output_segmented_image: OutputPathType
    """Output segmented distance map image"""


def distancemap(
    runner: Runner | None = None,
) -> DistancemapOutputs:
    """
    A tool to calculate distance maps using FSL.
    
    Author: University of Oxford (Mark Jenkinson)
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki/FSL
    
    Args:
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `DistancemapOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(DISTANCEMAP_METADATA)
    cargs = []
    cargs.append("distancemap")
    cargs.append("[OPTIONS]")
    ret = DistancemapOutputs(
        root=execution.output_file("."),
        output_distancemap=execution.output_file("[OUTPUT_IMAGE]"),
        output_local_maxima=execution.output_file("[LOCAL_MAXIMA_IMAGE]"),
        output_segmented_image=execution.output_file("[SEGMENTED_IMAGE]"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "DISTANCEMAP_METADATA",
    "DistancemapOutputs",
    "distancemap",
]
