How do i convert a .m file to a GUI
Show older comments
I'm having a code that crops a portion of the image and finds the length of the line drawn on the image in terms of pixels. I'm new to MATLAb and a student so can someone help me out ?
Answers (2)
Adam
on 14 Mar 2015
0 votes
You can use Guide to create a GUI and then call your .m file function from a callback of a pushbutton or whatever control you want to use to trigger your code.
4 Comments
NeoSeeker
on 14 Mar 2015
Jan
on 14 Mar 2015
@NeoSeeker: You find many GUI examples in the net and in the documentation of Matlab. It would not be efficient, if someone creates a new example here in the forum. The M-file is called as usual simply be using its name.
NeoSeeker
on 16 Mar 2015
Adam
on 16 Mar 2015
If you create a pushbutton then (assuming you have default GUIDE settings so that it created a .m file with the .fig) you will have a callback function for that
pushbutton1_Callback
if you didn't change the button's tag.
In that function you can call your other function although if you have inputs and outputs then that is more complicated as you need to get the inputs from somewhere.
Outputs can be saved on the handles structure as e.g.
handles.result = someFunction( );
guidata( hObject, handles )
Image Analyst
on 14 Mar 2015
Try this framework. http://www.mathworks.com/matlabcentral/fileexchange/24224-magic-matlab-generic-imaging-component
Description
This GUI will help the novice user get up to speed very quickly on using GUI-based applications. Everything is laid out in a very simple Step 1, Step 2, Step 3, etc. layout. It is a very good starting point for a typical image analysis application. This application uses GUIDE to do the user interface design, and has most of the basic controls such as buttons, listboxes, checkboxes, radio buttons, scrollbars, etc. It allows the user to select a folder of images, select one or more images and display them, to select a series of options, and to individually or batch process one or more images. The user can....................
2 Comments
Image Analyst
on 16 Mar 2015
See my attached spatial calibration demo that lets you draw a line and get the length. Put that code into a callback function of your GUI.
NeoSeeker
on 20 Mar 2015
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!