Error using listbox multiselection for image SNR manipulation
1 view (last 30 days)
Show older comments
I am trying to use a listbox multiselection to add images together and median combine for SNR improvement comparison reasons. I first allow the multiselection from the list box using:
%Get selected files from listbox selection
set(handles.listbox1, 'Max',2,'Min',0) %allow multi selection
list=handles.listbox1;
temp = get(list, 'String');
selected = temp(get(list, 'Value'));
set(list, 'Value', []); %Clear current selection for next time
I then use the following to perform the sum and median combine:
l=length(selected)
path=getappdata(0,'Folder'); %Get the folder
imSum=[]; %initialise
imStack=[];
for i=1:l
file=fullfile(path,selected{i})
im=double(imread(file));
imSum=imSum+im;
imStack=cat(3,imMed,im)
end
imMed=median(ImgStack,3);
However, I get an error:
Error using +
Matrix dimensions must agree.
Error in MultiImageanalysis>pushbuttonAddImages_Callback (line 1372)
imSum=imSum+im;
0 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!