View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008323ITKpublic2008-12-22 11:562009-03-11 10:03
ReporterBradley Lowekamp 
Assigned ToBradley Lowekamp 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in VersionITK-3-12 
Summary0008323: An Implementation of streaming for ImageFileWriter with collaboration from ImageIOBase
DescriptionAttached is a patch which include updates to ImageFileWriter, ImageIOBase, and itkMetaImageIO.

A virtual method was added to ImageIOBase to generate RegionsSplitters specific for a ImageIO object. MetaImageIO got a implementation of this.

The way ImageFileWriter executes the pipeline was modified to drive streaming. Some correction and miss matching tolerance was added to passing buffers to ImageIO.
Additional Information
Before this patch itkMetaImageStreamingWriterIOTest2 was passing with incorrect/blank output.

Luis gave the following description of what needed to be done (and I did it):
The design proposal for implementing this feature is to move
(copy/paste) part of the code that you find in the itkStreamingImageFilter (in Code/BasicFilters) to the
itkImageFileWriter class.

In particular, the proposal is to use the itkImageRegionSplitter
inside the ImageFileWriter.

During the design discussions, one of the issues that came up
is that only the specific ImageIO classes are qualified to know
what would be the appropriate way to split the data in order to
match the type of blocks that the output image file format can
manage (e.g. DICOM can only stream slices).


Therefore, the suggested design is that the ImageFileWriter
will ask the ImageIO class to provide a specific instance of
an itkImageRegionSplitter, and then it will use it in a for
loop for generating sub-regions of the image, and request
them from the preceding image filters.

Until this is implemented, then your best options, is to do
just what you are doing: using the itkStreamingImageFilter
just before the ImageFileWriter. The drawback of course is
that you have to whole in memory the full-size output image
before being able to write it to disk.

TagsNo tags attached.
Resolution Date
Sprint
Sprint Status
Attached Filesdiff file icon StreamingFileWriter.diff [^] (15,066 bytes) 2008-12-22 11:56 [Show Content]

 Relationships
related to 0008333closedBradley Lowekamp MetaImageIO does not read correctly stream with non-uniform image spacing 
related to 0008369closedBradley Lowekamp Some VectorImage filters set output information in AllocateOutputs 

  Notes
(0014416)
Bradley Lowekamp (developer)
2008-12-22 12:02

Basic usage for a MetaIO file:

reader->SetUseStreaming(true)
writer->SetInput( reader->GetOutput() );
writer->SetNumberOfStreamDivisions(numberOfDataPieces);
writer->SetUseStreaming(true);
writer->Update();
(0014453)
Bradley Lowekamp (developer)
2008-12-30 14:56

This is an experimental build with these changes:

http://www.cdash.org/CDash/buildSummary.php?buildid=240632 [^]
(0014543)
Bradley Lowekamp (developer)
2009-01-13 09:53

This was discussed at the NAMIC project week:
http://www.itk.org/Wiki/Proposals:Adding_Streaming_Support_in_ITK_Image_Writing [^]
(0014544)
Bradley Lowekamp (developer)
2009-01-13 10:23

The revised design was commited
http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/IO/itkImageFileWriter.h.diff?cvsroot=Insight&r1=1.20&r2=1.21 [^]
http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/IO/itkImageFileWriter.txx.diff?cvsroot=Insight&r1=1.56&r2=1.57 [^]
http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/IO/itkImageIOBase.cxx.diff?cvsroot=Insight&r1=1.80&r2=1.81 [^]
http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/IO/itkImageIOBase.h.diff?cvsroot=Insight&r1=1.49&r2=1.50 [^]
(0015147)
Bradley Lowekamp (developer)
2009-02-18 12:57

Streaming writing is now working

 Issue History
Date Modified Username Field Change
2008-12-22 11:56 Bradley Lowekamp New Issue
2008-12-22 11:56 Bradley Lowekamp File Added: StreamingFileWriter.diff
2008-12-22 12:02 Bradley Lowekamp Note Added: 0014416
2008-12-30 14:56 Bradley Lowekamp Note Added: 0014453
2009-01-13 09:53 Bradley Lowekamp Note Added: 0014543
2009-01-13 10:23 Bradley Lowekamp Note Added: 0014544
2009-01-13 10:38 Bradley Lowekamp Relationship added related to 0008333
2009-01-13 10:56 Bradley Lowekamp Relationship added related to 0008369
2009-01-13 10:57 Bradley Lowekamp Status new => assigned
2009-02-05 13:19 Bradley Lowekamp Assigned To => Bradley Lowekamp
2009-02-18 12:57 Bradley Lowekamp Note Added: 0015147
2009-02-18 12:57 Bradley Lowekamp Status assigned => resolved
2009-02-18 12:57 Bradley Lowekamp Resolution open => fixed
2009-03-11 10:03 Bradley Lowekamp Status resolved => closed
2009-03-11 10:03 Bradley Lowekamp Fixed in Version => ITK-3-12


Copyright © 2000 - 2018 MantisBT Team