Skip to content
New issue

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

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

Already on GitHub? # to your account

More cnmf stuff #28

Merged
merged 36 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
30f519f
fixes
kushalkolar Jun 15, 2023
80d5f2b
aspect for temporal data, detect if in jupyter, events
kushalkolar Jun 17, 2023
e69f615
split up cnmf into modules, start eval widget
kushalkolar Jun 21, 2023
7ba3c0b
progress, heatmap works with selectors
kushalkolar Sep 18, 2023
8e8bdf0
mean window slider for mcorr widget
kushalkolar Sep 21, 2023
9a702d4
sidecar for cnmf viz, update cnmf viz to latest fpl
kushalkolar Oct 13, 2023
7e45a60
major refactor of mcorr, use ImageWidget.set_data(), so much simpler …
kushalkolar Oct 14, 2023
5e5a3dc
fix infinite recursion when clicking components, primitive component …
kushalkolar Oct 14, 2023
6f9128d
contour color handling and zoom components works :D
kushalkolar Oct 14, 2023
ecc3b4f
disable params viewer
kushalkolar Oct 14, 2023
272bd34
disable mcorr params viewer
kushalkolar Oct 14, 2023
d48cbf1
add norm, zscore, dfof
kushalkolar Oct 14, 2023
6a8b9dc
update examples
kushalkolar Oct 14, 2023
13a2312
modify setup.py
kushalkolar Oct 14, 2023
2324c7d
sidecar optional for mcorr viz
kushalkolar Oct 17, 2023
ef4bf2d
cnmf works well
kushalkolar Oct 26, 2023
6633cd4
update w.r.t. latest fpl
kushalkolar Oct 28, 2023
c50fb88
mcorr works with qt
kushalkolar Oct 31, 2023
042ae83
star rewrite of cnmf using image widget
kushalkolar Oct 31, 2023
768f4a5
add click contour events
kushalkolar Oct 31, 2023
0a2713a
component selection
kushalkolar Nov 1, 2023
586c1f5
contour colors
kushalkolar Nov 1, 2023
012c825
component metrics text box, layouting
kushalkolar Nov 1, 2023
6aed42a
fix callback
kushalkolar Nov 1, 2023
1f26614
eval seems to work
kushalkolar Nov 1, 2023
7972877
eval works and saves to disk
kushalkolar Nov 1, 2023
acd8f22
params text
kushalkolar Nov 1, 2023
a65cd64
manual eval works
kushalkolar Nov 1, 2023
0feaf43
remove old cnmf stuff
kushalkolar Nov 1, 2023
fbbf489
add extension
kushalkolar Nov 1, 2023
476c5e8
update setup and version
kushalkolar Nov 1, 2023
d7942d8
update utils
kushalkolar Nov 1, 2023
902dc31
update version
kushalkolar Nov 1, 2023
24be97b
qt context for cnmf viz
kushalkolar Nov 1, 2023
9cda51f
bug fixes
kushalkolar Nov 1, 2023
44a4535
update example nbs
kushalkolar Nov 1, 2023
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
171 changes: 56 additions & 115 deletions examples/cnmf.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,20 @@
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "c0e29f1f-a33b-45ab-877a-29291bb5fd01",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-06-11 07:34:01.073007: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.\n",
"2023-06-11 07:34:01.095009: I tensorflow/tsl/cuda/cudart_stub.cc:28] Could not find cuda drivers on your machine, GPU will not be used.\n",
"2023-06-11 07:34:01.095386: I tensorflow/core/platform/cpu_feature_guard.cc:182] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
"To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
"2023-06-11 07:34:01.605728: W tensorflow/compiler/tf2tensorrt/utils/py_utils.cc:38] TF-TRT Warning: Could not find TensorRT\n",
"/home/kushal/repos/mesmerize-viz/mesmerize_viz/_mcorr.py:336: UserWarning: registration of accessor <class 'mesmerize_viz._mcorr.MCorrExtensionsViz'> under name 'mcorr' for type <class 'pandas.core.series.Series'> is overriding a preexisting attribute with the same name.\n",
" @pd.api.extensions.register_series_accessor(\"mcorr\")\n"
]
}
],
"outputs": [],
"source": [
"from mesmerize_core import *\n",
"from mesmerize_viz import *"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "326b9f89-7bcd-4b76-be74-9d1d84b96ca2",
"metadata": {
"tags": []
Expand All @@ -45,120 +31,75 @@
},
{
"cell_type": "code",
"execution_count": 3,
"id": "e95b0266-5056-48d0-9410-df0d6fdb151e",
"execution_count": null,
"id": "c5ba8e2e-e1ec-447c-8cdb-4e6b35680e11",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/kushal/venvs/mescore/lib/python3.11/site-packages/ipydatagrid/datagrid.py:445: UserWarning: Index name of 'index' is not round-trippable.\n",
" schema = pd.io.json.build_table_schema(dataframe)\n"
]
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "cb892b243f1e4ff1b8d3bea0fe890e9c",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"RFBOutputContext()"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "8836f855be97406d8f2246bd5a1e932f",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"RFBOutputContext()"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Decode mmap filename /home/kushal/caiman_data/mesmerize-batch/b3503ab5-6376-4cd4-8c33-7f80735fca82/b3503ab5-6376-4cd4-8c33-7f80735fca82-Sue_2x_3000_40_-46_els__d1_170_d2_170_d3_1_order_F_frames_3000.mmap\n",
"Decode mmap filename /home/kushal/caiman_data/mesmerize-batch/b3503ab5-6376-4cd4-8c33-7f80735fca82/b3503ab5-6376-4cd4-8c33-7f80735fca82-Sue_2x_3000_40_-46_els__d1_170_d2_170_d3_1_order_F_frames_3000.mmap\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/home/kushal/repos/fastplotlib/fastplotlib/graphics/features/_base.py:34: UserWarning: converting float64 array to float32\n",
" warn(f\"converting {array.dtype} array to float32\")\n",
"/home/kushal/repos/fastplotlib/fastplotlib/graphics/features/_base.py:123: UserWarning: Event handler <bound method GridPlotWrapper.set_frame_index of <mesmerize_viz._cnmf.GridPlotWrapper object at 0x7f10e7ca0190>> is already registered.\n",
" warn(f\"Event handler {handler} is already registered.\")\n",
"/home/kushal/repos/fastplotlib/fastplotlib/graphics/features/_base.py:123: UserWarning: Event handler <bound method Interaction._event_handler of 'contours': LineCollection @ 0x7f10d8284590\n",
"Collection of <155> Graphics> is already registered.\n",
" warn(f\"Event handler {handler} is already registered.\")\n",
"/home/kushal/repos/fastplotlib/fastplotlib/graphics/features/_base.py:123: UserWarning: Event handler <bound method Interaction._event_handler of 'contours': LineCollection @ 0x7f10c444c590\n",
"Collection of <155> Graphics> is already registered.\n",
" warn(f\"Event handler {handler} is already registered.\")\n",
"/home/kushal/repos/fastplotlib/fastplotlib/graphics/features/_base.py:123: UserWarning: Event handler <bound method Interaction._event_handler of 'contours': LineCollection @ 0x7f10c41bc590\n",
"Collection of <155> Graphics> is already registered.\n",
" warn(f\"Event handler {handler} is already registered.\")\n",
"/home/kushal/repos/fastplotlib/fastplotlib/graphics/features/_base.py:123: UserWarning: Event handler <bound method Interaction._event_handler of 'contours': LineCollection @ 0x7f10a453c590\n",
"Collection of <155> Graphics> is already registered.\n",
" warn(f\"Event handler {handler} is already registered.\")\n",
"/home/kushal/repos/mesmerize-viz/mesmerize_viz/_cnmf.py:854: FutureWarning: You are trying to use the following experimental feature, this may change in the future without warning:\n",
"CaimanDataFrameExtensions.get_params_diffs\n",
"This feature is new and the might improve in the future\n",
"\n",
" param_diffs = self._dataframe.caiman.get_params_diffs(\n"
]
}
],
"outputs": [],
"source": [
"container_widget = df.cnmf.viz(start_index=1)"
"# optional\n",
"# %gui qt"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "96636ad0-cde7-437d-a1ce-609287f6d005",
"execution_count": null,
"id": "914fb902-1476-4ba8-9b8e-85c338211fba",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "19a4952086494afa9089e11a1bf2eace",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"VBox(children=(HBox(children=(DataGrid(auto_fit_params={'area': 'all', 'padding': 30, 'numCols': None}, base_r…"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"viz = df.cnmf.viz(temporal_kwargs={\"add_residuals\": True})"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c0427b7d-b14b-4cfe-91af-d555c92e5557",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"viz.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "510b2710-744a-4e26-a485-e494d22fbd81",
"metadata": {},
"outputs": [],
"source": [
"viz.cnmf_obj.estimates.idx_components"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "517e9e01-0f45-49b0-b1b7-ff0a9b3a03bb",
"metadata": {},
"outputs": [],
"source": [
"viz.cnmf_obj.estimates.idx_components_bad"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "78c3bcf5-7147-44cc-a9af-c8c0969b9940",
"metadata": {},
"outputs": [],
"source": [
"container_widget.show()"
"df.iloc[1].cnmf.get_output().estimates.idx_components, df.iloc[1].cnmf.get_output().estimates.idx_components_bad"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2e0f395a-17c3-45ae-9fe6-adef0dd4ac44",
"id": "c32a7f90-6121-4e2e-8cd3-399cf0d5acd4",
"metadata": {},
"outputs": [],
"source": []
Expand All @@ -180,7 +121,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.3"
"version": "3.11.2"
}
},
"nbformat": 4,
Expand Down
Loading