(self)
| 36 | np.testing.assert_allclose(out, img_save_val) |
| 37 | |
| 38 | def test_write_gray_1height(self): |
| 39 | with tempfile.TemporaryDirectory() as out_dir: |
| 40 | image_name = os.path.join(out_dir, "test.png") |
| 41 | img = np.random.rand(1, 3) |
| 42 | img_save_val = (65535 * img).astype(np.uint16) |
| 43 | writer_obj = PILWriter(output_dtype=np.uint16, scale=65535) |
| 44 | writer_obj.set_data_array(img, channel_dim=None) |
| 45 | writer_obj.write(image_name, format="PNG") |
| 46 | out = np.asarray(Image.open(image_name)) |
| 47 | out = np.moveaxis(out, 0, 1) |
| 48 | np.testing.assert_allclose(out, img_save_val) |
| 49 | |
| 50 | def test_write_gray_1channel(self): |
| 51 | with tempfile.TemporaryDirectory() as out_dir: |
nothing calls this directly
no test coverage detected