I had a class which was deriving from ImageToImage filter and in its constructor I was setting Inputs and Outputs in the following manner:
ImageToImage
this->S