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

import typing
import pathlib
from styxdefs import *
import dataclasses

TBSS_3_POSTREG_METADATA = Metadata(
    id="8629f29c3ee03810baedd803bec842f121834cff.boutiques",
    name="tbss_3_postreg",
    package="fsl",
    container_image_tag="brainlife/fsl:6.0.4-patched2",
)


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


def tbss_3_postreg(
    derive_mean_from_study: bool = False,
    use_fmrib58: bool = False,
    runner: Runner | None = None,
) -> Tbss3PostregOutputs:
    """
    TBSS post-registration processing.
    
    Author: FMRIB Analysis Group, University of Oxford
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki
    
    Args:
        derive_mean_from_study: Derive mean_FA and mean_FA_skeleton from mean\
            of all subjects in study (recommended).
        use_fmrib58: Use FMRIB58_FA and its skeleton instead of study-derived\
            mean and skeleton.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `Tbss3PostregOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(TBSS_3_POSTREG_METADATA)
    cargs = []
    cargs.append("tbss_3_postreg")
    if derive_mean_from_study:
        cargs.append("-S")
    if use_fmrib58:
        cargs.append("-T")
    ret = Tbss3PostregOutputs(
        root=execution.output_file("."),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "TBSS_3_POSTREG_METADATA",
    "Tbss3PostregOutputs",
    "tbss_3_postreg",
]
