Return a graph and an image from a function
Ältere Kommentare anzeigen
Hi "mathelabers" :p I'm stuck and I hope that someone can help me. So, I'm using matlab to process two images. I did a function to do it and it is working fine, since I´m using the "figure" to show both image and graph as shown below.
if true
figure;
hold on;
plot(dicomImage(centerRow, :), 'r');
plot(tiffImageAligned(centerRow, :), 'b');
plot(difference, 'Color', 'cyan', 'LineWidth', 1);
xlim([1 dcmColumns]);
ylim([-10 101]);
line([1 dcmColumns], [0 0], 'Color', 'black', 'LineStyle', '--');
%line([centerColumn centerColumn], [0 100], 'Color', 'black', 'LineStyle', '--');
legend('DICOM', 'TIFF', 'Difference');
hold off;
figure,
imshowpair (dicomImage,tiffImageAligned,'Scaling','joint');
end
The big problem is that I want to show the same images but using a GUI in different axes. I was thinking declare the variable as global and then create a function that returns the graph, but It's not working. If I chose the axes before calling my function and only return the "imshowpair" it's perfect, but I don't know how to return the graphic.
Can someone help me?
Thank youuuu
3 Kommentare
Walter Roberson
am 17 Jun. 2018
What is the required output? The handles of two different image() objects? Copies of the plots rendered into pixels?
If you have a function and you need parts of the output to be placed into different axes, then why not just pass the handles of the axes into the function and have the function draw directly into the appropriate axes?
Jose Silva
am 17 Jun. 2018
Jose Silva
am 17 Jun. 2018
Antworten (0)
Kategorien
Mehr zu Graphics Performance finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

