[Insight-users] Question on combining several conditional ite rators

Miller, James V (Research) millerjv@crd.ge.com
Tue, 15 Apr 2003 15:50:38 -0400


I don't think the 3 iterators are visiting the same pixels as you move
around (i.e. they are not lock stepped to be the same location). For 
instance, if at the first pixel, function1 is false while function2 
and function3 are true, the pixel queues for the flood fills would
already be different.  So as you iterate, the three iterators are 
taking different paths.

I think the solution would be to define a single image function that 
takes 3 input images. But then you would also need an iterator that 
managed 3 images.  This is probably more code than you wanted to write.

I have several alternatives: 

Can you create a single image which is the product of the functions that
you want to apply?  If so, then you can use the flood fill iterator on the 
composed image. You loose some of the benefits of the conditional iterators
since
you need to evaluate all the functions across all the pixels in all the
images.
But the flood fill can still be used to extract a connected region.

Or, you can use a single conditional iterator to walk one of the outputs,
call
GetIndex() on that iterator and then call GetPixel() on the other outputs to

see if they satisfy the other functions. Then set your final output as
needed.

I had a few more ideas but have forgotten them by time I got here....

Jim



> -----Original Message-----
> From: Fucang Jia [mailto:jiafucang@hotmail.com]
> Sent: Tuesday, April 15, 2003 11:23 AM
> To: insight-users@public.kitware.com
> Subject: [Insight-users] Question on combining several conditional
> iterators
> 
> 
> Hi Luis, hi everyone,
> 
> I want to use FloodFilledImageFunctionConditionalIterator and 
> a seed point 
> to operate on three kinds of images, such like
> 
> FunctionType::Pointer function1 = 
> FunctionType::New();function1->SetInputImage ( inputImage1 );
> 
> FunctionType::Pointer function2 = 
> FunctionType::New();function1->SetInputImage ( inputImage2 );
> 
> FunctionType::Pointer function3 = 
> FunctionType::New();function1->SetInputImage ( inputImage3 );
> 
> IteratorType it = IteratorType ( outputImage, function1, m_Seed );
> 
> But I need to search all the pixels satify the function1, 
> function2, and 
> function3, then I use
> IteratorType it1 = IteratorType ( outputImage1, function1, m_Seed );
> IteratorType it2 = IteratorType ( outputImage2, function2, m_Seed );
> IteratorType it3 = IteratorType ( outputImage3, function3, m_Seed );
> 
> and combine the outputImage1, outputImage2, outputImage3 to combine 
> outputImage,
> 
> while(!it.IsAtEnd())
> {
> 	it.Set(it1.Get()*it2.Get()*it3.Get());
> 	++it;
> 	++it1;
> 	++it2;
> 	++it3;
> }
> 
> then go on region growing, but the result seems not right, 
> which grow the 
> whole image, all white. I do not know what is wrong.
> 
> Cound you give me some advice on how to implement this function.
> 
> Thanks!
> 
> Fucang
> 
> _________________________________________________________________
> STOP MORE SPAM with the new MSN 8 and get 2 months FREE* 
> http://join.msn.com/?page=features/junkmail
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users@public.kitware.com
> http://public.kitware.com/mailman/listinfo/insight-users
>