def test_load_numpy_image(test_output_dirs: OutputFolderForTests) -> None: array_size = (20, 30, 40) array = np.ones(array_size) assert array.shape == array_size npy_file = test_output_dirs.root_dir / "file.npy" assert is_numpy_file_path(npy_file) np.save(npy_file, array) image = load_numpy_image(npy_file) assert image.shape == array_size image_and_segmentation = load_image_in_known_formats(npy_file, load_segmentation=False) assert image_and_segmentation.images.shape == array_size
def test_is_numpy_file(input: Tuple[str, bool]) -> None: file, expected = input assert is_numpy_file_path(file) == expected assert is_numpy_file_path(Path(file)) == expected