hacked to write roi histograms to tif