Currently, filtered images are loaded into memory by using the tiles_io function load_image by returning a numpy array.
This is not ideal because this function requires the notebook to run, which limits how easy it is for us to unit test functions that require loading of images.
Suggestion
Instead of load_image, all filtered images will be stored in the filter notebook page as one zarr.Array of shape (n_tiles x n_rounds x n_channels x im_y x im_x x im_z) so any filtered image can easily to retrieved by nb.filter.images[t, r, c].
This is ideal for functions like get_spot_colors_new which require memory mapped images for its faster speed but would ideally not require the notebook to run so we can unit test its optical flow/affine transform applications very easily without requiring a notebook as instead we can create a zarr.Array or np.ndarray for the unit test, which is stable and easy to build.
We then get the best of both worlds: memory mapping for fast image pixel retrieval and easy to build unit tests for important code.
Issue
tiles_io
functionload_image
by returning a numpy array.Suggestion
load_image
, all filtered images will be stored in the filter notebook page as onezarr.Array
of shape(n_tiles x n_rounds x n_channels x im_y x im_x x im_z)
so any filtered image can easily to retrieved bynb.filter.images[t, r, c]
.get_spot_colors_new
which require memory mapped images for its faster speed but would ideally not require the notebook to run so we can unit test its optical flow/affine transform applications very easily without requiring a notebook as instead we can create azarr.Array
ornp.ndarray
for the unit test, which is stable and easy to build.