def _publish_metrics(self, prev_keys, key, data, publishfn=None):
        if key not in data:
            return
        value = data[key]
        keys = prev_keys + [key]
        if not publishfn:
            publishfn = self.publish
        if isinstance(value, dict):
            for new_key in value:
                self._publish_metrics(keys, new_key, value)
        elif isinstance(value, int) or isinstance(value, float):
            publishfn('.'.join(keys), value)
        elif isinstance(value, long):
            publishfn('.'.join(keys), float(value))
Display a scalar or a labelmap in all the 2D windows as Foreground with an optional opacity
dataset/ETHPy150Open python-diamond/Diamond/src/collectors/mongodb/mongodb.py/MongoDBCollector._publish_metrics--crossover with--dataset/ETHPy150Open acil-bwh/SlicerCIP/Scripted/CIP_Common/CIP/logic/SlicerUtil.py/SlicerUtil.displayForegroundVolume