How to save multiple processed images in a specific folder?

1 次查看(过去 30 天)
Hi guys
I have a multipage tiff image, each page of the image consists of two parts, the second parts (bottom) was captured with a special time delay after the first part (top).
I've splitted this into two figures, part A and part B.
And I did some processing.
Thus, if I have 50 pages for each tiff stack, I suppose to get 100 figures from each tiff stack.
My problem is:
How can I save these processed figures in each loop and specify their name, type and location?
My loop to get the two processed figures from each page of the original tiff image is:
for z = 1:imsize; % read the specified image from a multipage tiff image
t = imread(fileName,z); % reture image data as an array
% split each page as part A and part B, part B was obtained with a time delay of part A
% detailed codes to split the image are not shown
% processing the image
% detailed codes to process the image are not shown
% display processed two images
figure;
imshow(A1,[]); % processed part A
title(['Processed Image ', num2str(z), ' Part A']);
figure;
imshow(B1,[]); % processed part B
title(['Processed Image ', num2str(z), ' Part B']);
% save figures as tif in the folder, with filenames 'Processed page z Part A' and 'Processed page z Part B', z is current page number
end
I tried to use "saveas" and the "export_fig" function, but they didn't work.
Can anyone give me some suggestions?
Many thanks.

采纳的回答

Travis Montoya
Travis Montoya 2020-3-4
If I am understanding your question correctly, You're just trying to save the the images you're displaying (A1, B1, etc..) to a file? You could Just use imwrite()
imwrite(A1,'PartA.tif')
with each one etc...

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Images 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by