From 062976526e851e566be50a1a82cc732ab902dee1 Mon Sep 17 00:00:00 2001 From: EricThomson Date: Fri, 22 Mar 2024 16:09:11 -0400 Subject: [PATCH 1/2] handle grey_dilation import update --- caiman/source_extraction/cnmf/spatial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/caiman/source_extraction/cnmf/spatial.py b/caiman/source_extraction/cnmf/spatial.py index bb46fb701..38451ea87 100644 --- a/caiman/source_extraction/cnmf/spatial.py +++ b/caiman/source_extraction/cnmf/spatial.py @@ -841,7 +841,7 @@ def determine_search_location(A, dims, method='ellipse', min_size=3, max_size=8, Exception 'You cannot pass empty (all zeros) components!' """ - from scipy.ndimage.morphology import grey_dilation + from scipy.ndimage import grey_dilation # we initialize the values if len(dims) == 2: From fa38f063182e5671368f8a4f3ab06aa23f4482d9 Mon Sep 17 00:00:00 2001 From: EricThomson Date: Fri, 22 Mar 2024 16:16:11 -0400 Subject: [PATCH 2/2] get_colormap api updated before deprecation --- caiman/utils/visualization.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/caiman/utils/visualization.py b/caiman/utils/visualization.py index 7bc2090ea..94f47838e 100644 --- a/caiman/utils/visualization.py +++ b/caiman/utils/visualization.py @@ -154,7 +154,7 @@ def nb_view_patches(Yr, A, C, b, f, d1, d2, YrA=None, image_neurons=None, thr=0. name of colormap (e.g. 'viridis') used to plot image_neurons """ - colormap = matplotlib.cm.get_cmap(cmap) + colormap = matplotlib.colormaps.get_cmap(cmap) grayp = [matplotlib.colors.rgb2hex(m) for m in colormap(np.arange(colormap.N))] nr, T = C.shape nA2 = np.ravel(np.power(A, 2).sum(0)) if isinstance(A, np.ndarray) else np.ravel(A.power(2).sum(0)) @@ -516,7 +516,7 @@ def nb_view_patches3d(Y_r, A, C, dims, image_type='mean', Yr=None, A = csc_matrix(A)[index_permut, :] dims = tuple(np.array(dims)[order[:3]]) d1, d2, d3 = dims - colormap = matplotlib.cm.get_cmap(cmap) + colormap = matplotlib.colormaps.get_cmap(cmap) grayp = [matplotlib.colors.rgb2hex(m) for m in colormap(np.arange(colormap.N))] nr, T = C.shape @@ -780,7 +780,7 @@ def nb_imshow(image, cmap='jet'): """ Interactive equivalent of imshow for ipython notebook """ - colormap = matplotlib.cm.get_cmap(cmap) # choose any matplotlib colormap here + colormap = matplotlib.colormaps.get_cmap(cmap) # choose any matplotlib colormap here grayp = [matplotlib.colors.rgb2hex(m) for m in colormap(np.arange(colormap.N))] xr = Range1d(start=0, end=image.shape[1]) yr = Range1d(start=image.shape[0], end=0)