<div>Instead of applying a Functor to EVERY pixel using UnaryFunctorImageFilter, is there a way to pass it (or something else) a mask to tell it only to apply the function on the masked pixels?</div><div><br></div><div>I often find myself doing:</div>
<div><br></div><div><div> while(!imageIterator.IsAtEnd())</div><div> {</div><div> // If the pixel is not enabled in the mask, skip it</div><div> if(imageIterator.Get() == 0)</div><div> {</div><div> output->SetPixel(imageIterator.GetIndex(), 0);</div>
<div> continue;</div><div> }</div><div><br></div><div> PixelType value = MyFunctor(imageIterator.GetIndex());</div><meta http-equiv="content-type" content="text/html; charset=utf-8"><div> ....</div><div><br>
</div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"> output->SetPixel(imageIterator.GetIndex(), value);</div><div> ++imageIterator;</div><div> }</div></div><div><br></div>Thanks,<br><br>
David<br>