How to save multiple processed images in a specific folder?

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.

 Accepted Answer

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...

More Answers (0)

Categories

Find more on Images in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!