From 75b69fcab00aaba09cdf338a929625c3d37090d0 Mon Sep 17 00:00:00 2001 From: Tamino Huxohl <thuxohl@techfak.uni-bielefeld.de> Date: Fri, 2 Sep 2022 12:31:06 +0200 Subject: [PATCH] add option to save images to MuMapDataset main method --- mu_map/data/datasets.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mu_map/data/datasets.py b/mu_map/data/datasets.py index d0ae39c..201c119 100644 --- a/mu_map/data/datasets.py +++ b/mu_map/data/datasets.py @@ -200,11 +200,14 @@ if __name__ == "__main__": cv.imshow(wname, combine_images((recon, mu_map), (ir, im))) key = cv.waitKey(timeout) + running = 0 while True: ir = (ir + 1) % recon.shape[0] im = (im + 1) % mu_map.shape[0] - cv.imshow(wname, combine_images((recon, mu_map), (ir, im))) + to_show = combine_images((recon, mu_map), (ir, im)) + cv.imshow(wname, to_show) + key = cv.waitKey(timeout) @@ -219,3 +222,6 @@ if __name__ == "__main__": elif key == 81: # left arrow key ir = max(ir - 2, 0) im = max(im - 2, 0) + elif key == ord("s"): + cv.imwrite(f"{running:03d}.png", to_show) + running += 1 -- GitLab