Extract image from multi-image figure window?

7 visualizaciones (últimos 30 días)
Kamil Stachurski
Kamil Stachurski el 29 de Jun. de 2023
Comentada: Mario Malic el 30 de Jun. de 2023
Hello,
I have little question. I have nine images of the brain on one figure window. How to extract single image to new figure window from multi-image figure window?
Best regards,
Kamil
  1 comentario
Image Analyst
Image Analyst el 29 de Jun. de 2023
If you have any more questions, then attach your image and code to read it in with the paperclip icon after you read this:
Are they in different subplot axes on one figure, or are all 9 images just stitched together in a single image and shown in a single image? We don't know because you forgot to show us.

Iniciar sesión para comentar.

Respuestas (1)

Mario Malic
Mario Malic el 29 de Jun. de 2023
Hey,
fig = gcf; % Current figure
ax = findall(fig, 'type', 'axes');
for i = 1 : numel(ax)
figH = gobjects(1, numel(ax));
figH(i) = figure();
ax(i).Parent = figH(i);
ax(i).Position = [0.1300 0.1100 0.7750 0.8150];
% exportgraphics(ax(i), sprintf("Picture %d.jpg", i));
end
  3 comentarios
DGM
DGM el 29 de Jun. de 2023
Editada: DGM el 29 de Jun. de 2023
Where are the image(s)?
Are they in a figure window on screen? If so, how did they get there? If you have the code that created the figure window, then use the images that you put into the figure instead of trying to extract them from the figure. If the image itself is composed of multiple frames, then maybe it needs to be split in some manner.
If the only thing you have is the figure from a .fig file, then finding the images depends on how exactly they're being displayed in the figure.
If the only thing you have is a screenshot of a figure window, then use imcrop() and know that all you're getting is a degraded facsimile of whatever the original image used to be.
Depending on what you have (code that creates a figure, a fig file, or a raster image file) include that. The PDF doesn't really indicate what you have, and it also can't be used in any demonstration of a solution.
Mario Malic
Mario Malic el 30 de Jun. de 2023
You should update your question or post a new one with clear details and an example of picture you want to extract.

Iniciar sesión para comentar.

Categorías

Más información sobre Read, Write, and Modify Image en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by