#include"itkSliceBySliceImageFilter.h"
typedef itk::Image< unsigned char, 2 > SliceImageType;
auto fillHoleFilter = itk::BinaryFillholeImageFilter<SliceImageType>::New();
typedef itk::Image< unsigned char, 3 > charImageType;
auto sliceBySlice = itk::SliceBySliceImageFilter< charImageType, charImageType>::New();
sliceBySlice->SetFilter( fillHoleFilter );
sliceBySlice->SetInput( 3DImageData );
sliceBySlice->SetDimension( 2 );
sliceBySlice->Update();
auto Image = sliceBySlice->GetOutput(); //3D