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

import typing
import pathlib
from styxdefs import *
import dataclasses

CIFTI_RESTRICT_DENSE_MAP_METADATA = Metadata(
    id="b24c61221e5bb2198d65942d58627263daee752d.boutiques",
    name="cifti-restrict-dense-map",
    package="workbench",
    container_image_tag="brainlife/connectome_workbench:1.5.0-freesurfer-update",
)


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


def cifti_restrict_dense_map(
    cifti_in: InputPathType,
    direction: str,
    cifti_out: str,
    opt_cifti_roi_roi_cifti: InputPathType | None = None,
    opt_left_roi_roi_metric: InputPathType | None = None,
    opt_right_roi_roi_metric: InputPathType | None = None,
    opt_cerebellum_roi_roi_metric: InputPathType | None = None,
    opt_vol_roi_roi_vol: InputPathType | None = None,
    runner: Runner | None = None,
) -> CiftiRestrictDenseMapOutputs:
    """
    Exclude brainordinates from a cifti file.
    
    Writes a modified version of <cifti-in>, where all brainordinates outside
    the specified roi(s) are removed from the file. The direction can be either
    an integer starting from 1, or the strings 'ROW' or 'COLUMN'. If -cifti-roi
    is specified, no other -*-roi option may be specified. If not using
    -cifti-roi, any -*-roi options not present will discard the relevant
    structure, if present in the input file.
    
    Author: Connectome Workbench Developers
    
    URL: https://github.com/Washington-University/workbench
    
    Args:
        cifti_in: the input cifti.
        direction: which dimension to change the mapping on (integer, 'ROW', or\
            'COLUMN').
        cifti_out: the output cifti.
        opt_cifti_roi_roi_cifti: cifti file containing combined rois: the rois\
            as a cifti file.
        opt_left_roi_roi_metric: vertices to use from left hemisphere: the left\
            roi as a metric file.
        opt_right_roi_roi_metric: vertices to use from right hemisphere: the\
            right roi as a metric file.
        opt_cerebellum_roi_roi_metric: vertices to use from cerebellum: the\
            cerebellum roi as a metric file.
        opt_vol_roi_roi_vol: voxels to use: the roi volume file.
        runner: Command runner.
    Returns:
        NamedTuple of outputs (described in `CiftiRestrictDenseMapOutputs`).
    """
    runner = runner or get_global_runner()
    execution = runner.start_execution(CIFTI_RESTRICT_DENSE_MAP_METADATA)
    cargs = []
    cargs.append("wb_command")
    cargs.append("-cifti-restrict-dense-map")
    cargs.append(execution.input_file(cifti_in))
    cargs.append(direction)
    cargs.append(cifti_out)
    if opt_cifti_roi_roi_cifti is not None:
        cargs.extend([
            "-cifti-roi",
            execution.input_file(opt_cifti_roi_roi_cifti)
        ])
    if opt_left_roi_roi_metric is not None:
        cargs.extend([
            "-left-roi",
            execution.input_file(opt_left_roi_roi_metric)
        ])
    if opt_right_roi_roi_metric is not None:
        cargs.extend([
            "-right-roi",
            execution.input_file(opt_right_roi_roi_metric)
        ])
    if opt_cerebellum_roi_roi_metric is not None:
        cargs.extend([
            "-cerebellum-roi",
            execution.input_file(opt_cerebellum_roi_roi_metric)
        ])
    if opt_vol_roi_roi_vol is not None:
        cargs.extend([
            "-vol-roi",
            execution.input_file(opt_vol_roi_roi_vol)
        ])
    ret = CiftiRestrictDenseMapOutputs(
        root=execution.output_file("."),
        cifti_out=execution.output_file(cifti_out),
    )
    execution.run(cargs)
    return ret


__all__ = [
    "CIFTI_RESTRICT_DENSE_MAP_METADATA",
    "CiftiRestrictDenseMapOutputs",
    "cifti_restrict_dense_map",
]
