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

import typing
import pathlib
from styxdefs import *
import dataclasses

METRIC_MASK_METADATA = Metadata(
    id="8b0c7834f326fc5492985a67883c6b3a2ba9c186.boutiques",
    name="metric-mask",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


class MetricMaskOutputs(typing.NamedTuple):
    """
    Output object returned when calling `metric_mask(...)`.
    """
    root: OutputPathType
    """Output root folder. This is the root folder for all outputs."""
    metric_out: OutputPathType
    """the output metric"""


def metric_mask(
    metric: InputPathType,
    mask: InputPathType,
    metric_out: str,
    opt_column_column: str | None = None,
    runner: Runner | None = None,
) -> MetricMaskOutputs:
    """
    Mask a metric file.
    
    By default, the output metric is a copy of the input metric, but with zeros
    wherever the mask metric is zero or negative. if -column is specified, the
    output contains only one column, the masked version of the specified input
    column.
    
    Author: Washington University School of Medicin
    
    Args:
        metric: the input metric.
        mask: the mask metric.
        metric_out: the output metric.
        opt_column_column: select a single column: the column number or name.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `MetricMaskOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(METRIC_MASK_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-metric-mask")
    cargs.append(execution.input_file(metric))
    cargs.append(execution.input_file(mask))
    cargs.append(metric_out)
    if opt_column_column is not None:
        cargs.extend([
            "-column",
            opt_column_column
        ])
    ret = MetricMaskOutputs(
        root=execution.output_file("."),
        metric_out=execution.output_file(metric_out),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "METRIC_MASK_METADATA",
    "MetricMaskOutputs",
    "metric_mask",
]
