[Insight-developers] Proposal: Add more streaming IO with a base class

Bradley Lowekamp blowekamp at mail.nih.gov
Thu Nov 12 13:13:47 EST 2009


Hello,

	Recently I have gotten itkVTKImageIO to perform IO streaming. This was done by re-use a class I had already written: itkStreamingImageIOBase which is derived from itkImageIOBase. It adds streaming methods that were implemented in itkMetaImageIO for IO region management, a long with:

bool StreamingImageIOBase::StreamWriteBufferAsBinary(std::ostream& file, const void *_buffer);
bool StreamingImageIOBase::StreamReadBufferAsBinary(std::istream& file, void *_buffer);

Details can be found here:
http://erie.nlm.nih.gov/cgi-bin/viewvc.cgi/Repository/blowekamp/itkCommandLineTools/trunk/itkLocal/itkStreamingImageIOBase.cxx?revision=5226&view=markup

With this class it was easy to make itkVTKImageIO stream, just by keeping track of the header size, and calling the appropriate BufferAsBinary method (unless the file is ASCII of course).

I thought about just doing an IJ submission, but all the tests are already in ITK so that would be more work. Since this is just adding a feature to an existing class in a well structured and flexible way does this need to  be an IJ submission?

Brad

========================================================
Bradley Lowekamp  
Lockheed Martin Contractor for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20091112/67863f4b/attachment.htm>


More information about the Insight-developers mailing list