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

Axes not displaying correctly on external monitor #85

Open
kristinksellers opened this issue May 8, 2020 · 16 comments
Open

Axes not displaying correctly on external monitor #85

kristinksellers opened this issue May 8, 2020 · 16 comments

Comments

@kristinksellers
Copy link

The error below occurs after selecting the file 'CP3Rt_2019_07_15_16_51_45__MR_9.nwb' upon start up of ecogvis. This file is shared via Box (ChangLabData_ShareWithCatalystNeuro/CP3)

No 'preprocessed' data in 'processing' group.
No 'high_gamma' data in 'processing' group.
C:\Anaconda\envs\ecogVIS_CatalystNeuro\lib\site-packages\hdmf\spec\namespace.py:470: UserWarning: ignoring namespace 'hdmf-common' because it already exists
  warn("ignoring namespace '%s' because it already exists" % ns['name'])
C:\Anaconda\envs\ecogVIS_CatalystNeuro\lib\site-packages\hdmf\spec\namespace.py:470: UserWarning: ignoring namespace 'core' because it already exists
  warn("ignoring namespace '%s' because it already exists" % ns['name'])
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-8-1fba33462e73> in <module>
----> 1 main('')

C:\Anaconda\envs\ecogVIS_CatalystNeuro\lib\site-packages\ecogvis\ecogvis.py in main(filename)
    969     if app is None:
    970         app = QApplication(sys.argv)  # instantiate a QtGui (holder for the app)
--> 971     ex = Application(filename=filename)
    972     sys.exit(app.exec_())
    973 

C:\Anaconda\envs\ecogVIS_CatalystNeuro\lib\site-packages\ecogvis\ecogvis.py in __init__(self, filename, parent)
     70 
     71         # Run the main function
---> 72         self.model = TimeSeriesPlotter(self)
     73 
     74     def closeEvent(self, event):

C:\Anaconda\envs\ecogVIS_CatalystNeuro\lib\site-packages\ecogvis\functions\subFunctions.py in __init__(self, par)
     83 
     84         self.current_rect = []
---> 85         self.badChannels = np.where( self.nwb.electrodes['bad'][:] )[0].tolist()
     86 
     87         # Load invalid intervals from NWB file

C:\Anaconda\envs\ecogVIS_CatalystNeuro\lib\site-packages\hdmf\common\table.py in __getitem__(self, key)
    502                 return self.__indices[key]
    503             else:
--> 504                 raise KeyError(key)
    505         else:
    506             # index by int, list, or slice --> return pandas Dataframe consisting of one or more rows

KeyError: 'bad'

@jessierliu
Copy link
Contributor

jessierliu commented May 8, 2020

How did you create that NWB file? Looks like that file is missing some columns in the electrodes table potentially. If you open up that file and do something like:
nwbfile.electrodes.to_dataframe()
we should be able to see what the columns are. That functionality is so the "bad" elecs are turned red in the main GUI.

@kristinksellers
Copy link
Author

@jrliu95 I don't think I added the 'bad' column -- so it appears that having that column is mandatory?
image

@jessierliu
Copy link
Contributor

Yeah you need to have it in the current implementation of ecogVIS. I think we had discussed moving bad electrode annotating out of the file and to instead write to a csv like how bad time intervals are currently implemented. So that if one person marks it as bad, it's not marked bad for everyone.

I don't know if you (or maybe Matt) have specific thoughts on this? If so, let's open a separate issue.

@jessierliu
Copy link
Contributor

Also, I'm assuming the contacts column woudn't be there anymore once the bipolar scheme is finalized?

@luiztauffer
Copy link
Member

This was fixed in 6cb430b
Can you try using the latest repo version and let me know if the problem persists on your side?

@kristinksellers
Copy link
Author

@jrliu95 Yes - contacts is just temporary until we have bipolar scheme

@kristinksellers
Copy link
Author

@luiztauffer I pip uninstalled ecogvis and installed using github version. Launched ecogvis from command line, selected the file, and got the following:

(ecogVIS_CatalystNeuro) C:\Users\Kristin Sellers>ecogvis
c:\anaconda\envs\ecogvis_catalystneuro\lib\site-packages\hdmf\spec\namespace.py:470: UserWarning: ignoring namespace 'hdmf-common' because it already exists
  warn("ignoring namespace '%s' because it already exists" % ns['name'])
c:\anaconda\envs\ecogvis_catalystneuro\lib\site-packages\hdmf\spec\namespace.py:470: UserWarning: ignoring namespace 'core' because it already exists
  warn("ignoring namespace '%s' because it already exists" % ns['name'])
