Question about how masks are used

Hi all,

When I open up masks that I have used in local refinements (or any masks for any refinement) in chimeraX, I am able to change the threshold level where I can get them to expand or contract based no the threshold level (just like any volumes). Is there a certain threshold level at which masks are applied to refinements?

Hi @gmperez! This is a great question, let me see if I can help clear things up!

What is a contour?

It sounds like you already are aware of this, but just so we’re all on the same page. When you change the threshold, you’re selecting a contour of the volume to show. Our volumes are really 4D objects: three dimensions to describe the position of the voxel, and a fourth dimension to describe the value inside that voxel.

Because we don’t have 4D displays, we show an isosurface of the volume — you show the surface that encloses the values with your selected threshold.

Here’s an example of changing a contour for a flat object to illustrate what I mean:

You can see that when we set the contour to 5, we stop showing the pixels which have a value less than five. The same thing is happening in the volume — the volume occupies your entire box, but you’re just picking which voxels to show and which voxels to hide.

How is the mask applied?

When we apply a mask, we multiply the value in each voxel of the map by the value in the same voxel of the mask. This is why your map and mask must be exactly the same size. It also means that the mask is not applied as a binary at a certain threshold.

As you can see, when we multiply the map by the mask, we get a smooth edge from 0.0 (outside the mask) to 1.0 (inside the mask). Where the mask is 1.0, the map is unchanged.

I hope that is helpful! We have more information about masks in our recently-updated guide page, too!

6 Likes