int-brain-lab / iblapps

pyqt5 dependent applications for IBL sessions
MIT License
25 stars 15 forks source link

ValueError: shape mismatch; _bnk_vals[idx_full] = data[bnk_idx] #103

Closed harshk95 closed 1 year ago

harshk95 commented 1 year ago

Hi, we have been trying to register data from a recording with neuropixels 2.0 with a custom recording configuration and sorted with KS3.0. We ran into the following issue when registering a particular shank. 2 shanks of this probe could be opened in the GUI but other 2 shanks give the error as shown below:

lfp data was not found, some plots will not display
rfmp data was not found, some plots will not display
passive stim data was not found, some plots will not display
passive gabor data was not found, some plots will not display
Traceback (most recent call last):
  File "C:\int-brain-lab\iblapps\atlaselectrophysiology\ephys_atlas_gui.py", line 1268, in data_button_pressed
    self.img_rms_APdata, self.probe_rms_APdata = self.plotdata.get_rms_data_img_probe('AP')
  File "C:\int-brain-lab\iblapps\atlaselectrophysiology\plot_data.py", line 461, in get_rms_data_img_probe
    probe_img, probe_scale, probe_offset = self.arrange_channels2banks(rms_avg)
  File "C:\int-brain-lab\iblapps\atlaselectrophysiology\plot_data.py", line 654, in arrange_channels2banks
    _bnk_vals[idx_full] = data[bnk_idx]
ValueError: shape mismatch: value array of shape (71,) could not be broadcast to indexing result of shape (0,)
lfp data was not found, some plots will not display
rfmp data was not found, some plots will not display
passive stim data was not found, some plots will not display
passive gabor data was not found, some plots will not display
Traceback (most recent call last):
  File "C:\int-brain-lab\iblapps\atlaselectrophysiology\ephys_atlas_gui.py", line 1268, in data_button_pressed
    self.img_rms_APdata, self.probe_rms_APdata = self.plotdata.get_rms_data_img_probe('AP')
  File "C:\int-brain-lab\iblapps\atlaselectrophysiology\plot_data.py", line 461, in get_rms_data_img_probe
    probe_img, probe_scale, probe_offset = self.arrange_channels2banks(rms_avg)
  File "C:\int-brain-lab\iblapps\atlaselectrophysiology\plot_data.py", line 654, in arrange_channels2banks
    _bnk_vals[idx_full] = data[bnk_idx]
ValueError: shape mismatch: value array of shape (48,) could not be broadcast to indexing result of shape (0,)

Any help will be greatly appreciated.

Thanks a lot.

mayofaulkner commented 1 year ago

Hi, would you be able to share your channels.localCoordinates, channels.rawInd and the spikeglx meta data that shows the channels arrangement, and perhaps also the channels.map that is output by kilosort? I can then take a look to see what's going wrong.

Thank you

harshk95 commented 1 year ago

Hi, We have attached the files! Thanks a lot. The image below is the channel locations when plotted using the 'channels.localCoordinates.npy', which we run as a sanity check. image diagnostics.zip

mayofaulkner commented 1 year ago

Looks like it might be linked to how the data is represented in the spikes.depths as I can't replicate the problem just from these channels. Would you be able to provide me with the full folder that you use to align with all the data? If better you can email me at mayo.faulkner@internationalbrainlab.org

Thanks a lot

harshk95 commented 1 year ago

Hi, Looks like updating to the latest versions fixed the issue. Thanks a lot!