Convert Point Spread Function translate to MTF

21 views (last 30 days)
Zak Ali
Zak Ali on 22 Mar 2023
Answered: Drishti on 7 Oct 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

Answers (1)

Drishti
Drishti on 7 Oct 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.

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!