roi file reading and writing