# 3.3.3.70. NXcs_filter_boolean_mask¶

**Status**:

base class, extends NXobject

**Description**:

## Computer science base class for packing and unpacking booleans. ...

Computer science base class for packing and unpacking booleans.

One use case is processing of object sets (like point cloud data). When one applies e.g. a spatial filter to a set of points to define which points are analyzed and which not, it is useful to document which points were taken. One can store this information in a compact manner with an array of boolean values. If the value is True the point is taken, else it is not.

If the points are identified by an array of integer identifiers and an arbitrary spatial filtering, the boolean array will be filled with True and False values in an arbitrary manner. Especially when the number of points is large, for instance several thousands and more, some situations can be more efficiently stored if one would not store the boolean array but just list the identifiers of the points taken. For instance if within a set of 1000 points only one point is taken, it would take (naively) 4000 bits to store the array but only 32 bits to store e.g. the ID of that taken point. Of course the 4000 bit field is so sparse that it could be compressed resulting also in a substantial reduction of the storage demands. Therefore boolean masks are useful compact descriptions to store information about set memberships in a compact manner. In general it is true, though, that which representation is best, i.e. most compact (especially when compressed) depends strongly on occupation of the array.

This base class just bookkeeps metadata to inform software about necessary modulo operations to decode the set membership of each object. This is useful because the number of objects not necessarily is an integer multiple of the bit depth.

**Symbols**:

The symbols used in the schema to specify e.g. dimensions of arrays.

n_objs: Number of entries (e.g. number of points or objects).

bitdepth: Number of bits assumed for the container datatype used.

n_total: Length of mask considering the eventual need for padding.

**Groups cited**:none

**Structure**:

number_of_objects: (optional) NX_UINT {units=NX_UNITLESS}Number of objects represented by the mask.

bitdepth: (optional) NX_UINT {units=NX_UNITLESS}## Number of bits assumed matching on a default datatype. ...

Number of bits assumed matching on a default datatype. (e.g. 8 bits for a C-style uint8).

mask: (optional) NX_UINT (Rank: 1, Dimensions: [n_total]) {units=NX_UNITLESS}## The unsigned integer array representing the content of the mask. ...

The unsigned integer array representing the content of the mask. If padding is used the padded bits have to be set to 0.

identifier: (optional) NX_UINT (Rank: 1, Dimensions: [n_object])## Link to/or array of identifiers for the objects. The decoded mask is ...

Link to/or array of identifiers for the objects. The decoded mask is interpreted consecutively, i.e. the first bit in the mask matches to the first identifier, the second bit in the mask to the second identifier and so on and so forth.

## Hypertext Anchors¶

List of hypertext anchors for all groups, fields, attributes, and links defined in this class.