[Insight-users] Doubt regarding Iterators

Raja Yalamanchili yrpchandu at gmail.com
Thu Apr 19 20:17:12 EDT 2007


Hi,

I have taken a 3D data,took a slice of it, done some processing on it and
again i want to write the modified data on 3D data.

So to go to a specific slice and write modified data i'm using
(IndexIt)"ImageRegionConstIteratorWithIndex" but using this iterator i'm not
able to set the value,so i ran another
iterator(labelIt)"ImageRegionIterator",but they are incrementing in a
different way.The code is:

 IndexIt(LabelImage,LabelImage->GetLargestPossibleRegion());(ImageRegionConstIteratorWithIndex)

labelIt(LabelImage,LabelImage->GetLargestPossibleRegion());(ImageRegionIterator)

LabelImage is a 3D volume data of char type;


for(IndexIt.GoToBegin() , labelIt.GoToBegin() ; IndexIt.GetIndex()[2] < 8
;++IndexIt ,++labelIt ) ;

at the end i' getting  IndexIt ={0,0,8},  labelIt={0,4096, 28554296};

Can anyone tell me what is the difference between two iterators    and   any
possible solution to modify my 3D data from slice.


Thanks In Advance,

Raja Yalamanchili.(UH)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070419/2ce3e385/attachment.html


More information about the Insight-users mailing list