asMaskVector: Masks over spatial locations

asMaskVectorR Documentation

Masks over spatial locations

Description

A mask selects spatial locations, for example to restrict voxelApply() to a region of interest. It may be given in several forms, and this function reduces any of them to one logical value per location.

Usage

asMaskVector(mask, spatialDims)

Arguments

mask

A logical array, a numeric array in which non-zero values are selected, a sparse image whose own mask is used, or any other image, which is treated as a numeric array.

spatialDims

The spatial dimensions the mask must cover, or an image or imageGeometry to take them from.

Value

A logical vector with one element per spatial location.


imply documentation built on Nov. 20, 2026, 5:12 p.m.