ITK  4.12.0
Insight Segmentation and Registration Toolkit
WikiExamples/Developer/ImageSource.cxx
#include "itkImage.h"
#include "MyImageSource.h"
int main(int, char*[])
{
// Setup types
typedef itk::Image<unsigned char, 2> ImageType;
typedef itk::MyImageSource<ImageType> FilterType;
// Create and the filter
filter->Update();
filter->GetOutput()->Print(std::cout);
writer->SetFileName("Test.jpg");
writer->SetInput(filter->GetOutput());
writer->Update();
return EXIT_SUCCESS;
}