missing function for patch to raster conversion