[Insight-developers] Image memory model

daum volker.daum at informatik.uni-erlangen.de
Sat May 24 15:43:29 EDT 2008


Hi all,

Just a quick thought about introducing "alternative" image types like a
discontiguous image model:

I have always been very fond of the way the STL handles its iterators: Every
container knows best which iterators to use to iterate over it and provides
those through typedefs and constructor methods (begin(), end() etc.).

I guess this was not done in ITK to make it easier to add new iterators. On
the other hand something like that (typedefs and construction methods like
itk::Image::ConstructImageRegionIterator or something like that) could
easily be added without breaking anything. Any filter that constructs its
iterators using such a mechanism (and using only the iterators to do its
work) would not have to care about the memory model or anything else. Any
filter that needs GetBufferPointer or the like would just not work with any
image different from itk::Image (which would probably be ok in the case that
the buffer pointer is "needed"). And all filters not converted to use those
construction methods would still work with itk::Image, but not with any new
image type you might introduce. So a slow step by step introduction of those
functions and new image types is possible (basically you can convert each
filter whenever the need arises to use it with the new image type).

This way there would also be no performance hits (as is feared in the
proposal), as long as normal itk::Image is used, since everything works by
templating (no virtual functions or the like).

Just an idea.

Cheers,
Volker


---
Dipl.-Inf. Volker Daum
Lehrstuhl fuer Mustererkennung (Informatik 5)
Martensstr. 3, 91058 Erlangen, Germany

Phone: +49 9131 852 7874
fax:   +49 9131 303811
Email: volker.daum at informatik.uni-erlangen.de



More information about the Insight-developers mailing list