'Store images'

def store_images(self, callback_data, batch_ind, imgs_to_store, img_batch_data, C, H, W):

    n_imgs = len(imgs_to_store)
    if n_imgs:
        img_data = img_batch_data[:, imgs_to_store].get()
        img_store = callback_data.create_group(('deconv/img/batch_' + str(batch_ind)))
        img_hwc8 = img_store.create_dataset('HWC_uint8', (H, W, C, n_imgs), dtype='uint8', compression=True)
        img_hwc_f32 = np.transpose(img_data.reshape((C, H, W, n_imgs)), (1, 2, 0, 3))
        img_hwc8[:] = self.scale_to_rgb(img_hwc_f32)
        self.raw_img_cache[batch_ind] = img_data
        self.raw_img_key[batch_ind] = dict()
        for (i, img_idx) in enumerate(imgs_to_store):
            img_store.attrs[str(img_idx)] = i
            self.raw_img_key[batch_ind][img_idx] = i
