MTF for Laplacian of a gaussian

am trying to plot a modulation transfer function of a gaussian from -40 to 40 mm in conjunction with a laplacian of gaussian filter, width = 4 mm and sigma = 1. i have a trouble scaling the MTF for the gaussian and i wasnt sure about how to get the ft for the laplacian of a gaussian. am using abs(fft). does anyone have an experience with MTF for filters?

1 commentaire

Star Strider
Star Strider le 23 Fév 2014
Modifié(e) : Star Strider le 23 Fév 2014
Please post your code, or attach the file to your original question if your code is too long to post. It will help us understand your problem.
This is out of my area of expertise (I’ll search online to see what I come up with), but there are others here who are probably more familiar with it.

Connectez-vous pour commenter.

Réponses (2)

Star Strider
Star Strider le 23 Fév 2014

0 votes

The Image Processing Toolbox has functions that can take you from the point spread function to the optical transfer function and back again. See psf2otf for details.

6 commentaires

Thank you for your reply. what am doing is creating the PSF by using the following
xGaus = [-40:1:40];
xGaus = xGaus';
mu = mean(xGaus);
sigma = 12.42;
g = zeros(size(xGaus),1);
for i = 1:size(xGaus);
x = xGaus(i,1);
Gauss = (1/sigma*(sqrt(2*pi)))*exp(-0.5*(((x-mu)/sigma)^2));
g(i,1) = Gauss;
end
%%to normalize the distributon,
gn = g ./ (sum(g));
and then am using fspecial('log', 4, 1) to create my laplacian of a guassian filter.
to plot the MTF for my PSF i used
PSF = fft(gn);
plot(abs(PSF))
what i want to do is plot the MTF of the laplacian of a guassian filter on the same plot in order to assess the affect of the filter on my PSF in regards to spatial frequency.
Thanks
Hannah
I’m having some difficulty understanding what you’re doing.
First, your code has an error (that you’ve probably discovered by now). Your preallocation of g should be:
g = zeros(size(xGaus));
Second, your gn and PSF variables are vectors. Unless I’m completely failing to understand what you’re doing, a vector is probably not the result you intend.
The description and examples in the psf2otf documentation may be what you actually want to do. Run the code in the example on the psf2otf page to see if it is. (I’ve copy-pasted it here, along with a slightly modified version to plot the Laplacian-of-Gaussian.) You will have to make the appropriate changes to get the size matrix you want.
hlog = fspecial('log', 4, 1);
Hlog = psf2otf(hlog,[31 31]);
% Copied From ‘psf2otf’ Documentation Example
PSF = fspecial('gaussian',13,1);
OTF = psf2otf(PSF,[31 31]); % PSF --> OTF
figure(1)
subplot(1,2,1); surf(PSF); title('PSF');
axis square; axis tight
subplot(1,2,2); surf(abs(OTF)); title('Corresponding |OTF|');
axis square; axis tight
% Same Code Displaying Laplacian-of-Gaussian
figure(2)
subplot(1,2,1); surf(hlog); title('PSF');
axis square; axis tight
subplot(1,2,2); surf(abs(Hlog)); title('Corresponding |OTF|');
axis square; axis tight
I admit to being curious as to how this relates to the thermodynamics question you posted earlier.
Hannah
Hannah le 25 Fév 2014
Thank you again for the help but i think my problem is i need the PSF to be a vector and also the otf of the laplacian. what am trying to do is to plot the MTF for an imaging system where the x-axis is the spatial frequency and the y-axis is the modulation transfer function which is in this case abs(otf). i managed to represent the PSF of the system using a vector but the laplacian of the gaussian is a matrix and am not sure if i could get a vector to represent the otf of it.
Star Strider
Star Strider le 25 Fév 2014
I don’t understand what you’re doing. I specifically don’t understand the reason you’re dealing with vectors rather than matrices in a 2-D imaging application.
The x- and y-axes of your OTF are the spatial frequencies, and the z-axis is the magnitude of the transfer function. You might want to take the diagonal of the relevant matrices to create your vectors, but that’s the best I can suggest.
Plot your OTF and MTF using the abs() function, but keep it in the complex domain for your actual transfer function calculations with your Fourier-transformed input.
I’ll do some more research on the Internet to see what I can find. If you have links to pages describing what you’re doing, please post them here (preferably in your next comment so I can find them easily).
Hannah
Hannah le 27 Fév 2014
I was thinking about taking the diagonal of the laplacian of the gaussian to create a vector but i wasn't sure if that would be accurate. since the PSF is circularly symmetric we usually take the profile to represent the PSF. i have some websites about MTF but i couldn't find one that deals with MTF for kernels.
Thanks Hannah
Star Strider
Star Strider le 27 Fév 2014
Modifié(e) : Star Strider le 1 Mar 2014
I don’t exactly understand what you mean by ‘profile’. I’m hung up on how you project your 3D OTF or MTF to a 2D representation. One paper I found mentions: ‘The spatial-noise amplitude spectrum of the system was independently measured by taking the FFT of the array data (averaged over the rows) when flux was incident on the array at the same average value as for the target image.’ ( ‘Random transparency targets for modulation transfer function measurement in the visible and infrared regions’ ) So it would seem to me that the convention is to take the 3D OTF or MTF, average it over the rows. In MATLAB this would be:
MTF_mean = mean(MTF,2);
if MTF is your 3D representation. You have the result you want.
Is this correct?

Connectez-vous pour commenter.

Hannah
Hannah le 27 Fév 2014

0 votes

I was thinking about taking the diagonal of the laplacian of the gaussian to create a vector but i wasn't sure if that would be accurate. since the PSF is circularly symmetric we usually take the profile to represent the PSF. i have some websites about MTF but i couldn't find one that deals with MTF for kernels.
Thanks Hannah

Question posée :

le 23 Fév 2014

Community Treasure Hunt

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

Start Hunting!

Translated by