Computational toolbox for large scale Calcium Imaging Analysis, including movie handling, motion correction, source extraction, spike deconvolution and result visualization.
Which demo exhibits the problem (if applicable): N/A
How you installed Caiman (pure conda, conda + compile, colab, ..): Colab
Details: I first Initialized the model with
cnmf_model = cnmf.CNMF(n_processes, params=parameters, dview=multiprocessing_pool)
then I have run the model with
cnmf_fit = cnmf_model.fit(images)
Then without reinitializing the cnmf object I updated the parameters of the model with:
cnmf_model.params.change_params(params_dict=cnmf_new_params)
Then I have run the
cnmf_model.fit again
and it threw the Index out of bound error:
`
IndexError Traceback (most recent call last)
in
[/content/CaImAn/caiman/source_extraction/cnmf/cnmf.py](https://localhost:8080/#) in fit(self, images, indices)
641 else:
642 while len(self.estimates.merged_ROIs) > 0:
--> 643 self.merge_comps(Yr, mx=np.Inf)
644
645 logging.info("update temporal")
1 frames
[/content/CaImAn/caiman/source_extraction/cnmf/merging.py](https://localhost:8080/#) in merge_components(Y, A, b, C, R, f, S, sn_pix, temporal_params, spatial_params, dview, thr, fast_merge, mx, bl, c1, sn, g, merge_parallel, max_merge_area)
273 # we continue for the variables
274 if S is not None:
--> 275 S = np.vstack((S[good_neurons, :], S_merged))
276 if R is not None:
277 R = np.vstack((R[good_neurons, :], R_merged))
IndexError: index 215 is out of bounds for axis 0 with size 4`
After re-initializing the cnmf object cnmf_model.fit worked.
Thanks for bringing this to our attention! I have replicated this outside of colab as well, and it is something we should fix. Will think about best approach for this after Lindoscope.
CNMF_Fit Index Out of Bound
Your setup:
cnmf_model = cnmf.CNMF(n_processes, params=parameters, dview=multiprocessing_pool)
then I have run the model withcnmf_fit = cnmf_model.fit(images)
Then without reinitializing the cnmf object I updated the parameters of the model with:cnmf_model.params.change_params(params_dict=cnmf_new_params)
Then I have run thecnmf_model.fit
again and it threw the Index out of bound error:` IndexError Traceback (most recent call last)