code: def load_file(self, filename):
          
          if not os.path.isfile(filename):
              return
  
          self.logger.info('Loading mask image from {0}'.format(filename))
  
          try:
              # 0=False, everything else True
              dat = fits.getdata(filename).astype(np.bool)
          except Exception as e:
              self.logger.error('{0}: {1}'.format(e.__class__.__name__, str(e)))
              return
  
          key = '{0},{1}'.format(self.maskcolor, self.maskalpha)
  
          if key in self.tree_dict:
              sub_dict = self.tree_dict[key]
          else:
              sub_dict = {}
              self.tree_dict[key] = sub_dict
  
          # Add to listing
          seqstr = '{0:04d}'.format(self._seqno)  # Prepend 0s for proper sort
          sub_dict[seqstr] = Bunch.Bunch(ID=seqstr,
                                         MASKFILE=os.path.basename(filename))
          self._treepaths.append((key, seqstr))
          self._seqno += 1
  
          # Create mask layer
          obj = self.dc.Image(0, 0, masktorgb(
              dat, color=self.maskcolor, alpha=self.maskalpha))
          self._maskobjs.append(obj)
  
          self.redo()
docs: Load mask image.
  
          Results are appended to previously loaded masks.
          This can be used to load mask per color.