[Insight-users] Pasting with StreamingImageIOBase
Bradley Lowekamp
blowekamp at mail.nih.gov
Wed Dec 5 21:19:19 EST 2012
Hello,
I don't think that the HDF5 ImageIO supports that feature. Try the MetaIO or mha file type.
This is the example I wrote to do what you want:
https://github.com/Kitware/ITK/blob/master/Examples/IO/VisibleHumanPasteWrite.cxx
Brad
On Dec 5, 2012, at 1:22 PM, Matthias Schneider <schneider at vision.ee.ethz.ch> wrote:
> Hi,
>
> I'm trying to understand the itk IO streaming capabilities (ITK v4.2.1).
> The documentation of StreamingImageIOBase says:
>
>> The implementation supports streaming of an arbitrary sized region
>> as well as pasting to new or existing file ( of the same name, size, > and pixel type ).
>
> I played around with the HDF5 file format but I couldn't get the "pasting into existing file" part to work. I'm not sure if I have a wrong understanding of ImageFileWriter::SetIORegion but it seems like "pasting" is rather "overwriting".
>
> I attached a piece of code.
> What it does is to set up a small volume (16x32x64, double pixel values), initialize all voxels to 1, write the volume as a HDF5 file.
> In a second step I'm trying to paste a single slice (16x32) into the existing file. The pasted values seem to be correct but the remaining pixel values in all other slices seem to be random.
> Before digging further into this I was hoping to at least get an idea if I am using the pipeline correctly or if there might be a bug in the streaming/HDF5/documentation.
>
> Any comments are appreciated very much!
>
> Thank you very much!
>
> Best,
> Matthias
> <test.tar.gz>_____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
More information about the Insight-users
mailing list