might go in nipy.utils ?