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
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.
Paraskevas Papanikolaou
Dimitry thanks for the ideas i have found a solution in my problem ...by saving tha handles of my code in a structure and then saving the structure inside a specific folder ,by just using the command save.Furthermore ,to plot the selected by the user histograms i used a panel of radio buttons where the user selects what histogramms wants to see and depending on his selection the programm recalls the saved histograms by the specific structure each time .
I ll check your suggestion on using the uitree and i ll comment again later !!
Thank you very much for your time !!!

请先登录,再进行评论。

回答(2 个)

Jeff E
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');
  1 个评论
Paraskevas Papanikolaou
thank you very much JeffEA 31 ,i ve used something similar if you see my comment above ....saving the handles into a structure .
thanks again

请先登录,再进行评论。


Image Analyst
Image Analyst 2012-5-11

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by