The mask or "validity mask" segment within an image file informs which pixels in the image are valid. There are several applications that use this facility or concept.
The data model with the "validity mask" segment is shown below.
Data model for mask operations
We will illustrate the use of it with an ultrasound image. Shown below is the ultasound image and we wish to compute the statistics of it. Note that there is a "black" area that contains no valid information.
Computing statistics on the image will include the entire "black" area.
If we incorporate a validity mask then the statistics computed on the image will not include the "black" area, i.e., only the unmasked data will be used for the computation. Shown below are the validity mask and the image with the validity mask segment.
--
Validity mask ---------------- Image with validity mask
The new statistics are shown below.