Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle upcoming minor deprecations #1306

Merged
merged 2 commits into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion caiman/source_extraction/cnmf/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions caiman/utils/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down
Loading