This function processes a 3D image cube by summing the pixel intensities across all channels to compute a global intensity map, then filters out pixels whose total intensity falls outside a user-defined range specified by minimum and maximum thresholds. Additionally, it outputs both the indices of the retained pixels and those that were discarded, thereby effectively removing background pixels from the image data.