[Insight-users] Writing and Streaming
Bradley Lowekamp
blowekamp at mail.nih.gov
Thu Dec 4 09:33:46 EST 2008
Greetings all!
I am trying to stream my data set. I see that MetaIO supports
streaming for reading and writing. But I don't seem to be able to use
it for writing. I am trying to stream my 13GB data set from a
ImageFileReader through a ShrinkImageFilter then write is out with a
ImageFileWriter. If I replace the writer with a StreamingImageFilter
it works great, the reader streams and everything.
To get the writer to stream (or not) I am doing this:
shrinker->UpdateOutputInformation();
RGBVolumeType::RegionType outputRegion = shrinker->GetOutput()-
>GetLargestPossibleRegion();
itk::ImageRegionSplitter<3>::Pointer splitter =
itk::ImageRegionSplitter<3>::New();
numberOfSplits = splitter->GetNumberOfSplits(outputRegion,
numberOfSplits);
writer->SetFileName( outputFilePN.GetPathName());
writer->SetInput(shrinker->GetOutput());
for(unsigned int i = 0; i < numberOfSplits; ++i) {
RGBVolumeType::RegionType streamRegion = splitter->GetSplit(i,
numberOfSplits, outputRegion);
ioRegion = streamRegion; // sudo code
writer->SetIORegion(ioRegion);
writer->Update();
}
Is this the correct approach? Does anyone have an example of streaming
writing?
I think I am going to dig though the ImageFileWriter now to see what
are the updates going on in the pipeline execution. I still a bit
fuzzy on these details, so may miss something.
Please let me know of any suggestions.
Thanks,
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/pipermail/insight-users/attachments/20081204/fa9be2f2/attachment.htm>
More information about the Insight-users
mailing list