royerlab/ultrack

ImportError and NameError in multi_color_ensemble notebook

Opened this issue · 1 comments

Hi everyone,

I'm trying to run the multi_color_ensemble notebook but I get an ImportError when importing the required packages:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[2], line 22
     20 from numpy.typing import ArrayLike
     21 from ultrack import track, to_tracks_layer, tracks_to_zarr # to_trackmate, 
---> 22 from ultrack.utils import labels_to_edges
     23 from ultrack.config import MainConfig
     25 from ultrack.imgproc import normalize

ImportError: cannot import name 'labels_to_edges' from 'ultrack.utils' (/home/abigail/miniforge3/envs/ultrack/lib/python3.10/site-packages/ultrack/utils/__init__.py)

This may have caused the following NameError when running the cell to remove background noise:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[7], line 1
----> 1 foreground = create_zarr(imgs.shape, imgs.dtype, "foreground.zarr", chunks=chunks, overwrite=True)
      2 array_apply(
      3     imgs,
      4     out_array=foreground,
   (...)
      7     axis=(0, 3),
      8 )
     10 normalized = create_zarr(imgs.shape, np.float16, "normalized.zarr", chunks=chunks, overwrite=True)

NameError: name 'create_zarr' is not defined

I would appreciate advice on how to proceed.

Hey @raeesahhayatudin.

We made a mistake when renaming the labels_to_edges function. Thanks for pointing this out.

We fixed this issue in #104.

Could you try updating ultrack with pip install git+https://github.com/royerlab/ultrack or using the new version of the multi_color_ensemble.ipynb?