more work on ndimage