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

import typing
import pathlib
from styxdefs import *
import dataclasses

CIFTI_PAIRWISE_CORRELATION_METADATA = Metadata(
    id="df423945fb398876763bf3f54f287e041e7abe8c.boutiques",
    name="cifti-pairwise-correlation",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


class CiftiPairwiseCorrelationOutputs(typing.NamedTuple):
    """
    Output object returned when calling `cifti_pairwise_correlation(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    cifti_out: OutputPathType
    """output cifti file"""


def cifti_pairwise_correlation(
    cifti_a: InputPathType,
    cifti_b: InputPathType,
    cifti_out: str,
    opt_fisher_z: bool = False,
    opt_override_mapping_check: bool = False,
    runner: Runner | None = None,
) -> CiftiPairwiseCorrelationOutputs:
    """
    Correlate paired rows between two cifti files.
    
    For each row in <cifti-a>, correlate it with the same row in <cifti-b>, and
    put the result in the same row of <cifti-out>, which has only one column.
    
    Author: Washington University School of Medicin
    
    Args:
        cifti_a: first input cifti file.
        cifti_b: second input cifti file.
        cifti_out: output cifti file.
        opt_fisher_z: apply fisher small z transform (ie, artanh) to\
            correlation.
        opt_override_mapping_check: don't check the mappings for compatibility,\
            only check length.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `CiftiPairwiseCorrelationOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(CIFTI_PAIRWISE_CORRELATION_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-cifti-pairwise-correlation")
    cargs.append(execution.input_file(cifti_a))
    cargs.append(execution.input_file(cifti_b))
    cargs.append(cifti_out)
    if opt_fisher_z:
        cargs.append("-fisher-z")
    if opt_override_mapping_check:
        cargs.append("-override-mapping-check")
    ret = CiftiPairwiseCorrelationOutputs(
        root=execution.output_file("."),
        cifti_out=execution.output_file(cifti_out),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "CIFTI_PAIRWISE_CORRELATION_METADATA",
    "CiftiPairwiseCorrelationOutputs",
    "cifti_pairwise_correlation",
]
