If you want the mean of all rows in every page(3rd dimension)
for columns in every page
and mean of pages,
if you're looking to calculate the mean of all elements in a page, mean2 would be something
mean2(ImageROI(:,:,pageNo))
without a loop, probably with reshape,
mean(reshape(ImageROI,[],size(ImageROI,2),1))