No 'preprocessed' data in 'processing' group.
No 'high_gamma' data in 'processing' group.
Traceback (most recent call last):
  File "c:\anaconda\envs\ecogvis_catalystneuro\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\anaconda\envs\ecogvis_catalystneuro\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Anaconda\envs\ecogVIS_CatalystNeuro\Scripts\ecogvis.exe\__main__.py", line 7, in <module>
  File "c:\anaconda\envs\ecogvis_catalystneuro\lib\site-packages\ecogvis\ecogvis.py", line 1003, in main
    ex = Application(filename=filename)
  File "c:\anaconda\envs\ecogvis_catalystneuro\lib\site-packages\ecogvis\ecogvis.py", line 85, in __init__
    self.model = TimeSeriesPlotter(self)
  File "c:\anaconda\envs\ecogvis_catalystneuro\lib\site-packages\ecogvis\functions\subFunctions.py", line 132, in __init__
    self.updateCurXAxisPosition()
  File "c:\anaconda\envs\ecogvis_catalystneuro\lib\site-packages\ecogvis\functions\subFunctions.py", line 363, in updateCurXAxisPosition
    self.refreshScreen()
  File "c:\anaconda\envs\ecogvis_catalystneuro\lib\site-packages\ecogvis\functions\subFunctions.py", line 184, in refreshScreen
    self.TimeSeries_plotter()
  File "c:\anaconda\envs\ecogvis_catalystneuro\lib\site-packages\ecogvis\functions\subFunctions.py", line 313, in TimeSeries_plotter
    plt3.setYRange(np.min(stimData), np.max(stimData))
UnboundLocalError: local variable 'stimData' referenced before assignment

@luiztauffer
Copy link
Member

luiztauffer commented May 9, 2020

I found the problem, thanks for informing me!
This doesn't happen in the shared file though. Is it possible to share this one as well, so it will be easier to reproduce future error?

edit: Sorry I automatically closed the issue on commit. I'll wait to see if things are working on your side!

@luiztauffer luiztauffer reopened this May 9, 2020
@kristinksellers
Copy link
Author

@luiztauffer I'm now able to open this file - thanks! However, I'm again experiencing the x- and y-axis misalignment

The file I'm testing is in our shared Box folder (ChangLabData_ShareWithCatalystNeuro) in the subfolder 'CP3'

image

@luiztauffer
Copy link
Member

I can't reproduce the error here:
gif_137

what's your OS?

@kristinksellers
Copy link
Author

I'm running Windows 10 Pro

Interestingly, the axes are fine when I have the GUI window on my laptop screen, but the problem occurs when I drag (the exact same GUI window) over to my external monitor. Problem goes away when I move back to my laptop screen

@luiztauffer
Copy link
Member

@kristinksellers does it happen if you open directly on the external monitor, instead of dragging it?

@kristinksellers
Copy link
Author

@luiztauffer

In trying to test this, I first pulled the latest repo version of ecogvis. In trying to install, it said I needed to update PyQt5 and PyQt5-sip, which I did (to versions 5.14.2 and 12.8.0, respectively) and then pulled ecogvis again.

Now I'm not able to launch ecogvis -- do I need to revert to a previous version of a library?

image

@luiztauffer
Copy link
Member

@kristinksellers

I’m sorry for these problems, but unfortunately they’re common with pyqt and windows… in the most current version we’ve added PyQtWebEngine as a dependency and that’s what seems to be causing the error. Usually a fresh install in a new environment solves it. But let’s try a couple of different solutions:

Option 1. In your current env

pip uninstall PyQt5
pip uninstall PyQt5-sip
pip uninstall PyQtWebEngine
pip install PyQt5
pip install PyQt5-sip
pip install PyQtWebEngine

then if you enter pip freeze you should see these versions:

PyQt5==5.15.0
PyQt5-sip==12.8.0
PyQtWebEngine==5.15.0

Option 2. Install in a fresh new environment, from the root dir of the ecogvis project:

conda create -n <your-env-name> python=3.7 pip
conda activate <your-env-name>
pip install .

let me know if the problem got solved then

@kristinksellers
Copy link
Author

@luiztauffer The first option worked to fix my environment -- thanks!!

Re the earlier problem (x-axis not displaying correctly on external monitor) - this is still occurring when I open directly on the external monitor. Fixing this is low priority because there is a manageable workaround (just use laptop monitor), so don't spend too much time on it.

@luiztauffer luiztauffer changed the title Cannot open NWB file in ecogvis Axes not displaying correctly on external monitor Jul 2, 2020
@luiztauffer
Copy link
Member

the new monitor problem seems to be a known issue with pyqtgraph, leaving some references here:
pyqtgraph/pyqtgraph#756
https://stackoverflow.com/questions/45108069/pyqtgraph-axes-not-displaying-correctly

I tried solutions proposed on both links, but they actually worsened the GUI. Let's keep an eye on those Issues.

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

3 participants