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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_TRACK_ID_METADATA = Metadata(
    id="c068f5e1d98a8b27b5e0160adf46079d9d5304f8.boutiques",
    name="3dTrackID",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dTrackIdOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_track_id(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    indimap: OutputPathType
    """Output of INDIMAP"""
    pairmap: OutputPathType
    """Output of PAIRMAP"""
    grid: OutputPathType
    """Text file output of statistics of WM-ROIs"""
    niml_tract: OutputPathType
    """Track-like output for viewing in SUMA"""
    niml_dset: OutputPathType
    """Dataset output for use with *.niml.tract"""
    trk: OutputPathType
    """TrackVis-like output for viewing in TrackVis"""
    pairmap_labeltable: OutputPathType
    """Output of PAIRMAP labeltable"""
    roi_labels: OutputPathType
    """Output file of all ROI labels"""
    option_values: OutputPathType
    """Output of all option values"""


def v_3d_track_id(
    runner: Runner | None = None,
) -> V3dTrackIdOutputs:
    """
    FACTID-based tractography code for AFNI, part of FATCAT.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dTrackID.html
    
    Args:
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dTrackIdOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_TRACK_ID_METADATA)
    cargs = []
    cargs.append("3dTrackID")
    cargs.append("-mode")
    cargs.append("{DET")
    cargs.append("|")
    cargs.append("MINIP")
    cargs.append("|")
    cargs.append("PROB}")
    cargs.append("[ALL_REQUIRED_OPTIONS]")
    cargs.append("[MODEL_SPECIFIC_OPTIONS]")
    cargs.append("[MODE_SPECIFIC_OPTIONS]")
    cargs.append("[OTHER_OPTIONS]")
    ret = V3dTrackIdOutputs(
        root=execution.output_file("."),
        indimap=execution.output_file("[PREFIX]_INDIMAP.nii.gz"),
        pairmap=execution.output_file("[PREFIX]_PAIRMAP.nii.gz"),
        grid=execution.output_file("[PREFIX].grid"),
        niml_tract=execution.output_file("[PREFIX].niml.tract"),
        niml_dset=execution.output_file("[PREFIX].niml.dset"),
        trk=execution.output_file("[PREFIX].trk"),
        pairmap_labeltable=execution.output_file("[PREFIX]_PAIRS.niml.lt"),
        roi_labels=execution.output_file("[PREFIX]_roi.labs"),
        option_values=execution.output_file("[PREFIX].niml.opts"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dTrackIdOutputs",
    "V_3D_TRACK_ID_METADATA",
    "v_3d_track_id",
]
