i know the scale but when i use imagesc function the image doesnt show me the right size of my spot. what am i doing wrong?

3 ビュー (過去 30 日間)
clear all;
close all;
Scale = 29.4/64; % Pixelscale of the image
[FileName, PathName] = uigetfile({'*.txt','PHASICS Txt File';'*.*', 'All Files (*.*)'},'Pick a file');
PhaseFile = fullfile(PathName,FileName);
PhaseData=importdata(PhaseFile,'\t'); % Read header less tab delimited txt file[Ny, Nx] = size(PhaseData);
[Nx, Ny] = size(PhaseData);
figure
imagesc(PhaseData); % Plot the data

採用された回答

Image Analyst
Image Analyst 2022 年 1 月 10 日
PhaseData is structure. you need the Data field
theImage = PhaseData.Data;
  19 件のコメント
Sobia Rehman
Sobia Rehman 2022 年 2 月 16 日
Finally I have got this using this code
clear all;
close all;
%nBulk = 1.4536;
Scale = 29.4/64; % Pixelscale of the image
[FileName, PathName] = uigetfile({'*.txt','PHASICS Txt File';'*.*', 'All Files (*.*)'},'Pick a file');
PhaseFile = fullfile(PathName,FileName);
PhaseData=importdata(PhaseFile,'\t'); % Read header less tab delimited txt file[Ny, Nx] = size(PhaseData);
[Nx, Ny] = size(PhaseData);
XData = [0, Nx] * Scale;
YData = [0, Ny] * Scale;
imagesc(XData, YData, PhaseData);
This shows me the picture now in real life units.
Thanks heaps for your help.
Image Analyst
Image Analyst 2022 年 2 月 16 日
You must have floating point image outside the range of 0-1. So try it this way:
XData = [0, Nx] * Scale;
YData = [0, Ny] * Scale;
imshow(PhaseData, [], 'XData', XData, 'YData', YData);
axis('on', 'image')

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by