Skip to content

Commit

Permalink
updated from review bits
Browse files Browse the repository at this point in the history
  • Loading branch information
EricThomson committed Aug 25, 2023
1 parent e8aaef2 commit e7055c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
3 changes: 0 additions & 3 deletions caiman/motion_correction.py
Original file line number Diff line number Diff line change
Expand Up @@ -3076,9 +3076,6 @@ def tile_and_correct_wrapper(params):
extension = extension.lower()
shift_info = []

print("In tile and correct wrapper about to call load with subidxs")
print(f"subidx type: {type(idxs)}")

imgs = cm.load(img_name, subindices=idxs, var_name_hdf5=var_name_hdf5,is3D=is3D)
imgs = imgs[(slice(None),) + indices]
mc = np.zeros(imgs.shape, dtype=np.float32)
Expand Down
25 changes: 7 additions & 18 deletions demos/notebooks/demo_online_cnmfE.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"import logging\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from time import time\n",
"\n",
"import caiman as cm\n",
"from caiman.source_extraction import cnmf as cnmf\n",
Expand Down Expand Up @@ -174,8 +175,7 @@
" cm.load(mc.mmap_file).resize(1, 1, temporal_downsampling)), axis=2).play(fr=30,\n",
" magnification=1,\n",
" gain=0.6,\n",
" plot_text=True,\n",
" do_loop=True)\n",
" plot_text=True)\n",
"#plt.figure(); plt.plot(mc.shifts_rig); plt.legend(['x-shifts', 'y-shifts']) "
]
},
Expand All @@ -202,7 +202,8 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Inspect correlation and PNR images to set relevant thresholds"
"### Inspect correlation and PNR images to set relevant thresholds\n",
"First, extract correlation and pnr images."
]
},
{
Expand All @@ -212,12 +213,9 @@
"outputs": [],
"source": [
"gSig = (6, 6)\n",
"\n",
"cn_filter, pnr = cm.summary_images.correlation_pnr(images[::max(T//1000, 1)], \n",
" gSig=gSig[0], \n",
" swap_dim=False) # change swap dim if output looks weird, it is a problem with tiffile\n",
"\n",
"\n"
" swap_dim=False) # change swap dim if output looks weird, it is a problem with tiffile"
]
},
{
Expand Down Expand Up @@ -294,20 +292,11 @@
"metadata": {},
"outputs": [],
"source": [
"from time import time\n",
"t1 = -time()\n",
"cnm = cnmf.CNMF(n_processes=n_processes, dview=dview, params=opts)\n",
"cnm.fit(images)\n",
"t1 += time()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"print(f\"Wall time: {t1: 0.2f} seconds\")"
"t1 += time()\n",
"print(f\"Elapsed time: {t1: 0.2f} seconds\")"
]
},
{
Expand Down

0 comments on commit e7055c0

Please sign in to comment.