Neighborhood matrix should work with ROI (tests needed).
Cosmetic changes.