I have a 4D array V, with the size [144 144 12 25]. In fact, it is a 4D medical image with 12 stacked slices in 25 different time. I want to apply a mask, named M, to each image in the array in a vectorized way. M is a 144x144 array containing logical values. Could someone help me how to do it?