Cannot select data point in UIFigure after compilation - matlab

I created an app in matlabs App Designer. The app includes a UIAxes element with some data points.
When running the app via "normal" matlab, it works great. I can select points and retrieve the coordinates using dcm_obj = datacursormode(app.UIFigure) and subsequently click_coords1 = getCursorInfo(dcm_obj);.
After compiling the app with Matlab Compiler (Share -> standalone desktop app -> include runtime in package) and running the compiled version, data points can no longer be selected. When I click on a data point in the figure, simply nothing happens. The data point is not selected and no tool tip appears. The code that normally returns the coordinates now returns nothing. I also noticed the figure itself looks less nice (scatter plot circles seem square-ish).
Other functionality does seem to work: Drop down menus and buttons, which retrieve & draw data in the figure, drawing new data in the figure is also no problem. I can also pan the figure (although for some reason that's very slow in Ubuntu 20, but not in CentOS 8).
I run the app using the provided bash script:
./run_myapp.sh [path to matlab]
There's no difference in running the app as local user or root. There's also no difference when referencing matlab runtime or "normal" matlab.
Details:
Matlab runtime version: V98
"Normal" matlab version: R2020a
Operating system: Ubuntu 20.04 / CentOS 8
The problem can be reproduced using the example Patients Display app that matlab App Designer provides. Compile it as standalone desktop app with the runtime included. Install it and run it using the provided bash script. Clicking on the data points is not possible (but it is possible in App Designer).

I faced the same issue. After a few unsuccessful attempts, I discovered that the following works:
dcm_obj = datacursormode(app.UIFigure);
if isdeployed
dcm_obj.Enable = 'on';
end
The "isdeployed" command is included to avoid warnings when executing the code in MATLAB. In the deployed version however, you need to actually click on the data points to get the datatip whereas in MATLAB just hovering over them is enough.

Related

How to get GLFW window Id of FlutterWindow

I am trying to build a video player using flutter for Desktop. There is a video_player plugin available for iOS and Android, but not for Desktop. So, for the time being thought of trying to use gstreamer for decoding and hardware rendering in C++ code as back-end to flutter. The idea is to pass the Window Id of the flutter window to gstreamer's glimagesink plugin for rendering the video.
I am using the latest code from https://github.com/google/flutter-desktop-embedding as the base for my experiments. Below mentioned points are with reference to this repo.
In file flutter-desktop-embedding/example/linux/main.cc, FlutterWindowController object is created as shown below.
flutter::FlutterWindowController flutter_controller(icu_data_path);
This internally calls
FlutterDesktopInit();
While hovering the mouse pointer on the above method, VS code shows the following
bool FlutterDesktopInit()
Sets up the library's graphic context. Must be called before any other
methods.
Note: Internally, this library uses GLFW, which does not support multiple
copies within the same process. Internally this calls glfwInit, which will
fail if you have called glfwInit elsewhere in the process.
It is clear that FlutterDesktopInit() uses GLFW to create window. Checked whether I can get the window handle. But, no luck. I could only get the FlutterWindow object as shown below.
flutter::FlutterWindow *win = flutter_controller.window();
Appreciate if somebody can give some hint on how to get the GLFW window handle, which can be used with glimagesink.
You can't get references to any GLFW objects through that API. This is by design because, as the comment you quoted says, you can't have multiple copies of GLFW within the same process. GLFW is statically linked into the Linux Flutter embedding, so you can't use GLFW in the runner or a plugin.
Implementing a video player should be done using the texture APIs, which will be added for GLFW in this PR.

Building a desktop app using ParaView API under the hood

I have this workflow with ParaView where I
1) load a dicom,
2) load a state where I perform actions on the dicom (sources, filters, custom filters, etc).
3) apply a custom macro where I initialize everything.
Then I have some custom macros that moves lines in the final result.
I would like to make a desktop app with a simple UI where a I have one button that executes the 3 necessary steps to initialize everything. And then I have three buttons that executes the custom macros.
So I'm basically making a simpler ParaView.
I have used the trace function that ParaView has to make a python script with all the steps and then executing them in the pvpython shell to test if I reach the same result that in the ParaView GUI.
But a simple script that just load the dicom makes the windows (Visualization Toolkit - Win320OpenGL) not responding.
What do you think is the best approach to do this?
This is fully supported by ParaView, as ParaView is not only an application but also a framework.
This is documented here : https://www.paraview.org/Wiki/Writing_Custom_Applications
Examples are in ParaView code : https://gitlab.kitware.com/paraview/paraview/tree/master/Examples/CustomApplications
For follow-up questions, I would suggest asking on the ParaView Discourse : https://discourse.paraview.org/

