Finding the Mean of 4D image using CImg Library

Hi!

I have an image im(100,100,100,35). This means that it is 100x100x100 in dimensions and each voxel contains 35 values. I would like to find the mean of this image, i.e. the average of each of the 35 values. This would mean I would result with a single 3D image of dimensions 100x100x100 with one single value assigned to each voxel. This value is the sum of all the 35 values divided by 35. Could you help me with the code required for that? I know CImg has a mean() function but I dont know how to implement it.

Thanks,
Last edited on
Topic archived. No new replies allowed.