Info
この質問は閉じられています。 編集または回答するには再度開いてください。
How to conncet two images?
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (2 件)
Image Analyst
2015 年 5 月 15 日
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 件のコメント
Image Analyst
2015 年 5 月 15 日
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
2015 年 5 月 15 日
[pathstr, name, ext] = fileparts(ThePickedFile);
corresponding_file = fullfile(pathstr, [name, '_contour' ext])
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!