Read x,y coordinates from txt file and orient images

2 ビュー (過去 30 日間)
Stelios Fanourakis
Stelios Fanourakis 2018 年 5 月 2 日
回答済み: Stelios Fanourakis 2018 年 5 月 2 日
Hi I have a txt file with rowsxcolumns of x,y values. It's 15x2, for 15 images. I want to read from that txt file the x,y positions that my images will have. Already, I tried this.
filePatternu = fullfile(destinationFolder, '*.dcm');
allFiles = dir(filePatternu);
for k= 2: 1: length(allFiles)
baseFileName = allFiles(k).name; % e.g. "1.png"
fullFileName = fullfile(destinationFolder, baseFileName);
I = dicomread(fullFileName); % img respresents input image.
pause(2)
[x, y] = textread('imgpositions.txt', '%f , %f');
figure
imshow(I, [x y])
drawnow;
end
Although, I get no error, still I get no outcome. imshow is not working and no image is being seen.
  2 件のコメント
Ameer Hamza
Ameer Hamza 2018 年 5 月 2 日
imshow(I, [x y]) will only specify the display range of image I (i.e. calculation of pixel intensity). Are you trying to draw the points on the image?
Stelios Fanourakis
Stelios Fanourakis 2018 年 5 月 2 日
No. Txt file contains x,y values that the images will have. I need to link the txt with the images, and if I change a value to the txt then the images will have other position

サインインしてコメントする。

回答 (1 件)

Stelios Fanourakis
Stelios Fanourakis 2018 年 5 月 2 日
Anyone answer please?

カテゴリ

Help Center および File ExchangeDICOM Format についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by