      unsigned int get_mem_img_index() {
        if (mem_img_index==~0U) {
          if (&imgout>imglist.data() && &imgout<imglist.end())
            mem_img_index = const_scalar((double)(&imgout - imglist.data()));
          else {
            unsigned int pos = ~0U;
            cimglist_for(imglist,l)
              if (imgout._data==imglist[l]._data && imgout.is_sameXYZC(imglist[l])) { pos = l; break; }
            if (pos!=~0U) mem_img_index = const_scalar((double)pos);
          }
        }
        return mem_img_index;
      }
      unsigned int get_mem_img_index() {
        if (mem_img_index==~0U) {
          if (&imgout>imglist.data() && &imgout<imglist.end())
            mem_img_index = const_scalar((double)(&imgout - imglist.data()));
          else {
            unsigned int pos = ~0U;
            cimglist_for(imglist,l)
              if (imgout._data==imglist[l]._data && imgout.is_sameXYZC(imglist[l])) { pos = l; break; }
            if (pos!=~0U) mem_img_index = const_scalar((double)pos);
          }
        }
        return mem_img_index;
      }