Can't understand multi intensity valued mask
...masks are more refined images only emphasizing required portions and setting remaining to 0.

A mask is usually a binary bitmap that uses 1 at some location $(x,y)$ to indicate that it &quot;selects&quot; or &quot;uses&quot; or &quot;includes&quot; that pixel in the region of interest it defines.
The values that you see in your mask are not so much related to the mask but to its labeling.

...in the given mask, how come there are different intensity values for nuclei?

Each intensity value &quot;tags&quot; a different region. In other words, if your mask is in some $M$, then by evaluating $M == u$ where $u$ is a positive integer (say for example 5), then you would &quot;select&quot; all (connected) pixels that belong to the region of interest that has been labeled as &quot;5&quot;.

Is it due to the fact that some nuclei are strongly represented and some are weakly represented?

No.
Also, &quot;no&quot; to #2 and &quot;yes but not exactly&quot; to #3: To get the behaviour described in #3 you would have to first &quot;select&quot; the mask (which casts it to a boolean) and then use it in logic expressions.
So, to get your bounding boxes all you have to do is iterate through the labels of the mask, extract it (with something like &quot;where mask==label, set to 1 else 0&quot; and find the min, max of the $x,y$ components of the pixel location.
Hope this helps.