code: def redo(self):
          image = self.channel.get_current_image()
          if image is None:
              return True
          path = image.get('path', None)
          if path is None:
              self.fv.show_error(
                  "Cannot open image: no value for metadata key 'path'")
              return
          if path.endswith('asdf'):
              return True
          if path != self.img_path:
              self.img_path = path
              if self.file_obj is not None:
                  try:
                      self.file_obj.close()
                  except Exception:
                      pass
              self.file_obj = io_fits.get_fitsloader(logger=self.logger)
              self.file_obj.open_file(path)
              upper = len(self.file_obj) - 1
              self.prep_hdu_menu(self.w.hdu, self.file_obj.hdu_info)
              self.num_hdu = upper
              self.logger.debug("there are %d hdus" % (upper + 1))
              self.w.numhdu.set_text("%d" % (upper + 1))
              self.w.hdu.set_enabled(len(self.file_obj) > 0)
          name = image.get('name', iohelper.name_image_from_path(path))
          idx = image.get('idx', None)
          match = re.match(r'^(.+)\[(.+)\]$', name)
          if match:
              name = match.group(1)
          self.name_pfx = name
          htype = None
          if idx is not None:
              info = self.file_obj.hdu_db.get(idx, None)
              if info is not None:
                  htype = info.htype.lower()
                  toc_ent = self._toc_fmt % info
                  self.w.hdu.show_text(toc_ent)
          if self.img_name != name:
              self.img_name = name
              dims = [0, 0]
              data = image.get_data()
              if data is None:
                  self.logger.warning("Empty data part in HDU %s" % (str(idx)))
              elif htype in ('bintablehdu', 'tablehdu',):
                  pass
              elif htype not in ('imagehdu', 'primaryhdu', 'compimagehdu'):
                  self.logger.warning("HDU %s is not an image (%s)" % (
                      str(idx), htype))
              else:
                  mddata = image.get_mddata()
                  if mddata is not None:
                      dims = list(mddata.shape)
                      dims.reverse()
              self.build_naxis(dims, image)