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

import typing
import pathlib
from styxdefs import *
import dataclasses

SEGMENT_SUBJECT_T1_T2_AUTO_ESTIMATE_ALVEUS_ML_METADATA = Metadata(
    id="3610f126955ba102d4ca3bfab514b11ee60bd328.boutiques",
    name="segmentSubjectT1T2_autoEstimateAlveusML",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class SegmentSubjectT1T2AutoEstimateAlveusMlOutputs(typing.NamedTuple):
    """
    Output object returned when calling `segment_subject_t1_t2_auto_estimate_alveus_ml(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    segmentation_result: OutputPathType
    """Resultant image of the alveus segmentation."""


def segment_subject_t1_t2_auto_estimate_alveus_ml(
    input_t1: InputPathType,
    input_t2: InputPathType,
    output_directory: str,
    other_options: str | None = None,
    runner: Runner | None = None,
) -> SegmentSubjectT1T2AutoEstimateAlveusMlOutputs:
    """
    Tool for automatic estimation of the alveus in MR images using T1 and T2
    contrast.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        input_t1: Input T1-weighted MR image.
        input_t2: Input T2-weighted MR image.
        output_directory: Directory to save the output files.
        other_options: Additional command-line options.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `SegmentSubjectT1T2AutoEstimateAlveusMlOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(SEGMENT_SUBJECT_T1_T2_AUTO_ESTIMATE_ALVEUS_ML_METADATA)
    cargs = []
    cargs.append("segmentSubjectT1T2_autoEstimateAlveusML")
    cargs.append(execution.input_file(input_t1))
    cargs.append(execution.input_file(input_t2))
    cargs.append(output_directory)
    if other_options is not None:
        cargs.append(other_options)
    ret = SegmentSubjectT1T2AutoEstimateAlveusMlOutputs(
        root=execution.output_file("."),
        segmentation_result=execution.output_file(output_directory + "/segmentation.nii.gz"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "SEGMENT_SUBJECT_T1_T2_AUTO_ESTIMATE_ALVEUS_ML_METADATA",
    "SegmentSubjectT1T2AutoEstimateAlveusMlOutputs",
    "segment_subject_t1_t2_auto_estimate_alveus_ml",
]
