From ceac7c0f38878101876068a0cccc7bf945948db2 Mon Sep 17 00:00:00 2001 From: Wade Boohar Date: Wed, 20 Aug 2025 13:04:19 -0700 Subject: [PATCH 1/6] fix npex dependency --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 60d3338..7d8961a 100755 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ 'opencv-python-headless>=4.1.0.25', 'matplotlib>=2.1.0', 'foco-improc', - 'git+https://github.com/focolab/npex', + 'npex @ git+https://github.com/focolab/npex', 'imreg_dft', 'fastcluster', 'pyqt6', @@ -76,7 +76,7 @@ 'opencv-python-headless>=4.1.0.25', 'matplotlib>=2.1.0', 'foco-improc', - 'git+https://github.com/focolab/npex', + 'npex @ git+https://github.com/focolab/npex', 'imreg_dft', 'fastcluster', 'napari[all]', From 9b87142f13373b2dbaf4e0a27a6db71c7762c2df Mon Sep 17 00:00:00 2001 From: warbol Date: Tue, 2 Dec 2025 15:44:49 -0800 Subject: [PATCH 2/6] fix to allow compatibility w/ numpy 2.0, napari 0.5.0 --- eats_worm/Curator.py | 6 +++--- eats_worm/Extractor.py | 6 +++--- eats_worm/Threads.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/eats_worm/Curator.py b/eats_worm/Curator.py index 95a9f2e..8c38757 100644 --- a/eats_worm/Curator.py +++ b/eats_worm/Curator.py @@ -155,8 +155,8 @@ def restart(self): edge_width_is_relative=False point_symbol = 'disc' face_color = np.array([0,0,0,0]) - self.viewer.add_points(np.empty((0, 3)), symbol=point_symbol, face_color=face_color, edge_color='red', name='roi', size=point_size+1, scale=self.scale, edge_width=edge_width*1.25, edge_width_is_relative=edge_width_is_relative) - self.other_rois = self.viewer.add_points(np.empty((0, 3)), symbol=point_symbol, face_color=face_color, edge_color='green', name='other rois', size=point_size, scale=self.scale, edge_width=edge_width, edge_width_is_relative=edge_width_is_relative) + self.viewer.add_points(np.empty((0, 3)), symbol=point_symbol, face_color=face_color, border_color='red', name='roi', size=point_size+1, scale=self.scale, border_width=edge_width*1.25, border_width_is_relative=edge_width_is_relative) + self.other_rois = self.viewer.add_points(np.empty((0, 3)), symbol=point_symbol, face_color=face_color, border_color='green', name='other rois', size=point_size, scale=self.scale, border_width=edge_width, border_width_is_relative=edge_width_is_relative) if self.curator_layers: for layer in self.curator_layers.keys(): @@ -741,7 +741,7 @@ def add_roi(self, position, t): self.num_neurons += 1 print('Saving blob timeseries as numpy object...') self.e.timeseries = np.hstack((self.e.timeseries, np.empty((self.e.timeseries.shape[0], 1)))) - self.e.timeseries[:,-1] = np.NaN + self.e.timeseries[:,-1] = np.nan self.e.spool.export(f=os.path.join(self.e.output_dir, 'threads.obj')) self.e.save_timeseries() self.e.save_dataframe() diff --git a/eats_worm/Extractor.py b/eats_worm/Extractor.py index 3c7c2bd..8b291ff 100755 --- a/eats_worm/Extractor.py +++ b/eats_worm/Extractor.py @@ -67,7 +67,7 @@ def background_subtraction_quant_function(im, spool, t, frames, quant_radius=3, activity: list list of quantifications corresponding to the positions specified """ - intensities = [np.NaN] * len(spool.threads) + intensities = [np.nan] * len(spool.threads) positions = spool.get_positions_t(t, indices=threads_to_quantify) positions = np.rint(np.copy(positions)).astype(int) max_z = len(frames) # in case of max_x, max_y, max_z, we're using these as indices so don't subtract 1 because slicing is exclusive @@ -234,13 +234,13 @@ def quantify(mft=None, extractor=None, quant_function=background_subtraction_qua print(e) timeseries = np.empty((num_t,num_threads)) - timeseries[:] = np.NaN + timeseries[:] = np.nan quantified_voxels = {i: {} for i in range(num_threads)} quant_lock = Lock() processed_counter = [0] def quantify_in_parallel_thread(start, stop): thread_timeseries = np.empty((stop - start, num_threads)) - thread_timeseries[:] = np.NaN + thread_timeseries[:] = np.nan thread_quantified_voxels = None if save_quantification_voxels: thread_quantified_voxels = {i: {} for i in range(num_threads)} diff --git a/eats_worm/Threads.py b/eats_worm/Threads.py index 0607095..0615fdc 100755 --- a/eats_worm/Threads.py +++ b/eats_worm/Threads.py @@ -438,7 +438,7 @@ def __init__(self, position = [], t = 0, **kwargs): self.found = np.zeros((maxt)) #self.positions = [] self.t = [] - if position != []: + if list(position) != []: self.positions[t] = np.array(position) #self.t = t + 1 #self.positions.append(np.array(position)) From c4710e2140ded218e9e662d2afeb38b36fb0c0ef Mon Sep 17 00:00:00 2001 From: warbol Date: Thu, 11 Dec 2025 18:27:46 -0800 Subject: [PATCH 3/6] update dependencies for py3.13 --- pyproject.toml | 55 ++++++++++++++++++++++++++--- setup.py | 93 -------------------------------------------------- 2 files changed, 51 insertions(+), 97 deletions(-) delete mode 100755 setup.py diff --git a/pyproject.toml b/pyproject.toml index e3e06ac..23eed24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,52 @@ [build-system] -build-backend = 'setuptools.build_meta' -requires = [ - 'setuptools', -] \ No newline at end of file +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "eats_worm" +version = "0.0.3" +requires-python = "<3.14" +description = "Method for extracting GCaMP signal from volumetric imaging recordings" +readme = "README.md" +authors = [ + {name = "UCSF FOCO Lab", email = "focolabdev@gmail.com"} +] +license = {text = "MIT License"} +classifiers = [ + "Programming Language :: Python :: 3", + "Framework :: napari", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", +] +dependencies = [ + "numpy", + "scipy", + "tifffile", + "opencv-python-headless", + "matplotlib", + "foco-improc", + "npex @ git+https://github.com/focolab/npex", + "imreg_dft", + "fastcluster", + "pyqtgraph", + "magicgui", + "pandas", + "scikit-image", + "xmltodict", + "pynwb", + "nwbinspector", + "dandi", + "remfile", + # MacOS (Darwin) specific dependencies + "pyqt6; sys_platform == 'darwin'", + "napari[pyqt6_experimental]; sys_platform == 'darwin'", + # Linux/Windows specific dependencies + "napari[all]; sys_platform != 'darwin'", +] + +[project.entry-points."napari.manifest"] +eats-worm = "eats_worm:napari.yaml" + +[tool.setuptools] +packages = ["eats_worm"] +include-package-data = true diff --git a/setup.py b/setup.py deleted file mode 100755 index 7d8961a..0000000 --- a/setup.py +++ /dev/null @@ -1,93 +0,0 @@ -import setuptools -import os, platform - -if platform.system() == 'Darwin': - setuptools.setup( - name="eats_worm", - version="0.0.3", - author="UCSF FOCO Lab", - author_email="focolabdev@gmail.com", - description="Method for extracting GCaMP signal from volumetric imaging recordings", - long_description_content_type=open('README.md').read(), - url="", - packages=setuptools.find_packages(), - include_package_data=True, - entry_points = { - 'napari.manifest': [ - 'eats-worm = eats_worm:napari.yaml' - ] - }, - classifiers=[ - "Programming Language :: Python :: 3", - "Framework :: napari", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], - install_requires=[ - 'numpy>=1.22.4', - 'scipy>=1.0.0', - 'tifffile>=2022.5.4', - 'opencv-python-headless>=4.1.0.25', - 'matplotlib>=2.1.0', - 'foco-improc', - 'npex @ git+https://github.com/focolab/npex', - 'imreg_dft', - 'fastcluster', - 'pyqt6', - 'napari[pyqt6_experimental]', - 'pyqtgraph==0.13', - 'magicgui', - 'pandas>=1.4.2', - 'scikit-image', - 'xmltodict', - 'pynwb', - 'nwbinspector', - 'dandi' - ], - python_requires='<3.11' - ) - -else: - setuptools.setup( - name="eats_worm", - version="0.0.3", - author="UCSF FOCO Lab", - author_email="focolabdev@gmail.com", - description="Method for extracting GCaMP signal from volumetric imaging recordings", - long_description_content_type=open('README.md').read(), - url="", - packages=setuptools.find_packages(), - include_package_data=True, - entry_points = { - 'napari.manifest': [ - 'eats-worm = eats_worm:napari.yaml' - ] - }, - classifiers=[ - "Programming Language :: Python :: 3", - "Framework :: napari", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], - install_requires=[ - 'numpy>=1.22.4', - 'scipy>=1.0.0', - 'tifffile>=2022.5.4', - 'opencv-python-headless>=4.1.0.25', - 'matplotlib>=2.1.0', - 'foco-improc', - 'npex @ git+https://github.com/focolab/npex', - 'imreg_dft', - 'fastcluster', - 'napari[all]', - 'pyqtgraph==0.13', - 'magicgui', - 'pandas>=1.4.2', - 'scikit-image', - 'xmltodict', - 'pynwb', - 'nwbinspector', - 'dandi' - ], - python_requires='<3.11' - ) From 6439ae9ed9ac1981b64e072f60d7793b328d0ceb Mon Sep 17 00:00:00 2001 From: warbol Date: Tue, 6 Jan 2026 11:41:38 -0800 Subject: [PATCH 4/6] add ndx-multichannel-volume dependency and package data manifest --- .gitignore | 3 ++- MANIFEST.in | 1 + pyproject.toml | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 MANIFEST.in diff --git a/.gitignore b/.gitignore index f6aa268..7e73cff 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *egg-info .DS_Store *.toml -*__pycache__* \ No newline at end of file +*__pycache__* +build/ diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..9250ae7 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +include eats_worm/napari.yaml \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 23eed24..0532ce6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = ["setuptools>=61.0"] build-backend = "setuptools.build_meta" [project] -name = "eats_worm" +name = "eats-worm" version = "0.0.3" requires-python = "<3.14" description = "Method for extracting GCaMP signal from volumetric imaging recordings" @@ -15,7 +15,7 @@ license = {text = "MIT License"} classifiers = [ "Programming Language :: Python :: 3", "Framework :: napari", - "License :: OSI Approved :: MIT License", + "License :: OSI zApproved :: MIT License", "Operating System :: OS Independent", ] dependencies = [ @@ -26,6 +26,7 @@ dependencies = [ "matplotlib", "foco-improc", "npex @ git+https://github.com/focolab/npex", + "ndx-multichannel-volume @ git+https://github.com/focolab/ndx-multichannel-volume", "imreg_dft", "fastcluster", "pyqtgraph", From db76405fb73be2411afc1b3ff6e8c8b8d8c4c54c Mon Sep 17 00:00:00 2001 From: warbol Date: Tue, 6 Jan 2026 15:55:22 -0800 Subject: [PATCH 5/6] improving backwards compatbility for 3.8/3.9 and updating readme --- README.md | 2 +- eats_worm/Curator.py | 9 +++++++-- pyproject.toml | 6 ++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3f09f87..a2a6b8c 100755 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ### Installation Instructions -1. Setup your development environment. If you need help with this, there are many resources on Google. Most people in the lab use Conda as a package manager and develop in Conda virtual environments as well. +1. Setup your development environment. If you need help with this, there are many resources on Google. Most people in the lab use Conda as a package manager and develop in Conda virtual environments as well. Python versions 3.10-3.13 are recommended. 3.8-3.9 seem to work with minor graphical bugs in Napari but we cannot guarantee consistent results for these versions. 2. Start your virtual environment, and run the command ```bash diff --git a/eats_worm/Curator.py b/eats_worm/Curator.py index 8c38757..c5df2b2 100644 --- a/eats_worm/Curator.py +++ b/eats_worm/Curator.py @@ -155,8 +155,13 @@ def restart(self): edge_width_is_relative=False point_symbol = 'disc' face_color = np.array([0,0,0,0]) - self.viewer.add_points(np.empty((0, 3)), symbol=point_symbol, face_color=face_color, border_color='red', name='roi', size=point_size+1, scale=self.scale, border_width=edge_width*1.25, border_width_is_relative=edge_width_is_relative) - self.other_rois = self.viewer.add_points(np.empty((0, 3)), symbol=point_symbol, face_color=face_color, border_color='green', name='other rois', size=point_size, scale=self.scale, border_width=edge_width, border_width_is_relative=edge_width_is_relative) + try: + self.viewer.add_points(np.empty((0, 3)), symbol=point_symbol, face_color=face_color, border_color='red', name='roi', size=point_size+1, scale=self.scale, border_width=edge_width*1.25, border_width_is_relative=edge_width_is_relative) + self.other_rois = self.viewer.add_points(np.empty((0, 3)), symbol=point_symbol, face_color=face_color, border_color='green', name='other rois', size=point_size, scale=self.scale, border_width=edge_width, border_width_is_relative=edge_width_is_relative) + + except: + self.viewer.add_points(np.empty((0, 3)), symbol=point_symbol, face_color=face_color, edge_color='red', name='roi', size=point_size+1, scale=self.scale, edge_width=edge_width*1.25, edge_width_is_relative=edge_width_is_relative) + self.other_rois = self.viewer.add_points(np.empty((0, 3)), symbol=point_symbol, face_color=face_color, edge_color='green', name='other rois', size=point_size, scale=self.scale, edge_width=edge_width, edge_width_is_relative=edge_width_is_relative) if self.curator_layers: for layer in self.curator_layers.keys(): diff --git a/pyproject.toml b/pyproject.toml index 0532ce6..bd19b9f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,8 @@ dependencies = [ "npex @ git+https://github.com/focolab/npex", "ndx-multichannel-volume @ git+https://github.com/focolab/ndx-multichannel-volume", "imreg_dft", - "fastcluster", + "fastcluster==1.3.0; python_version >= '3.9'", + "fastcluster==1.2.6; python_version < '3.9'", "pyqtgraph", "magicgui", "pandas", @@ -42,7 +43,8 @@ dependencies = [ "pyqt6; sys_platform == 'darwin'", "napari[pyqt6_experimental]; sys_platform == 'darwin'", # Linux/Windows specific dependencies - "napari[all]; sys_platform != 'darwin'", + "napari[all]; sys_platform != 'darwin' and python_version >= '3.8'", + "napari; python_version < '3.8'" ] [project.entry-points."napari.manifest"] From 6a9cfe413db9f78a8b13becdc629fdca1720e0b6 Mon Sep 17 00:00:00 2001 From: warbol Date: Tue, 6 Jan 2026 16:03:32 -0800 Subject: [PATCH 6/6] typo --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bd19b9f..d7c54e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ license = {text = "MIT License"} classifiers = [ "Programming Language :: Python :: 3", "Framework :: napari", - "License :: OSI zApproved :: MIT License", + "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] dependencies = [