[Insight-developers] HOWTO: For testing -- force streaming write?

Williams, Norman K norman-k-williams at uiowa.edu
Fri Apr 29 16:58:49 EDT 2011


I'm a bit confused about actually testing streaming writing in an ImageIO
test.


in
ITK/Modules/IO/Base/test/itkImageFileWriterStreamingPastingCompressingTest1
.cxx, it looks as though the only thing done to force streaming is to call
ImageIOBase::SetNumberOfStreamDivisions.

Which is what I copied.

But in stepping through itk::HDF5ImageIO, I noticed that instead of
breaking up the write operation into several streamed sub-writes, it was
always requesting a write of the whole image at one go.

But stepping into itk::ImageFileWriter, there's this business (around line
339):

      InputImageRegionType bufferedRegion = input->GetBufferedRegion();
      if ( bufferedRegion == largestRegion )
        {
        // if so, then just write the entire image
        itkDebugMacro("Requested stream region  matches largest region
input filter may not support streaming well.");
        itkDebugMacro("Writer is not streaming now!");
        numDivisions = 1;
        streamRegion = largestRegion;
        ImageIORegionAdaptor< TInputImage::ImageDimension >::
        Convert( streamRegion, streamIORegion, largestRegion.GetIndex() );
        }


Since the input is an Image, it's buffered region is equal to it's largest
region, so it doesn't actually perform streamed writing at all.

In fact, it looks like you can't make itk::ImageFileWriter stream an input
image at all, unless you somehow monkey around with its buffered region,
something I don't even begin to understand.

Or am I missing something?



________________________________
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