[Insight-developers] ImageSeries Reader / Writer : ImageIterators

Luis Ibanez luis.ibanez@kitware.com
Thu, 06 Mar 2003 09:08:57 -0500


One option for the Index movement in ND is implemented
in the ImageIterators, like the ImageRegionIterator.

By calling SetIndex() the iterator will internally
recompute the offset in the memory buffer and locate
the corresnponding pixel. In the case of the ImageRegion
iterator this operation is slow because everthing is
recomputed.

The derived classes of the ImageRegion iterator update
the offset progresivelly. For example, the SliceIteratorWithIndex
allows to select 2 out of N dimensions and use these 2 dimensions
as the ones defining slices. Then it will walk through
the slices.

It is probably better to use the iterators instead of
extending the functionality of the Index, in any case,
once the index is recomputed, its final goal will be to
use it to access a pixel in the image.  The iterator
can perform the full task in a single pass.



   Luis


------------------------------------------------
Will Schroeder wrote:
 >
...
> 
> Final note: the ImageSeriesWriter maps an n-D image into a series of m-D 
> (typically 2D) slices. For convenience this requires modifying the Index 
> class to that I can increment the Index and have it "wrap / modulo / 
> cycle" like a clock does (incrementing slices, then volumes, etc.) As 
> far as I can tell there is nothing like this in Index currently. Can I 
> add it? I'd like to call it something like "AddBasisIndex" to be 
> consistent with the existing GetBasisIndex. Comments?
> 
> Will
> 
> 
> 
> _______________________________________________
> Insight-developers mailing list
> Insight-developers@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-developers
>