help > matlab plugins
Showing 1-15 of 15 posts
Display:
Results per page:
Jun 28, 2017  02:06 PM | keran liu
matlab plugins
Excuse me, I want to build my own plugin with dll file created by a matlab code.
1,So first, I create a dynamic and static library functions use matlab code in matlab R2013a.
2, Then I call them in a C++ project, it work successfully.
3, when I add it to a plugin project, I can successfully create a dynamic and static library functions.
4,then I add them to my_v3d_math\v3d_external\bin\plugins\example, when I open vaa3d_msvc.exe, I can see example function, But when I click it, I can't find responding function defined in my plugin project.
So , can you tell me how to solve it?
Attachment: C++.png
Jun 29, 2017  06:06 PM | Hsienchi Kuo
RE: matlab plugins
Hi there,

Do you intend to directly use tipdetection from plugin interface?

To have your implementations show up you need to provide 'menulist()' method in your plugin class for the plugin loader which is in Vaa3D main body. On top of that, you also need to implement 'domenu()' method to catch the 3 input arguments instead of 2: 1) 'sub-menu name under your plugin', 2) callback, and 3) the widget parent pointer. So yes, plugins are supposed to be classes, not just plain function directly catches callback and widget parent pointer. 

I suggest that you use _Vaa3D_plugin_creator, the first option under the plugin tab, to implement your plugin. There you can have pre-set-up plugin template and save you a lot of time.
Jul 2, 2017  02:07 AM | keran liu
RE: matlab plugins
thank you very much!I will have a try.
Jul 4, 2017  08:07 AM | keran liu
RE: matlab plugins
Hi, thank your help. But I still have a question.
When I was create a plugin , can I call MATLAB function after I add related lib and include folder?
I found when I add my some MATLAB functions like class "mwArray" in plugin , although it can generate file successfully, But it will get error when I call them in v3d.exe.
Then , when I delete these part, the function become normal! So why this happen?
Jul 5, 2017  06:07 PM | Hsienchi Kuo
RE: matlab plugins
Did you use matlab-gernated C code? 

Can you attach a screenshot showing how you did it, as well as the error message?

Thanks
Jul 5, 2017  06:07 PM | Zhi Zhou
RE: matlab plugins
You cannot run Matlab function in Vaa3D. You may have to find similar c++ based functions.
Jul 6, 2017  12:07 PM | keran liu
RE: matlab plugins
I know , So I transform MATLAB function into C++ function use mcc order, but it still don't work...
Now I decide to transform MATLAB function into C++ function by myself ,  by the way , if I have a point's coordinate , how can I show it as a marker like follow image .
Jul 6, 2017  07:07 PM | Zhi Zhou
RE: matlab plugins
You can use "writeMarker_file" function under https://github.com/Vaa3D/v3d_external/bl...
Jul 7, 2017  02:07 AM | keran liu
RE: matlab plugins
I want to show the point marker directly. Like follow image , not first write a marker file then load it .
Attachment: marker.png
Jul 7, 2017  07:07 PM | Zhi Zhou
RE: matlab plugins
Here is one example  https://github.com/Vaa3D/vaa3d_tools/blo... line 179-211

v3d.open3DWindow(curwin);

//now push the data to the 3d viewer's display
for (int curloop=0; curloop<=100; curloop++)
{
LandmarkList curlist;
for (int i=0;i<20; i++)
{
LocationSimple s;
s.x = rand()%oldsz0;
s.y = rand()%oldsz1;
s.z = rand()%oldsz2;
if (i<10)
s.radius = 10*i;
else {
s.radius=s.radius*0.5;
}
curlist << s;
}
v3d.setLandmark(curwin, curlist);
v3d.setImageName(curwin, QString("push now %1").arg(curloop));
v3d.pushObjectIn3DWindow(curwin);
//100812 RZC: put here in loop is more safe, every loop checking makes sure that the view3d is open.
View3DControl *view = v3d.getView3DControl(curwin);
if (view) view->setXRotation(curloop*360/100);
if (view) view->setYRotation(curloop*360/100);
if (view) view->setZRotation(curloop*360/100);
v3d.updateImageWindow(curwin);
Jul 9, 2017  05:07 AM | keran liu
RE: matlab plugins
thank you very much. I will try
Jul 10, 2017  02:07 AM | keran liu
RE: matlab plugins
Excuse me, If I want to use canny or medfilt2 functions in MATLAB or OPENCV , how can I do? Did v3d project contain these functions?
Jul 10, 2017  02:07 AM | Hsienchi Kuo
RE: matlab plugins
Yes. Plug-In -> image_filters.

There are various image analysis/processing functionalities can be found under Plug-In tab.
Jul 10, 2017  02:07 AM | keran liu
RE: matlab plugins
thank you for your reply. I just want to add these functions to my plugin project, so can I call these functions directly.
Jul 10, 2017  04:07 AM | Zhi Zhou
RE: matlab plugins
You cannot directly use Matlab functions. If you want to use libraries in OPENCV, you can check this plugin: https://github.com/Vaa3D/vaa3d_tools/tree/master/released_plugins/v3d_plugins/bigneuron_LinGU_LCM_boost/