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

import typing
import pathlib
from styxdefs import *
import dataclasses

EDDY_QUAD_METADATA = Metadata(
    id="7f05140209b6ebad40342feebc8da9b92d964042.boutiques",
    name="eddy_quad",
    package="fsl",
    container_image_tag="brainlife/fsl:6.0.4-patched2",
)


class EddyQuadOutputs(typing.NamedTuple):
    """
    Output object returned when calling `eddy_quad(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_dir_qc: OutputPathType | None
    """Quality control data outputs"""


def eddy_quad(
    eddy_base: str,
    eddy_index: InputPathType,
    eddy_params: InputPathType,
    mask: InputPathType,
    bvals: InputPathType,
    bvecs: InputPathType | None = None,
    output_dir: str | None = None,
    field: InputPathType | None = None,
    slspec: InputPathType | None = None,
    verbose: bool = False,
    runner: Runner | None = None,
) -> EddyQuadOutputs:
    """
    QUality Assessment for DMRI.
    
    Author: FMRIB Analysis Group, University of Oxford
    
    URL: https://fsl.fmrib.ox.ac.uk/fsl/fslwiki
    
    Args:
        eddy_base: Basename (including path) specified when running EDDY.
        eddy_index: File containing indices for all volumes into acquisition\
            parameters.
        eddy_params: File containing acquisition parameters.
        mask: Binary mask file.
        bvals: b-values file.
        bvecs: b-vectors file - only used when <eddyBase>.eddy_residuals file\
            is present.
        output_dir: Output directory - default = '<eddyBase>.qc'.
        field: TOPUP estimated field (in Hz).
        slspec: Text file specifying slice/group acquisition.
        verbose: Display debug messages.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `EddyQuadOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(EDDY_QUAD_METADATA)
    cargs = []
    cargs.append("eddy_quad")
    cargs.append(eddy_base)
    cargs.extend([
        "--eddyIdx",
        execution.input_file(eddy_index)
    ])
    cargs.extend([
        "--eddyParams",
        execution.input_file(eddy_params)
    ])
    cargs.extend([
        "--mask",
        execution.input_file(mask)
    ])
    cargs.extend([
        "--bvals",
        execution.input_file(bvals)
    ])
    if bvecs is not None:
        cargs.extend([
            "--bvecs",
            execution.input_file(bvecs)
        ])
    if output_dir is not None:
        cargs.extend([
            "--output-dir",
            output_dir
        ])
    if field is not None:
        cargs.extend([
            "--field",
            execution.input_file(field)
        ])
    if slspec is not None:
        cargs.extend([
            "--slspec",
            execution.input_file(slspec)
        ])
    if verbose:
        cargs.append("--verbose")
    ret = EddyQuadOutputs(
        root=execution.output_file("."),
        output_dir_qc=execution.output_file(output_dir) if (output_dir is not None) else None,
    )
    execution.run(cargs)
    return ret


__all__ = [
    "EDDY_QUAD_METADATA",
    "EddyQuadOutputs",
    "eddy_quad",
]
