Hello, On May 13, 2013, at 11:03 AM, "Gao, Yi" <[email protected]> wrote: > When using NeighborhoodIterator, i'm not sure if the boundary checking is > automatically turned on. I guess if that is by default on, then there is not > much speed gain with it.
Because the region you specify to the Iterator is on the boundary it will turn on the boundary checking. You can either turn off the condition: http://www.itk.org/Doxygen/html/classitk_1_1ConstNeighborhoodIterator.html#a438cb0146b802b04a771a2461952cff8 or you can change the region size you initialize the Iterator with. You can just use the operator<< to check what the iterator is doing. Also consider using a large type for the accumulation type, such as itk::NumericTraits<T>::AccumulatorType; And consider using std::accumulate(it.Begin(), it.End(), 0 ) Brad _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Kitware offers ITK Training Courses, for more information visit: http://kitware.com/products/protraining.php Please keep messages on-topic and check the ITK FAQ at: http://www.itk.org/Wiki/ITK_FAQ Follow this link to subscribe/unsubscribe: http://www.itk.org/mailman/listinfo/insight-developers
