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

manual annotation in the VolPy GUI. problem #1451

Open
Vignesh-786 opened this issue Jan 16, 2025 · 22 comments
Open

manual annotation in the VolPy GUI. problem #1451

Vignesh-786 opened this issue Jan 16, 2025 · 22 comments

Comments

@Vignesh-786
Copy link

I am experiencing difficulties with custom data manual annotation in the VolPy GUI. The user interface that I see is reflected in the image. Kindly provide me with some suggestions to overcome this issue.

Image
@pgunn
Copy link
Member

pgunn commented Jan 21, 2025

Hello,
If you drag the window wider, does the button overlap with labels clear out?

@Vignesh-786
Copy link
Author

Hi there,

Yes it is looks same even if I drag the window wider and I don't see the options in 'images, display, and mode'. I am using Mac M3

@pgunn
Copy link
Member

pgunn commented Jan 21, 2025

I've rarely used that GUI and am currently working on getting it working on my system; as soon as I do I'll look into these UI issues. Hopefully this won't take too long.

@pgunn
Copy link
Member

pgunn commented Jan 21, 2025

@caichangjia Giving you a heads-up on this as well

@pgunn
Copy link
Member

pgunn commented Jan 22, 2025

@Vignesh-786 I just ported the volpy gui to use PyQt6 through the pyside6 package; I'm wondering if this might be better-behaved.

Do you mind grabbing this, making sure pyside6 is in your environment (it may already be), and giving it another go?

https://raw.githubusercontent.com/flatironinstitute/CaImAn/8090e272fbaab1accc20fa384646507417e4566f/caiman/source_extraction/volpy/volpy_gui.py

@Vignesh-786
Copy link
Author

Hello pgunn,

The Volpy GUI crashed before opening, and I am receiving the following error message:

Image Image

@pgunn
Copy link
Member

pgunn commented Jan 22, 2025

I'll have to do more testing on OSX then; this was the result of a quick porting effort today on my Linux workstation, where it seems to launch okay. Will get back to you after I try it, hopefully later tonight, on a mac laptop I keep at home.

@Vignesh-786
Copy link
Author

I would like to express my sincere gratitude for your diligent efforts and prompt responses.

@pgunn
Copy link
Member

pgunn commented Jan 22, 2025

Based on a stackoverflow thing, changing the import order may actually make a difference here; I made a quick revision to the script here that may solve the issue (really unsure without testing, but I won't be able to test until I get home); if you want to try it earlier, see:

https://github.com/flatironinstitute/CaImAn/blob/dev-volpy_qt6/caiman/source_extraction/volpy/volpy.py

@pgunn
Copy link
Member

pgunn commented Jan 24, 2025

@Vignesh-786 After digging into it further, I filed an issue with pyqtgraph, where it appears to be a bug that's been open for a few years(!). Fortunately, there looks to be a workaround or two; unfortunately, because it's been an open bug for a few years, I doubt it'll be fixed very quickly.

pyqtgraph/pyqtgraph#3227
pyqtgraph/pyqtgraph#2380

I'll give the workarounds a go and try to get back to you soon when I've picked one.

@pgunn
Copy link
Member

pgunn commented Jan 24, 2025

While workarounds (that I'm working on) should hopefully address the button-display issue, I wasn't able to reproduce the crash last nmight. I'll need to experiment with that a bit more.

If you have the time, if you can pastebin the output of conda list in your conda environment that may help me figure out what's going wrong leading to the crash.

@Vignesh-786
Copy link
Author

Hi Pgunn,

Attached is the output of conda list for the caiman environment .

caiman_env_VS.txt

@pgunn
Copy link
Member

pgunn commented Jan 24, 2025

Thanks; when I get home tonight I'll do my best to replicate that and see if I can reproduce (and then fix, if I can) the crash. My theory is that it's a package list issue and that we can adjust the environment not to have the issue.

I'll also hopefully be able to get you a solution to the messed-up buttons; I looked over the pyqtgraph issues and think I've (probably) translated it to something that might work - just need to try it.

(I realise that the volpy part of caiman is underdocumented; I'm hoping we can find a way to better document it soon, but I need to get some help from developers on the team who've used it and they're fairly busy with other things; I've never used it myself)

Cheers

@pgunn
Copy link
Member

pgunn commented Jan 27, 2025

I'm trying to poke the pyqtgraph devs on the overlaid buttons issue, but in the meantime, I think the crash may be due to the unusual mix of packages and where they came from in this environment; a fair number of your installs come from pip, and you probably don't need both pyqt6 and pyside6. This may relate to mesmerize-core though, which I'm less familiar with in terms of its dependencies.

Do you know where your pyqt6 install came from? I don't see it on the dependencies list for either mezmerise-core or fastplotlib.

@pgunn
Copy link
Member

pgunn commented Jan 27, 2025

So I have a solution for the duplicated buttons issue:

if sys.platform == 'darwin':

PySide6.QtWidgets.QApplication.setStyle("fusion")

(this may or may not translate down into a pyqt call)

@Vignesh-786
Copy link
Author

Vignesh-786 commented Jan 27, 2025 via email

@pgunn
Copy link
Member

pgunn commented Jan 27, 2025

Unfortunately, now we're hitting the point where it's not clear to me if the code is working as expected and we're just not using it right, or if we've found a bug.

I might guess that one needs to load data and load ROIs before those parts of the UI become functional, but I don't know that for sure.

@caichangjia

@Vignesh-786
Copy link
Author

Vignesh-786 commented Jan 27, 2025 via email

@pgunn
Copy link
Member

pgunn commented Jan 27, 2025

I'm hoping Cai might be able to illuminate how this is supposed to work (he wrote that code).

@pgunn
Copy link
Member

pgunn commented Jan 27, 2025

Looking more at the code, I think we're hitting another bug in pyqtgraph, and a lot of the sample code for dropdown lists I can find on the internet doesn't work for me. Looking into whether I can put a QComboBox into a pyqtgraph; using that widget on its own seems to work fine.

@pgunn
Copy link
Member

pgunn commented Jan 27, 2025

I have a potential solution. Give me a moment to update the PR. I don't have a great way to test it though.

@pgunn
Copy link
Member

pgunn commented Jan 27, 2025

@Vignesh-786 Ok, give this version a try; I have confirmed that you will need to load the data before using those menus, but the menus otherwise work now.

https://github.com/flatironinstitute/CaImAn/blob/66120c771c2653220b57b649c03a4d24033fc34f/caiman/source_extraction/volpy/volpy_gui.py

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