Matlab GUI: How to save axes as DICOM file?

1 Ansicht (letzte 30 Tage)
m_user
m_user am 17 Jun. 2013
Hello,
I built a GUI with a handles.axes in which a greyscale image(MRI) is in the background and a colored, semitransparent image(Perfusion) is in the foreground. Now I want to save this overlayed image but I have no variable which "points" to that overlay.
*Does anybody know how it's possible to receive the overlayed image from the handles.axes? *
What I have tried so far: (not working)
[FileName, PathName] = uiputfile('*dcm', 'Save As');
Name = fullfile(PathName,FileName);
f=getframe(handles.axes1);
[x,map]=frame2im(f);
dicomwrite(x,Name,'dcm');
I have also tried copyobj, getimage and gca..
Thanks in advance..
  1 Kommentar
m_user
m_user am 20 Jun. 2013
Bearbeitet: m_user am 20 Jun. 2013
I tried it now with this code, but I also get just a number when i dicomread the saved image again: if true
[FileName, PathName] = uiputfile('*dcm', 'Save As');
Name = fullfile(PathName,FileName);
names={handles.filesPerfusion.name};
PositionText=size(handles.dcmStack(:,:,1));
figure('name','Saving Process'),
colormap gray(256),
h1=imagesc(handles.dcmStack(:,:,1));
hold on;
h2=imagesc(handles.mPerfusion(:,:,:,1));
hold off;
axis off
set(h2, 'AlphaData', handles.maskTransparency);
text(1,PositionText(1)-10, 'NOT FOR DIAGNOSTIC USE')
fname = names{1};
metadata = dicominfo([handles.path2 '\' fname]);
dicomwrite(gcf,Name, metadata)
close(gcf);
end
I also tried now to saveas it as jpg, but I store then an image with a white frame (caused by the figure?) I also already asked the author of export_fig if I could use this function but because of the fact that I overlay to images (and I don't have a variable which cotains all the image info) this function is unfortunately useless... Please help me..

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by