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>