[Insight-developers] Image/ImageAdaptor/DataAccessor modification
Luis Ibanez
ibanez@cs.unc.edu
Thu, 15 Mar 2001 12:37:28 -0500
Hi,
Relations between ImageAdaptor, Image and DataAccessor
have slightly changed.
Before a DataAccessor was only a type with static methods
defined in Image and ImageAdaptor. Iterators used it to
convert types during pixel access.
Now a member variable of DataAccessor type is declared
in Image and ImageAdaptor. In this way, the Accessor can have
some state information.
This is used to make possible a N-th element adaptor.
itkNthElementImageAdaptor
itkNthElementDataAccessor
Given and image whose pixels are of type container:
itkVector, itkPoint, std::vector... and in general, any type
that provides a operator[](unsigned int) method.
The image can be adapted to make it look like a scalar
image whose pixels are the n-th elements of the adapted
image.
The selection of the element number can be done at run time
using the SelectNthElement() method in NthElementImageAdaptor.
+--------------+
| | Here it looks
+----+ N-th | like a scalar
+---------------------------+ | element | image. Each pixel
| Image<vector<float,4>, 3> |->| Image | is the n-th element
+---------------------------+ | Adaptor | of the corresponding
+----+ | pixel in the adapted
| m_ElementNum |
+--------------+
---
Pixel access is supposed to be inlined.
That seems to be the case in VC++ and gcc,
...but if you notice any big change in performance
on pixel access, I'll double check the iterator's
Get/Set method.
Thanks,
Luis