Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Neuropixel loading issues: OverflowError: cannot convert float infinity to integer #7

Open
majidkhalili opened this issue Nov 28, 2024 · 5 comments

Comments

@majidkhalili
Copy link

majidkhalili commented Nov 28, 2024

Hello IBL team,

While loading a Neuropixel data recorded from OpenEphys (.oebin file) into the viewephys GUI, I get the following error:

C:\Users\Majid\anaconda3\envs\ibllib_np_env\Lib\site-packages\one\alf\files.py:10: FutureWarning: one.alf.files will be removed in version 3.0. Use one.alf.path instead.
warnings.warn(
None
Traceback (most recent call last):
File "C:\Users\Majid\anaconda3\envs\ibllib_np_env\Lib\site-packages\viewephys\gui.py", line 89, in open_file
self.on_horizontalSliderReleased()
File "C:\Users\Majid\anaconda3\envs\ibllib_np_env\Lib\site-packages\viewephys\gui.py", line 115, in on_horizontalSliderReleased
self.viewers[k] = viewephys(data, self.sr.fs, channels=self.sr.geometry, title=k, t0=t0 * T_SCALAR, t_scalar=T_SCALAR, a_scalar=A_SCALAR)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Majid\anaconda3\envs\ibllib_np_env\Lib\site-packages\viewephys\gui.py", line 369, in viewephys
ev.ctrl.update_data(data.T * a_scalar, si=1 / fs * t_scalar, h=channels, taxis=0, t0=t0)
File "C:\Users\Majid\anaconda3\envs\ibllib_np_env\Lib\site-packages\easyqc\gui.py", line 454, in update_data
self.view.imageItem_seismic.setImage(data[:, self.trace_indices])
File "C:\Users\Majid\anaconda3\envs\ibllib_np_env\Lib\site-packages\pyqtgraph\graphicsItems\ImageItem.py", line 417, in setImage
mn, mx = self.quickMinMax( targetSize=level_samples )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Majid\anaconda3\envs\ibllib_np_env\Lib\site-packages\pyqtgraph\graphicsItems\ImageItem.py", line 501, in quickMinMax
return self._xp.nanmin(data), self._xp.nanmax(data)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Majid\anaconda3\envs\ibllib_np_env\Lib\site-packages\numpy\lib_nanfunctions_impl.py", line 360, in nanmin
res = np.fmin.reduce(a, axis=axis, out=out, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: zero-size array to reduction operation fmin which has no identity
C:\Users\Majid\anaconda3\envs\ibllib_np_env\Lib\site-packages\easyqc\gui.py:215: RuntimeWarning: divide by zero encountered in scalar divide
maximum = int((doclength - range) / doclength * 65536)
Traceback (most recent call last):
File "C:\Users\Majid\anaconda3\envs\ibllib_np_env\Lib\site-packages\easyqc\gui.py", line 223, in on_sigRangeChanged
set_scroll(self.verticalScrollBar, yr, yl)
File "C:\Users\Majid\anaconda3\envs\ibllib_np_env\Lib\site-packages\easyqc\gui.py", line 215, in set_scroll
maximum = int((doclength - range) / doclength * 65536)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OverflowError: cannot convert float infinity to integer
Traceback (most recent call last):
File "C:\Users\Majid\anaconda3\envs\ibllib_np_env\Lib\site-packages\easyqc\gui.py", line 223, in on_sigRangeChanged
set_scroll(self.verticalScrollBar, yr, yl)
File "C:\Users\Majid\anaconda3\envs\ibllib_np_env\Lib\site-packages\easyqc\gui.py", line 215, in set_scroll
maximum = int((doclength - range) / doclength * 65536)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OverflowError: cannot convert float infinity to integer

Any idea what might be the issue? And how I can resolve it?

Thanks in advance!

@oliche
Copy link
Member

oliche commented Nov 29, 2024

Hello,

We do not yet support OpenEphys files in the loading.

But it may be a trivial change, would you have any issues sharing part or all of this .oebin file ? If you know public datasets in this very format that could also be an option !

@majidkhalili
Copy link
Author

Hello Oliche,

Ah, what a pity.

Here I have uploaded a one minute of the recording, in OpenEphys binary format: https://we.tl/t-Ub0AlutdPe

@oliche oliche closed this as completed in cfe6184 Dec 6, 2024
@oliche oliche reopened this Dec 6, 2024
@oliche
Copy link
Member

oliche commented Dec 6, 2024

Hello,

The main issue seems to be that the binary file containing voltage traces is not the oebin file, but the dat file. You couldn't possibly open the file as the file filters was only looking for filtypes in *.*bin.

In your case this is the file containing the data:
Sample_Recording/2024-12-03_19-14-39/Record Node 101/experiment1/recording1/continuous/File_Reader-100.Neuropix-PXI-100.ProbeA-AP/continuous.dat

After this a few more fixes were necessary to load open ephys data.

You will need to update viewephys to 1.0.1, which should also update your ibl-neuropixel package to 1.6.0.
You should normally then be able to load and look at your data !

@majidkhalili
Copy link
Author

Great, thanks!

I can load the data now, however, when I try to use the destripe method I get the following error:

"...\envs\ibl_neuropixel_env\Lib\site-packages\neuropixel.py", line 145, in dense_layout
np.floor(version) == 2 and nshank == 1
^^^^^^^^^^^^^^^^^
TypeError: must be real number, not NoneType

PS: using pip for upgrading (or new installation) of the ibl-neuropixel package indicates that the latest version is 1.5.0.

@oliche
Copy link
Member

oliche commented Dec 11, 2024

Oh this is my bad, 1.6.0 was not available through pip.
It is not the case anymore (cf. https://pypi.org/project/ibl-neuropixel/), and pip install -U ibl-neuropixel will get you 1.6.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants