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<SegmentationType> SegmentationIteratorType</div><div> SegmentationIteratorType mask_it(mask_img, mask_img->GetLargestPossibleRegion() );</div><div> for(mask_it.GoToBegin(); !mask_it.IsAtEnd(); ++mask_it) {</div>
<div><div> if(mask_it.Get() > 0)</div><div> {</div><div> // Operation</div><div> </div><div> }</div>
<div> }</div></div><div><br></div><div><br></div><div>I've the feeling that this is not the most efficient way of doing this. Is there a way to define the 'region' 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>