Applying mask on the stack

I want to stack the several bands as a single item and apply a mask on all those stacked bands at once so that I don’t have to individually apply a mask to all the bands and VIs that I obtained. Do anyone have any idea on this ??

Thank you.

Please use only one topic for the same quesiton: Batch processing for VIs calculation

You can modify the title to adjust it to the problem.