[Insight-developers] Going from Non-Streaming to Streaming I/O for a class

Williams, Norman K norman-k-williams at uiowa.edu
Mon Apr 25 14:44:09 EDT 2011


For HDF5, I've implemented writing and reading images in chunks, as a
pre-requisite for Streaming I/O.  Now I have a
couple of questions about how that works.

1.Is there any particular reason for inheriting from itk::StreamingIOBase?
I notice that some streamable I/O classes
inherit itk::ImageIOBase -- in fact most of them.

2. It appears that streamed reading has two requirements -- are there any
others?:
   A) implement GenerateStreamableReadRegionFromRequestedRegion.
   B) In Read, use this->GetIORegion() to decide where in the file to read.

3. Streamed Writing seems to depend on implementation of
GetActualNumberOfSplitsForWriting, but it's a bit
   confusing what to implement.  What seems to be happening is this:
   A) Implement GetActualNumberOfSplitsForWriting, and return the # of
chunks to write that the driver is capable of.
      In the case of HDF5, this can be anything from a single voxel to the
whole image.  I'm not sure though, what
      the pastedRegion and largestPossibleRegion are for -- are they
simply advisory, saying 'I'd like to be able to
      paste the region pastedRegion, and oh by the way, here's the
largestPossibleRegion for the file I want to write',
      or ... what?
   B) In Write, write out the region requested by m_IORegion, if possible
or throw an exception?

A good thing about HDF5 is that it can handle scatter/gather I/O -- you
set up the chunk size, and then you can write the image data all at once
and it divides it into chunks and writes it, optionally compressing each
chunk. Or you can write out a chunk at a time, out of order.
--
Kent Williams norman-k-williams at uiowa.edu






________________________________
Notice: This UI Health Care e-mail (including attachments) is covered by the Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential and may be legally privileged.  If you are not the intended recipient, you are hereby notified that any retention, dissemination, distribution, or copying of this communication is strictly prohibited.  Please reply to the sender that you have received the message in error, then delete it.  Thank you.
________________________________


More information about the Insight-developers mailing list