Convert Point Spread Function translate to MTF

14 Ansichten (letzte 30 Tage)
Zak Ali
Zak Ali am 22 Mär. 2023
Beantwortet: Drishti am 7 Okt. 2024
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

Antworten (1)

Drishti
Drishti am 7 Okt. 2024
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.

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Produkte


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by