save histogramms as a viewable image in a specific folder
1 次查看(过去 30 天)
显示 更早的评论
I have created a GUI for medical image processing which produces some histogramms that informs the doctor about the progress of the patient. Firstly, I would like to know if there is a way that i can save these histogramms in a certain folder, in a way that can be viewable by the doctor in the folder /as images (like photos perhaps ).I have put in my code each histogramm in a handles. and I save them using imwrite into the folder i want , but it doesnt work i can not see the histogramms! Secondly, can any chosen histograms/images saved in the folder be combined /plotted in the same figure afterwards?Can i use uigetfile and have the doctor choose which histogramms wants to plot in the same figure in order to see the progress of the patient? thanks in advance
2 个评论
Dmitry
2012-7-11
What data you put in imwrite function? It should be an array but not handle. You can also use imsave to get standard dialog box for saving images with default settings.
To manage image files I used uigetfile and imread, then put file names in listbox and store image data in some structure. On listbox selection change - retrieve image data and use it (in imshow for example).
I found it takes to much memory (it was images > 50 MB) so I replaced lisbox by uitree (see http://undocumentedmatlab.com/). Each node in tree has it's UserData property where I store image path (which I have got by uigetfile). On selection change I get file path and read image by imread.
Also uitree can be configured to show folders tree if you do not want to add image files manually and see it directly in folder.
回答(2 个)
Jeff E
2012-7-11
If you have plotted your histograms and have their handles, then you can use the built-in function SAVEAS to save them in various image formats. For example:
h = plot(tplot);
ylim([0 1]);
title(num2str(if_sort(currow+1, 1)));
savename = 'Histo_plot.jpg';
saveas(h, savename, 'jpg');
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!