Info
This question is closed. Reopen it to edit or answer.
How to conncet two images?
2 views (last 30 days)
Show older comments
Hi!
I would like to know is there a way to connect two images. So when user picks the image (e.g mar-001-100) from one directory I would like to work with image from another directory (e.g mar-001-100-contour). So I want to connect these two images. In that way I can work with second image and display to user first image.
0 Comments
Answers (2)
Image Analyst
on 15 May 2015
Yes. I don't know how your user picked the image, but if it was from a listbox (hopefully because that's the most convenient for your user), you know the folder1 and base filename. If you made the user use uigetfile() then you can get the base filename and folder1 from there. So you can either get the base filename from the 'Value' and 'String' property of the listbox, or from the return argument of uigetfile. Now, you must know the folder name of the second folder you want to use, so you simply use that one when you construct the full filename with fullfile():
fullFileName2 = fullfile(folder2, baseFileName);
Then use that however you need to.
2 Comments
Image Analyst
on 15 May 2015
I'm not sure I understand why what I said won't work. Just use fullfile() with whatever folder you want to construct new filenames.
Walter Roberson
on 15 May 2015
[pathstr, name, ext] = fileparts(ThePickedFile);
corresponding_file = fullfile(pathstr, [name, '_contour' ext])
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!