Creating an app with an embeded visualizer

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Marcos Alfredo Núñez
Posts: 22
Joined: Thu Sep 01, 2016 1:41 pm

Creating an app with an embeded visualizer

Post by Marcos Alfredo Núñez » Mon Apr 23, 2018 7:02 am

Hi! I'm looking for some guidance here. I'm currently working on a Qt app that displays a OpenSIM 3.3 model visualizer, alongside some plots, a scrollbar to loop through some motion coordinates, and not much more. This is all being done in Python (pyqt)

Best case scenario question: is there a way to embedd a model Visualizer into a QtWidget or similar?
Worst case scenario question: I might have to relinquish using python here, I suspect due to the lack of simtk Python bindings in 3.3. Are there any examples of this kind of simple Visualizer app using C++ and QT?

Thanks in advance for your assistance.

User avatar
Ayman Habib
Posts: 2238
Joined: Fri Apr 01, 2005 12:24 pm

Re: Creating an app with an embeded visualizer

Post by Ayman Habib » Tue Apr 24, 2018 8:56 am

Dear Marcos,

At this point I would not recommend starting a project to write an application based on OpenSim 3.3, primarily because the API for OpenSim has undergone significant changes and version 4.0 source code which you most certainly will need, including python bindings, is already available on github.
The low level API visualizer is a separate process that gets invoked and communicates with the API using essentially a pipe, so likely hard to embed inside a pyqt widget.

I'd be interested to know why you want to write your own application, instead of plugging into the OpenSim application which is highly customizable and will save you a ton of work with the additional benefit of making what you develop usable by the large community of OpenSim users.

If you have specific questions regarding how to proceed please let me know (on github, or private message).

Best regards,
-Ayman

User avatar
Marcos Alfredo Núñez
Posts: 22
Joined: Thu Sep 01, 2016 1:41 pm

Re: Creating an app with an embeded visualizer

Post by Marcos Alfredo Núñez » Fri Apr 27, 2018 8:26 am

Dear Ayman:

Thanks for your response and kind disposition. Well, basically the goal here is to incorporate OpenSIM API's capabilities to a gaitlab workflow. The idea, instead of porting everything to OpenSIM, was to design a simple app that could be incorporated as a optional pipe in between our normal processes (eg: gait data acquisition, labeling, data processing and analysis, -->insert OpenSIM processing here <--, reporting). As you might expect, we have our own canned gaitlab software, and we specially don't want to alter much our reporting system. We've been experimenting with batch processing using Opensim 3.3 GUI scripting, but that invariably ended up sooner or later with a crash, and there's much that we can't do through jython. External API usage with Python works really well though, with the added advantage that most of our scripting is currently done in Python.

In this particular case, we wanted to make a simple application that has as inputs a standing trial and some walking trials. Then use the standing's markers to scale a model, do IK on the walking trials and get some muscle lengths. Put those muscle lengths back into the trial files, feed said files to the report software. Done. All in one single python script with a simple pyqt interface that shows the muscle lengths and their consistency. The key here is a fast and seamlessly integrated batch processing.

What we wanted to have was a fast visual representation of each trial's IK. Watch the skeleton and the markers move. Confirm visually that there was nothing terribly wrong with the results (inverted pelvises and other not so infrequent IK issues), whilst getting visual feedback on the results. So far, the ModelVisualizer has worked great. Embedding it on a window was more of a whim.

I've been following Opensim's 4.0 development with great interest, but we're just too far in this project to look back. We'll be switching to the new version as soon as it proves more stable, most likely when the new GUI arrives. Besides, even though I expect to find significant changes in the new API, at the end of the day is scaling and IK. Hopefully that won't change that much. I'd be nice to switch to Python 3 though :D .

One final question regarding the Visualizer: is it going to be phased out in 4.0? What's the plan for externally visualizing a model? I understand that opensim-visualizer is web based, but I haven't yet seen it working.

Thanks for your help, and please let me know what you think of all this.

Best regards,

Marcos

POST REPLY