[Insight-users] PixelContainers, Iterators,

John Biddiscombe jbiddiscombe at skippingmouse.co.uk
Thu, 29 Apr 2004 16:47:44 +0100


itk::Image has PixelContainer type set to

typedef ImportImageContainer<unsigned long, PixelType> PixelContainer;

Which would imply that I can't use a different storage method for pixels.
Are there not traits which I can manipulate to change the pixel container?
The reason is that to manage memory I'd like to experiment with a virtual
pixel memory manager which would swap chunks in and out of memory. Replacing
the pixel container with a custom container which supplied the required []
type operators would be a nice way of implementing this. Code would not be
allowed to request GetBufferPointer, which would not necessarily return
anything meaningful.

itkConstImageIterator accesses memory by fetching the BufferPointer
TPixel *GetBufferPointer() and then traversing linearly...
"ImageConstIterator assumes a particular layout of the image data. In
particular, the data is arranged in a 1D array as if it were
[][][][slice][row][col] with Index[0] = col, Index[1] = row, Index[2] =
slice, etc."

Is there no straightformward way of replacing the pixelcontainer, and
modifying the basic iterators such that they query the pixelcontainer,
rather than accessing memory directly? (I realize that there's a buffered
region which handles this type of scenario, but the problem with this
mechanism is that I'd like the whole image to "appear" as if it was in
memory even though in fact it isn't. I can't see an easy way of manipulating
the buffered region to achieve this).

thanks

JB