(fname)
| 37 | |
| 38 | |
| 39 | def load_data(fname) -> np.ndarray: |
| 40 | if fname.endswith(".npz"): |
| 41 | image = np.load(fname, allow_pickle=True)['data'] |
| 42 | elif fname.endswith(".tif") or fname.endswith(".tiff"): |
| 43 | image = io.imread(fname) |
| 44 | return image |
| 45 | |
| 46 | |
| 47 | def load_image(image_path, cells_path, cells2labels_path, channels=[], to_pad=False, crop_size=0): |