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

import typing
import pathlib
from styxdefs import *
import dataclasses

DMRI_PROJECT_END_POINTS_METADATA = Metadata(
    id="93cde90208fae7700f6f02d3a5122b37ae3a77f6.boutiques",
    name="dmri_projectEndPoints",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class DmriProjectEndPointsOutputs(typing.NamedTuple):
    """
    Output object returned when calling `dmri_project_end_points(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    out_left_overlay: OutputPathType
    """Overlay file for left hemisphere surface"""
    out_right_overlay: OutputPathType
    """Overlay file for right hemisphere surface"""


def dmri_project_end_points(
    streamline_file: InputPathType,
    left_surface_file: InputPathType,
    right_surface_file: InputPathType,
    left_overlay_file: str,
    right_overlay_file: str,
    reference_image: InputPathType,
    runner: Runner | None = None,
) -> DmriProjectEndPointsOutputs:
    """
    A tool for projecting the endpoints of streamlines onto cortical surfaces,
    producing overlay files for visualization.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        streamline_file: Input streamline file (e.g. streamlineFile.trk).
        left_surface_file: Left hemisphere surface file (e.g.\
            surfaceFile_lh.orig).
        right_surface_file: Right hemisphere surface file (e.g.\
            surfaceFile_rh.orig).
        left_overlay_file: Output overlay file for left hemisphere.
        right_overlay_file: Output overlay file for right hemisphere.
        reference_image: Reference image for the projections.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `DmriProjectEndPointsOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(DMRI_PROJECT_END_POINTS_METADATA)
    cargs = []
    cargs.append("dmri_projectEndPoints")
    cargs.extend([
        "-i",
        execution.input_file(streamline_file)
    ])
    cargs.extend([
        "-sl",
        execution.input_file(left_surface_file)
    ])
    cargs.extend([
        "-sr",
        execution.input_file(right_surface_file)
    ])
    cargs.extend([
        "-ol",
        left_overlay_file
    ])
    cargs.extend([
        "-or",
        right_overlay_file
    ])
    cargs.extend([
        "-ri",
        execution.input_file(reference_image)
    ])
    ret = DmriProjectEndPointsOutputs(
        root=execution.output_file("."),
        out_left_overlay=execution.output_file(left_overlay_file),
        out_right_overlay=execution.output_file(right_overlay_file),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "DMRI_PROJECT_END_POINTS_METADATA",
    "DmriProjectEndPointsOutputs",
    "dmri_project_end_points",
]
