How to compare a slice and its next?

I have a series of CT slice and I want to compare these ones in the axial view, because I want to delete elements in the slice, that not appear in the following slices. Is there any function in ITK or OpenCV, that can perform this task?