How to make GUI window repeat a block of code until closed without blocking other operation
Show older comments
Hello. In essence, I'm trying to make a GUI that mimics the functionality of preview with a couple tweaks. Why can't I just use preview you ask?
1) The device I'm previewing (gigecam object) sends data as int16, but Matlab reads them as uint16 by default and I don't know how to change this. For calculation purposes this is easily fixed with a typecast, but as the majority of my frame is 0 +/- 40, the negative numbers get read as very large positive numbers in preview.
2) Preview chops the data down to uint8 (for speed?). I'd prefer to keep the full dynamic range of my frames.
3) I'd like to apply a colormap other than gray.
I've made a starter GUI to tinker with, and I am able to put the code I need into the OpeningFcn function to capture and display a frame as soon as the GUI is created. I tried to put that code inside an infinite while loop, but I think since it never got to exit OpeningFcn it never displayed anything and I had to close Matlab to break the loop. Clearly that was not the right way to do it.
I've tried Googling around, and haven't seen anything obvious. Is there a way I can safely have my GUI window execute a given block of code infinitely as long as it's open but still leave me the option to close the GUI (either with the 'x' button or programmatically)?
Thanks in advance!
[EDIT]: Typo in title fixed.
Accepted Answer
More Answers (0)
Categories
Find more on GigE Vision Hardware 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!