I am analyzing some experimental data in the form of .tiff multi frames. Withins these tiff files i need to visualize and compare some specific sequences of frames. I want to generate a figure that contains the frames i have chosen from the files i have chosen. The file list and frames indexes list are generated with a user interface, which calls a plot function when parameters are filled.
The problem : What is the best solution so as to plot, with an optimal size BUT keeping square images (like the original), the chosen frames ? Simpler, how to choose the position and size of each frame i plot in the figure ?
I have tried with sub plot : it works but I can’t manage to control the images size.
pos=0;
for j = 1:length(file_list)
for i = 1:length(index_list)
pos=pos+1;
subplot(size(file_list,1),length(index_list),pos)
a =imagesc(imread(file_list{j,:},index_list(i)));
I have also tried
for j = 1:length(file_list)
for i = 1:length(index_list)
a =imagesc(imread(file_list{j,:},index_list(i)));
set(gca,'Units','Pixels', 'Position', [10+100*i 10+100*j 100 100]);
But it seems like i can’t set this individually without overwriting the last modification.
Finally, i have considered using “montage”, but the way I save the images in a list doesn’t seem to be ok.
frm_list=zeros(1,length(FL)*length(index_list));
for j = 1:length(FL)
for i = 1:length(index_list)
a =(imread(FL{j,:},index_list(i)));
frm_list=[frm_list a];
end
end
montage(frm_list,'Size', [length(FL) length(index_list)]);
Thanks
JC
You can use
axis imageto keep the same aspect ratio of the original image.subplot('Position', [left bottom width height])allows you to specify the relative position of the image to the figure window.If you want to use a command other than
imagesc, you can scale the data range of the image before drawing , then usecolormapto apply false coloring to the image.