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

import typing
import pathlib
from styxdefs import *
import dataclasses

TRAC_ALL_METADATA = Metadata(
    id="73a5f89795c73c559ddd404cdcdd1e92ea957a5a.boutiques",
    name="trac-all",
    package="freesurfer",
    container_image_tag="freesurfer/freesurfer:7.4.1",
)


class TracAllOutputs(typing.NamedTuple):
    """
    Output object returned when calling `trac_all(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    default_log: OutputPathType
    """Default log file"""
    default_cmd: OutputPathType
    """Default command file"""


def trac_all(
    config_file: InputPathType | None = None,
    subject_name: str | None = None,
    dicom_file: InputPathType | None = None,
    assemble_measures: bool = False,
    no_pathway_priors: bool = False,
    help_: bool = False,
    runner: Runner | None = None,
) -> TracAllOutputs:
    """
    Reconstruct white-matter pathways using an atlas of the underlying anatomy.
    
    Author: FreeSurfer Developers
    
    URL: https://github.com/freesurfer/freesurfer
    
    Args:
        config_file: Configuration file to set analysis options (dmrirc file).
        subject_name: Subject name (if not defined in dmrirc).
        dicom_file: Input DWI DICOM (if not defined in dmrirc).
        assemble_measures: Assemble pathway measures from multiple subjects\
            (step 4).
        no_pathway_priors: Skip pathway priors (step 1.6).
        help_: Print full contents of help.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `TracAllOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(TRAC_ALL_METADATA)
    cargs = []
    cargs.append("trac-all")
    if config_file is not None:
        cargs.extend([
            "-c",
            execution.input_file(config_file)
        ])
    if subject_name is not None:
        cargs.extend([
            "-s",
            subject_name
        ])
    if dicom_file is not None:
        cargs.extend([
            "-i",
            execution.input_file(dicom_file)
        ])
    if assemble_measures:
        cargs.append("-stat")
    if no_pathway_priors:
        cargs.append("-noprior")
    if help_:
        cargs.append("-help")
    ret = TracAllOutputs(
        root=execution.output_file("."),
        default_log=execution.output_file("scripts/trac-all.log"),
        default_cmd=execution.output_file("scripts/trac-all.cmd"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "TRAC_ALL_METADATA",
    "TracAllOutputs",
    "trac_all",
]
