File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,13 @@ def load_images(self, image_names):
114114
115115 images_dict = HexrdConfig ().images_dict
116116
117+ def apply_masks (img , name ):
118+ visible_masks = HexrdConfig ().visible_masks
119+ for mask_name , data in HexrdConfig ().masks .items ():
120+ for det , mask in data :
121+ if mask_name in visible_masks and det == name :
122+ img [~ mask ] = 0
123+
117124 if (self .mode != ViewType .raw or
118125 len (image_names ) != len (self .axes_images )):
119126 # Either we weren't in image mode before, we have a different
@@ -134,11 +141,7 @@ def load_images(self, image_names):
134141 img = images_dict [name ]
135142
136143 # Apply any masks
137- for mask_name , data in HexrdConfig ().masks .items ():
138- for det , mask in data :
139- if (mask_name in HexrdConfig ().visible_masks and
140- det == name ):
141- img [~ mask ] = 0
144+ apply_masks (img , name )
142145
143146 axis = self .figure .add_subplot (rows , cols , i + 1 )
144147 axis .set_title (name )
@@ -158,11 +161,7 @@ def load_images(self, image_names):
158161 img = images_dict [name ]
159162
160163 # Apply any masks
161- for mask_name , data in HexrdConfig ().masks .items ():
162- for det , mask in data :
163- if (mask_name in HexrdConfig ().visible_masks and
164- det == name ):
165- img [~ mask ] = 0
164+ apply_masks (img , name )
166165 self .axes_images [i ].set_data (img )
167166
168167 # This will call self.draw_idle()
You can’t perform that action at this time.
0 commit comments