If I understand the code correctly, there is no need for a mask_img_, since a masker is computed in any case, and the mask image is retrieved as self.mask_.mask_img_. Just rename mask_ to masker_, and you're good.