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

import typing
import pathlib
from styxdefs import *
import dataclasses

MRIS_COMPUTE_PARC_OVERLAP_METADATA = Metadata(
    id="d598ee06b2c8bac2b0e66dc28fd526ceb983bfbd.boutiques",
    name="mris_compute_parc_overlap",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class MrisComputeParcOverlapOutputs(typing.NamedTuple):
    """
    Output object returned when calling `mris_compute_parc_overlap(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""


def mris_compute_parc_overlap(
    subject: str,
    hemi: str,
    annot1: InputPathType | None = None,
    annot2: InputPathType | None = None,
    label1: InputPathType | None = None,
    label2: InputPathType | None = None,
    subj_dir: str | None = None,
    log_file: str | None = None,
    label_list: InputPathType | None = None,
    nocheck_label1_xyz: bool = False,
    nocheck_label2_xyz: bool = False,
    nocheck_label_xyz: bool = False,
    use_label1_xyz: bool = False,
    use_label2_xyz: bool = False,
    use_label_xyz: bool = False,
    debug_overlap: bool = False,
    runner: Runner | None = None,
) -> MrisComputeParcOverlapOutputs:
    """
    Compares two parcellated (annotated or labeled) surfaces and computes an overall
    Dice coefficient and mean minimum distances (mm).
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        subject: Subject to check.
        hemi: Hemisphere: rh or lh.
        annot1: First .annot file.
        annot2: Second .annot file.
        label1: First .label file.
        label2: Second .label file.
        subj_dir: Set SUBJECTS_DIR.
        log_file: Output the overall DICE and minimum distance to filename.
        label_list: File containing labels to check, one per line.
        nocheck_label1_xyz: When loading label1 file, don't check x,y,z coords\
            to surface.
        nocheck_label2_xyz: When loading label2 file, don't check x,y,z coords\
            to surface.
        nocheck_label_xyz: Do not check label1 and label2.
        use_label1_xyz: Replace surface x,y,z coords with those in label1 file.
        use_label2_xyz: Replace surface x,y,z coords with those in label2 file.
        use_label_xyz: Use label1 and label2 coords.
        debug_overlap: Generate ?h.overlap.annot.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MrisComputeParcOverlapOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(MRIS_COMPUTE_PARC_OVERLAP_METADATA)
    cargs = []
    cargs.append("mris_compute_parc_overlap")
    cargs.extend([
        "--s",
        subject
    ])
    cargs.extend([
        "--hemi",
        hemi
    ])
    if annot1 is not None:
        cargs.extend([
            "--annot1",
            execution.input_file(annot1)
        ])
    if annot2 is not None:
        cargs.extend([
            "--annot2",
            execution.input_file(annot2)
        ])
    if label1 is not None:
        cargs.extend([
            "--label1",
            execution.input_file(label1)
        ])
    if label2 is not None:
        cargs.extend([
            "--label2",
            execution.input_file(label2)
        ])
    if subj_dir is not None:
        cargs.extend([
            "--sd",
            subj_dir
        ])
    if log_file is not None:
        cargs.extend([
            "--log",
            log_file
        ])
    if label_list is not None:
        cargs.extend([
            "--label-list",
            execution.input_file(label_list)
        ])
    if nocheck_label1_xyz:
        cargs.append("--nocheck-label1-xyz")
    if nocheck_label2_xyz:
        cargs.append("--nocheck-label2-xyz")
    if nocheck_label_xyz:
        cargs.append("--nocheck-label-xyz")
    if use_label1_xyz:
        cargs.append("--use-label1-xyz")
    if use_label2_xyz:
        cargs.append("--use-label2-xyz")
    if use_label_xyz:
        cargs.append("--use-label-xyz")
    if debug_overlap:
        cargs.append("--debug-overlap")
    ret = MrisComputeParcOverlapOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "MRIS_COMPUTE_PARC_OVERLAP_METADATA",
    "MrisComputeParcOverlapOutputs",
    "mris_compute_parc_overlap",
]
