void main() { DilationFunctionType::Pointer dilationFunction = DilationFunctionType::New(); dilationFunction->SetInput(imageReader->GetOutput()); dilationFunction->SetVectorImage1(vectorImageReader1->GetOutput()); dilationFunction->SetVectorImage2(vectorImageReader2->GetOutput()); dilationFunction->SetSELength(SELength); dilationFunction->SetEigenImage(eigImageReader->GetOutput()); dilationFunction->SetStructuringElementImage(SEFunction->GetOutput()); try{ dilationFunction->Update(); } catch (itk::ExceptionObject &e) { std::cerr << e << std::endl; } SEFunction->SetVectorImage1(dilationFunction->GetVector1Output()); SEFunction->SetVectorImage2(dilationFunction->GetVector2Output()); SEFunction->SetSELength(SELength); try{ SEFunction->Update(); } catch (itk::ExceptionObject &e) { std::cerr << e << std::endl; } ErosionFunctionType::Pointer erosionFunction = ErosionFunctionType::New(); erosionFunction->SetInput(dilationFunction->GetOutput()); erosionFunction->SetVectorImage1(dilationFunction->GetVector1Output()); erosionFunction->SetVectorImage2(dilationFunction->GetVector2Output()); erosionFunction->SetSELength(SELength); erosionFunction->SetEigenImage(eigImageReader->GetOutput()); erosionFunction->SetStructuringElementImage(SEFunction->GetOutput()); try{ erosionFunction->Update(); } catch (itk::ExceptionObject &e) { std::cerr << e << std::endl; } }