diff --git a/hexrd/ui/hexrd_config.py b/hexrd/ui/hexrd_config.py index 3943ca804..215de8202 100644 --- a/hexrd/ui/hexrd_config.py +++ b/hexrd/ui/hexrd_config.py @@ -890,14 +890,18 @@ def raw_masks_dict(self): return masks_dict - @property - def masked_images_dict(self): + def create_masked_images_dict(self, fill_value=0): """Get an images dict where masks have been applied""" images_dict = self.images_dict + have_masks = len(self.visible_masks) for det, mask in self.raw_masks_dict.items(): for name, img in images_dict.items(): + if (have_masks and + np.issubdtype(type(fill_value), np.floating) and + not np.issubdtype(img.dtype, np.floating)): + img = img.astype(float) if det == name: - img[~mask] = 0 + img[~mask] = fill_value return images_dict