How to use Image Iterators in right way

This might need to be openingFilter->SetInput(filter->GetOutput());