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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRI_EDIT_SEGMENTATION_METADATA = Metadata(
    id="25345594af6f00c5d1125c06b5d3a088c2d5244f.boutiques",
    name="mri_edit_segmentation",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MriEditSegmentationOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mri_edit_segmentation(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_segmentation_file: OutputPathType
    """The resulting edited segmentation file."""


def mri_edit_segmentation(
    input_segmentation: InputPathType,
    t1_volume: InputPathType,
    output_segmentation: str,
    runner: Runner | None = None,
) -> MriEditSegmentationOutputs:
    """
    A tool used for editing segmentations.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_segmentation: Input segmentation file.
        t1_volume: T1 volume file.
        output_segmentation: Output segmentation file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MriEditSegmentationOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRI_EDIT_SEGMENTATION_METADATA)
    cargs = []
    cargs.append("mri_edit_segmentation")
    cargs.append(execution.input_file(input_segmentation))
    cargs.append(execution.input_file(t1_volume))
    cargs.append(output_segmentation)
    ret = MriEditSegmentationOutputs(
        root=execution.output_file("."),
        output_segmentation_file=execution.output_file(output_segmentation),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRI_EDIT_SEGMENTATION_METADATA",
    "MriEditSegmentationOutputs",
    "mri_edit_segmentation",
]