Open Multiple Unity Apps into Multiple Monitors

How do I open my Unity app, two single instances, into two different monitors full-screen (one in each monitor)?
Using this link https://docs.unity3d.com/Manual/CommandLineArguments.html I have found that according to Unity all I have to do to open my Unity application multiple times into two separate monitors I use the -adapter N command. I have tried this and it always loads into the Main Display monitor. Here is my commands to open the application twice into separate monitors:
start CCC.exe -force-d3d9 -adapter 1
start CCC.exe -force-d3d9 -adapter 2
I noticed in another article that only the d3d9 option works when using the -adapter option. Also, I'm using a NVIDIA® GeForce® GTX 1070 with 8GB GDDR5 with Dual monitors plugged in 2 of the HDMI adapter ports.
Has anyone got this working? Much appreciated!
Drew
Apparently if you use Extended displays on Windows they both act as the same adapter, not sure what the intended use of the adapter switch is.
Alternatively, you could try an external solution. Create a program (.net for instance) that launches both instances and then moves one of them to the other monitor. Check this guide to see how you can move a window from another program.
You probably want to use borderless windowed mode to show them fullscreen and still be able to move them to the desired position.
Ultimately, here's a paid solution that does all of this.

Can both image target and object target be added one single database in unity vuforia?

I am developing an android app where I have to train my app to recognize two images and four objects.I created one single database where I added all the images and objects target in vuforia developer site and created the unity package. Now neither image nor object is getting recognized.
Probably the problem is the same for objects and images.
I think you should share some more info about what your doing as well as some meaningful code implementing it.
W/O that, I would suggest:
verify that the database and trackables are loaded and active # runtime
if so, see in console that the trackables are tracked by Vuforia
if so, verify the code enabling your augmentations
Please confirm whether have run trough these steps already and what results you got. I can share some code and further tips once the issue is a little but more specific.
Regards

Labels on figures fail to display in a deployed Matlab application

I have a Matlab application deployed using Builder JA. I incorporated it into a larger Java-based web application. It was built on a Windows machine, which has actual matlab on it, and worked fine when I tested it there. I've deployed the application onto a Linux server, which has only the MCR on it. what happens now is that I can run the application via the web page, but the resulting graphs display only the graphics and not the text (title, axis labels, etc). This happens both when I use WebFigure(gcf) and when I use figtoImStream(gcf, jpg), so I don't think it's an issue with any one format. The issue seems to be in the hardcopy.p function, since the server logs show an error
{Warning: Failed to draw text string}
{> In /usr/local/MATLAB/MATLAB_Compiler_Runtime/v717/toolbox/matlab/graphics/hardcopy.p>hardcopy at 28
In compiler/private/hardcopyOutput at 58
In figToImStream at 73
In Gaussian_WBfigures_jpg at 635}
I've seen some things that suggest that this is an issue of Matlab looking for a font that isn't there, and some that suggest that this is an issue with the renderer. Does anyone have a solution for this?
Try plotting your labels with a different fonts or interpreters. there have been reports of bugs in matlab when printing with different interpreters. e.g. http://www.mathworks.com/support/bugreports/398506, http://www.mathworks.com/support/bugreports/309380
figure
text(0.5,0.5,'testa','Fontname','Arial')
text(0.5,0.6,'testa','Fontname','Times')
text(0.5,0.7,'testa','Fontname','Times','Interpreter','Tex')
text(0.5,0.8,'testa','Fontname','Times','Interpreter','Latex')