[Insight-developers] std::vector inide ImportImageContainer

Henning Meyer tutmann at gmail.com
Mon Sep 11 06:08:32 EDT 2006


Hello,

I'm wondering why ImportImageContainer does not use std::vector and
its iterator.
Instead everywhere I see raw pointers and allocations via new.
What was the reason for this decision?
Is it feasable to modify everything to support std::vector (or even a
generic random accessable container)?
Where would be the difficult points? What would the drawbacks be?

I would really like to do this, because then I could have an
itk::Image< bool, 3 > why simply uses just one bit per pixel instead
of 8 bits (due to partial specialization inside STL for std::vector<
bool >).
Also I think it could be quite easy then to create sparse image
support ( with std::map< OffsetType, PixelType > inside the container
).

What do you think about this?
When using std::vector there shouldn't be any performance drawbacks...

Henning


More information about the Insight-developers mailing list