patches: additional code to compute projections of a patch, basis contributions from image patches, etc