Dear all,<div><br></div><div>I would like to perform a voxelwise operation on positive voxels within a binary mask. Currently I implemented it like this:</div><div><br></div><div>               .....</div><div> </div><div>
               typedef itk::ImageRegionIterator&lt;SegmentationType&gt; SegmentationIteratorType</div><div>               SegmentationIteratorType mask_it(mask_img, mask_img-&gt;GetLargestPossibleRegion() );</div><div>               for(mask_it.GoToBegin(); !mask_it.IsAtEnd(); ++mask_it) {</div>
<div><div>                        if(mask_it.Get() &gt; 0)</div><div>                        {</div><div>                             // Operation</div><div>                         </div><div>                        }</div>
<div>                }</div></div><div><br></div><div><br></div><div>I&#39;ve the feeling that this is not the most efficient way of doing this. Is there a way to define the &#39;region&#39;  to be only the positive voxels in the mask - and only iterate over those voxels? </div>
<div><br></div><div>Best,</div><div>Martijn </div>