Skip to content
Open
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*egg-info
.DS_Store
*.toml
*__pycache__*
*__pycache__*
build/
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include eats_worm/napari.yaml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions eats_worm/Curator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, 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)
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():
Expand Down Expand Up @@ -741,7 +746,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()
Expand Down
6 changes: 3 additions & 3 deletions eats_worm/Extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)}
Expand Down
2 changes: 1 addition & 1 deletion eats_worm/Threads.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
58 changes: 54 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,55 @@
[build-system]
build-backend = 'setuptools.build_meta'
requires = [
'setuptools',
]
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",
"ndx-multichannel-volume @ git+https://github.com/focolab/ndx-multichannel-volume",
"imreg_dft",
"fastcluster==1.3.0; python_version >= '3.9'",
"fastcluster==1.2.6; python_version < '3.9'",
"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' and python_version >= '3.8'",
"napari; python_version < '3.8'"
]

[project.entry-points."napari.manifest"]
eats-worm = "eats_worm:napari.yaml"

[tool.setuptools]
packages = ["eats_worm"]
include-package-data = true
93 changes: 0 additions & 93 deletions setup.py

This file was deleted.