<font size="2"><font face="verdana,sans-serif">Well, <a href="http://www.itk.org/Doxygen/html/classitk_1_1AndImageFilter.html">AND</a> and <a href="http://www.itk.org/Doxygen/html/classitk_1_1OrImageFilter.html">OR</a> image filters already exist. Is this what you were looking for?<br>
</font></font><br><div class="gmail_quote">On Tue, Aug 9, 2011 at 18:06, iamrndm b <span dir="ltr"><<a href="mailto:arindam.osu.cse@gmail.com">arindam.osu.cse@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
hi all , <div>I am writing  a simple filter where I need to be able to do 'and' 'or' operation between 2 binary images , I am reading in to images into 'image' and iterating through using a very simple </div>
<div><br></div><div>//</div><div><div>template<class TImage></div><div>void OilPaintingImageFilter<TImage></div><div>::ThreadedGenerateData(const typename Superclass::OutputImageRegionType& outputRegionForThread,</div>
<div>int threadId)</div><div>{</div><div>Â Â cerr <<" thread id " << Â threadId << endl;</div><div>Â Â </div><div>Â Â typename TImage::ConstPointer input1 = this->GetInput(0);</div><div>Â Â typename TImage::ConstPointer input2 = this->GetInput(1);</div>
<div>Â Â typename TImage::Pointer output = this->GetOutput();</div><div>Â Â </div><div>Â </div><div>Â Â itk::ImageRegionIterator<TImage> outputIterator(output, outputRegionForThread);</div><div>Â Â itk::ImageRegionConstIterator<TImage> inputIterator1(input1, outputRegionForThread);</div>
<div>Â Â itk::ImageRegionConstIterator<TImage> inputIterator2(input2, outputRegionForThread);</div><div>Â </div><div>Â Â while(!outputIterator.IsAtEnd())</div><div>Â Â Â {</div><div>Â Â // if(inputIterator1.GetIndex()[0] == inputIterator2.GetIndex()[1])</div>
<div>Â Â // if(inputIterator1.GetIndex()[0] == inputIterator2.GetIndex()[0])</div><div>Â Â Â if(inputIterator1.Get() == inputIterator2.Get())</div><div>Â Â Â Â {</div><div>Â Â Â Â outputIterator.Set(255);</div><div>Â Â Â Â }</div>
<div>Â Â Â else</div><div>Â Â Â Â {</div><div>Â Â Â Â outputIterator.Set(128);</div><div>Â Â Â Â }</div><div>Â </div><div>Â Â Â ++inputIterator1;</div><div>Â Â Â ++inputIterator2;</div><div>Â Â Â ++outputIterator;</div><div>Â Â Â }</div>
<div>
} </div><div>}</div></div><div>//</div><div><br></div><div>My question is is there and easier way  of reading the entire image into a VECTOR and just do a 'and/or'  operation on the entire vector.</div><div><br></div>
<div>Thanks </div><div> </div>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html" target="_blank">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br>