Convert Point Spread Function translate to MTF

조회 수: 16 (최근 30일)
Zak Ali
Zak Ali 2023년 3월 22일
답변: Drishti 2024년 10월 7일
Hi
I have a guassian point spread function and i would like to find the equivalent MTF in frequency domain.
I have the following code with assistance from : https://www.mathworks.com/matlabcentral/answers/274848-point-spread-function-translate-to-mtf
x=[1,2,3,4,5,6,7,8,9,10,11,12,13]
y=[0,1,3,21,46,156,222,140,111,25,14,3,2]
LSF=[x,y];
OTF = fftshift(fft(LSF)); % OTF
MTF = abs(OTF); % absolute value of OTF
MTF = MTF./max(MTF); % normalize
% correct sampling frequency for conversion on frequency bins to frequency
Size = length(MTF);
spacing = 1.12e-6;% pixel size
fsx = abs(1/spacing); % turn into sampling frequency
a = linspace(-Size/2,Size/2,Size); % form scale for conversion based on frequency bins
conversionx = fsx./Size; % conversion factor for frequency bin units to frequency (unit^-1)
Psi = a.*conversionx; % frequency (unit^-1)
figure
plot(Psi,MTF)
xlim([0,Psi(end)])
xlabel('cycles/unit')
ylabel('MTF')
could someone please help me convert the X axis from cycles/unit to lp/mm , i am not sure how this conversion is peformed

답변 (1개)

Drishti
Drishti 2024년 10월 7일
Hi Zak,
To convert the x-axis from cycles/unit to lp/mm (line pairs/millimetre), you need to first convert the spacing from metres to millimetres.
By multiplying the spatial frequency (Psi) by ‘spacing_mm’, you will obtain the x-axis values in lp/mm.
Refer to the code snippet provided below for better understanding:
% convert spacing from meters to millimeters
spacing_mm = spacing * 1e3;
% convert to lp/mm
Psi_lpmm = Psi * spacing_mm;
I hope this resolves the query.

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by