code itself, basically a copy of Dan's subtracted tiff exporter:
class SubtractedTiffExporter(LiveTiffExporter):
"Intercept images before saving and subtract dark image"
def start(self, doc):
# The metadata refers to the scan uid of the dark scan.
#if 'dark_frame' not in doc:
dark_sub = True