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

import typing
import pathlib
from styxdefs import *
import dataclasses

DTISTUDIO_FIBERTO_SEGMENTS_METADATA = Metadata(
    id="3af004da7dceeafdf7d648e011b0d4788bfd2bd3.boutiques",
    name="DTIStudioFibertoSegments",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class DtistudioFibertoSegmentsOutputs(typing.NamedTuple):
    """
    Output object returned when calling `dtistudio_fiberto_segments(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_segment_file: OutputPathType | None
    """Output SUMA segment file"""


def dtistudio_fiberto_segments(
    dataset: InputPathType,
    output_file: str | None = None,
    swap_flag: bool = False,
    runner: Runner | None = None,
) -> DtistudioFibertoSegmentsOutputs:
    """
    Convert a DTIStudio Fiber file to a SUMA segment file.
    
    Author: AFNI Team
    
    URL:
    https://afni.nimh.nih.gov/pub/dist/doc/program_help/DTIStudioFibertoSegments.html
    
    Args:
        dataset: Input dataset file.
        output_file: Name of the output file (default is rawxyzseg.dat).
        swap_flag: Swap bytes in data.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `DtistudioFibertoSegmentsOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(DTISTUDIO_FIBERTO_SEGMENTS_METADATA)
    cargs = []
    cargs.append("DTIStudioFibertoSegments")
    cargs.append(execution.input_file(dataset))
    if output_file is not None:
        cargs.extend([
            "-output",
            output_file
        ])
    if swap_flag:
        cargs.append("-swap")
    ret = DtistudioFibertoSegmentsOutputs(
        root=execution.output_file("."),
        output_segment_file=execution.output_file(output_file) if (output_file is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "DTISTUDIO_FIBERTO_SEGMENTS_METADATA",
    "DtistudioFibertoSegmentsOutputs",
    "dtistudio_fiberto_segments",
]
