How to use Image Iterators in right way

Thank you!! And i want to know how apply image filter on dicom series? All example is base on single image .Now i read a dicom series and i want to do the same processing on every slice,for example opening operation. But it didn`t work. i want to konw how to apply it in right way.

using ImageType = itk::Image< PixelType, 3>;
using FilterType = itk::OtsuThresholdImageFilter<
	ImageType, ImageType >;

FilterType::Pointer filter = FilterType::New();

filter->SetInput(reader->GetOutput());

try
{
	filter->Update();
}
catch (itk::ExceptionObject & excp)
{
	std::cerr << "Exception thrown " << excp << std::endl;
}
filter->SetOutsideValue(0);
filter->SetInsideValue(1000);
int threshold = filter->GetThreshold();
std::cout << "Threshold = " << threshold << std::endl;
//////////////////
using StructuringElementType = itk::BinaryBallStructuringElement<ImageType::PixelType, ImageType::ImageDimension>;
StructuringElementType structuringElement;
structuringElement.SetRadius(15);
structuringElement.CreateStructuringElement();
  using BinaryMorphologicalOpeningImageFilterType =
	itk::BinaryMorphologicalOpeningImageFilter<ImageType, ImageType, StructuringElementType>;
BinaryMorphologicalOpeningImageFilterType::Pointer openingFilter = BinaryMorphologicalOpeningImageFilterType::New();
openingFilter->SetInput(mathOperationFilter->GetOutput());
openingFilter->SetKernel(structuringElement);
try
{
	openingFilter->Update();
}
catch (itk::ExceptionObject & excp)
{
	std::cerr << "Exception thrown " << excp << std::endl;
}

Here is the code ,the otsu part works but the opening part does not work, do you have any advice?