Generalized RawToProfile