conversion of data into bitmap
20 views (last 30 days)
Show older comments
Hello,
I am actually working on Matlab R2015a. I would like to know if it is possible to plot an image from data? I explain:
I have for example a matrix composed by 4000 signals of 128 samples (so a matrix 4000x128) and the data is on 12 bit (from -2048 to +2047). By using the imagesc function (to have a gray image), I have an "image" view of my data. But I plot this on a GUI and added a slide barre to select the signal in order to plot on another figure (for example the barre is on the 1287th signal so the second plot corresponds to this last). When I slide the barre, using Matlab functions, I success to actualize the second figure (the one who plot only one signal). But the deplacement of the barre is slow, I think because of the size of my data. So I thought that convert my data into a bitmap image could be ameliore the speed of my GUI.
I precise I haven't the image processing toolbox. Maybe I am wrong and it is slow just because of the imagesc function?
I thank you in advance for your help. Best regards
0 Comments
Accepted Answer
Image Analyst
on 15 Jul 2015
I'm not seeing the scroll bars. How do you move the red line to a new place? Do you click on the image to put it in a different place, or do you move a scroll bar/slider? When you move the red line, you have to delete the handle of the prior line, and then draw the new line with the line function:
yLimits = ylim();
try
delete(hLine); % Delete prior line if it exists.
catch
% No prior line. Nothing in catch so just ignore error.
end
hLine = line([x, x], yLimits, 'Color', 'r');
I don't think imagesc is the problem but you can try imshow() instead. It's now in base MATLAB, not just the Image Processing Toolbox.
Your data, 4000x128 is not large at all - just a small fraction of the size of a typical run-of-the-mill digital image. So the size of your data should not be a problem.
5 Comments
Image Analyst
on 16 Jul 2015
Yes, in some apps I use a scrollbar to move the line around. In another app, if the user clicks on a point in the image, I (re)draw a box, using either rectangle() or plot() or line() (I don't remember), with the upper left corner of the box at the place where the user clicked. Both are very fast.
More Answers (2)
Walter Roberson
on 11 Jul 2015
Changing your data into a bitmap is not likely to help in this situation.
You will need to show us your code for using a slider to select the signal to plot.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!