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

n < size() error #73

Open
kg3354 opened this issue May 20, 2024 · 5 comments
Open

n < size() error #73

kg3354 opened this issue May 20, 2024 · 5 comments

Comments

@kg3354
Copy link

kg3354 commented May 20, 2024

Hello,
Me and my team are trying to embed Kafka into Miniscope, such that it sends the frames captured in real time, instead of delaying until the capture stops and then save to local.
There are several problems that we are encountering. When we use Qt Creator 5.15, we cannot compile the software downloaded from https://github.com/Aharoni-Lab/Miniscope-DAQ-QT-Software/archive/refs/tags/v1.11.zip, as it raise an n < size() error for every input from the jsonnnnnn file. As Miniscope was documented to be written in Qt 5.12, we tried compiling using version 5.12, but more issues were encountered.
The only modifications we made right now is the openCV configuration in the .pro file. It compiles but the n < size() error prevents us from using the jsonnnn file. What is that issue and how to fix that?

image

@sneakers-the-rat
Copy link
Contributor

We're working on retooling miniscope acquisition to allow for exactly this at https://github.com/Aharoni-Lab/miniscope-io

Havent ported this code over yet but its the next step

@kg3354
Copy link
Author

kg3354 commented May 20, 2024 via email

@sneakers-the-rat
Copy link
Contributor

still very early stages on miniscope-io, we haven't ported this code over yet.

if you're trying to compile, you might also see this branch where the last thing we will be doing on this software is to port it to Qt6 so we can leave it in a state where people can hack on it like this: https://github.com/Aharoni-Lab/Miniscope-DAQ-QT-Software/tree/feature-repro-build

still some work to do there too, need to figure out how to replace some Qt5 features that were deprecated in Qt6 without documentation - specifically the tree viewer for displaying the JSON configs - but probably a better target for you if you want to be working on the source here. any help there getting it to compile would b v welcome and we would mainline it :)

@kg3354
Copy link
Author

kg3354 commented May 21, 2024

I tried https://github.com/Aharoni-Lab/Miniscope-DAQ-QT-Software/tree/feature-repro-build, and it gave me 47 compilation errors. I am using python 3.7, Numpy 1,18.0, Qt 5.15, and OpenCV 4.4.0.
Is there a repo that we can use to just compile the program for now? I would say our progress with https://github.com/Aharoni-Lab/Miniscope-DAQ-QT-Software/archive/refs/tags/v1.11.zip was pretty far, we have the kafka feature written but we just cant get that size error fixed. It would be great if you can show us where to find the old compilable solution.

@sneakers-the-rat
Copy link
Contributor

so yes! like i said that's a WIP that is trying to update this repo to Qt6 so that we can leave it in a compilable state before moving onto miniscope-io which is where longterm dev energy will go (basically taking some of the code here, decoupling it from the GUI, and exposing it for eg. framewise programmatic usage as desired). That there is no reproducible/working compilation routine is the problem that branch is trying to resolve and why we are rearchitecting this code (see the deprecation notice in the README). Best i can do for you! this code was written before i got to the lab.

re: the issue at hand, would need more information to be able to debug that, but looking at the place in the source where it's being raised: https://code.qt.io/cgit/qt/qtbase.git/tree/src/corelib/text/qstring.h?h=v5.15.2#n469

you can see that the assert is in the inlined definition of the QString::chopped method. searching the source for usages of chopped we only find:

so the first two are checking for supported codecs on your computer. either you have too few supported codecs, or oddly too many, and either of those could throw that error since the screenshot doesn't show the source line that's causing it. that would be where i would start - ensuring that my version of opencv is compiled/configured with support for at least some of these codecs.

the third usage of chopped on L327 could also be the source of the error, at which point that would mean that your configuration file is malformed, specifically that some type key is missing, the last argument passed to handleJsonArray on this line:

m_jsonTreeModel->appendRow(handleJsonArray(m_standardItem.last(), m_userConfig[keys[i]].toArray(), m_configProps[keys[i]].toObject()["type"].toString()));

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