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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_DISTANCE_TRANSFORM_METADATA = Metadata(
    id="7714e4c14a355415364e79e36d2280280f83a066.boutiques",
    name="mri_distance_transform",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriDistanceTransformOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_distance_transform(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_file: OutputPathType
    """Output volume file after distance transform"""


def mri_distance_transform(
    input_volume: InputPathType,
    label: int,
    max_distance: int,
    output_volume: str,
    mode: int | None = 1,
    runner: Runner | None = None,
) -> MriDistanceTransformOutputs:
    """
    Tool to compute distance transforms on MRI volumes.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_volume: Input volume file.
        label: Label value for distance transform calculation.
        max_distance: Maximum distance for the transform.
        output_volume: Output volume file.
        mode: Mode of the distance transform: 1 = outside, 2 = inside, 3 =\
            both, 4 = both unsigned.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriDistanceTransformOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_DISTANCE_TRANSFORM_METADATA)
    cargs = []
    cargs.append("mri_distance_transform")
    cargs.append(execution.input_file(input_volume))
    cargs.append(str(label))
    cargs.append(str(max_distance))
    if mode is not None:
        cargs.append(str(mode))
    cargs.append(output_volume)
    ret = MriDistanceTransformOutputs(
        root=execution.output_file("."),
        output_file=execution.output_file(output_volume),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_DISTANCE_TRANSFORM_METADATA",
    "MriDistanceTransformOutputs",
    "mri_distance_transform",
]
