[Insight-developers] Small modification to ImportImageContainer

Tom Vercauteren tom.vercauteren at m4x.org
Thu Mar 19 10:51:46 EDT 2009


Hi,

At my company, we needed to have ITK images for which buffers are
ensured to be aligned (say on 8 bits). This can be done by overloading
itk::Image and itk::ImportImageContainer.

However, it also requires a patch to ImportImageContainer for it to be
"overloadable". Basically, the attached patch only amounts to:
1) Putting all the memory deallocation in a single virtual function
2) Moving some member variables from private to protected

There should be no backward compatibility issue with this. All unit
tests are still green on my computer.


By looking into ImportImageContainer, I also realized that Reserve is
wrong in the sense that it has a Resize semantics. This is similar to
the following VectorContainer and the MapContainer bug:
http://www.itk.org/Bug/view.php?id=2893

Since it was decided not to fix bug 2893, I haven't fixed
ImportImageContainer::Reserve either but simply added some comments to
the file.

Let me know if you see any potential problem with this patch.

Thanks,
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: itk-importcontainer.patch
Type: text/x-patch
Size: 4541 bytes
Desc: not available
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20090319/f12b2688/attachment.bin>


More information about the Insight-developers mailing list