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

import typing
import pathlib
from styxdefs import *
import dataclasses

V_3D_TFITTER_METADATA = Metadata(
    id="ebe3239eb8a2ffc8eab35fc3eaf4d336d88af085.boutiques",
    name="3dTfitter",
    package="afni",
    container_image_tag="afni/afni_make_build:AFNI_24.2.06",
)


class V3dTfitterOutputs(typing.NamedTuple):
    """
    Output object returned when calling `v_3d_tfitter(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    output_prefix: OutputPathType
    """Output dataset for LHS parameters."""
    fitted_time_series: OutputPathType
    """Output fitted time series dataset."""
    error_sums: OutputPathType
    """Output error sums dataset."""


def v_3d_tfitter(
    runner: Runner | None = None,
) -> V3dTfitterOutputs:
    """
    * At each voxel, assembles and solves a set of linear equations.
    ++ The matrix at each voxel may be the same or may be different.
    ++ This flexibility (for voxel-wise regressors) is one feature
    that makes 3dTfitter different from 3dDeconvolve.
    ++ Another distinguishing feature is that 3dTfitter allows for
    L2, L1, and L2+L1 (LASSO) regression solvers, and allows you
    to impose sign constraints on the solution parameters.
    
    Author: AFNI Team
    
    URL: https://afni.nimh.nih.gov/pub/dist/doc/program_help/3dTfitter.html
    
    Args:
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `V3dTfitterOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(V_3D_TFITTER_METADATA)
    cargs = []
    cargs.append("3dTfitter")
    cargs.append("[ARGS]")
    ret = V3dTfitterOutputs(
        root=execution.output_file("."),
        output_prefix=execution.output_file("[PREFIX].nii.gz"),
        fitted_time_series=execution.output_file("[FITTS].nii.gz"),
        error_sums=execution.output_file("[ERRSUM].nii.gz"),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "V3dTfitterOutputs",
    "V_3D_TFITTER_METADATA",
    "v_3d_tfitter",
]
