3.42857

3.4 | 8 ratings Rate this file 59 Downloads (last 30 days) File Size: 394 KB File ID: #28631
image thumbnail

Slant Edge Script

by

 

This code can be used to measure the pre-sampled MTF of an image.

| Watch this File

File Information
Description

This code can be used to measure the pre-sampled MTF of an image, which is a quantity that describes the resolution of linear imaging systems. The code is based on measuring the pre-sample MTF using a precision machined edge that is aligned - with respect to the columns or rows of an image - at an angle between 1-5 degrees.
 
To learn more about the pre-sampled MTF consult the references at the end of this script.

When you run this script your image containing the edge with appear with the cropping tool. Crop your image to the region containing only the edge. Double-click your cropped area for the script to continue.

A Gaussian fitting tool has been used in this code. You can download this tool on the Matlab central website here: http://www.mathworks.com/matlabcentral/fileexchange/11733-gaussian-curve-fit

comments, and suggestions, including areas of improvement may be welcomed.

Acknowledgements

Gaussian Curve Fit inspired this file.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.7 (R2008b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (16)
15 Dec 2014 Eamon Loughman

What type of smoothing would marcelo or rachel reccomend?

Having done some tinkering with wiener and Gaussian filtering of the image files, I still seem to hit errors?

Very well written in all other respects!

04 Dec 2014 Patrick Granton

* Feel free to tinker everyone... perhaps I'll revisit this script and re-write to more common code practices.

04 Dec 2014 Marcelo Soto Thompson

Agree with Rachel.This script is not very robust to noise.

I have also found it to crash if the edge is very blurry ie extends over many (50 or so) pixels.

Also, it's always unfortunate and poor practice to name variables the same as built-in functions (e.g "image").

Having said that, with a little tinkering this script is quite nice and will get the job done.

03 Dec 2014 Rachel

I've been creating my own MTF script, and I wanted to compare my results to yours. However, because my slanted edge must include noise for what I'm testing, I am unable to use your program. The issue happens at line 218, because to find the edge you use interp1, and the variable "strip_cropped" is not monotonic increasing due to the noise in my image. Perhaps you could use a different smoothing method, or use thresholding before finding the subpixel edge. Otherwise, everything else looks like it would work great!

25 Oct 2014 Karbala'a Unvi. Science

hi there i need the slant wave let for the image and what is the result needed urgently

29 Jul 2014 Adam

Hi Patrick,

I have .mat file which containes 200x200 pixels of 50 um size. But the MTFscript does not work!!

01 Apr 2014 Kelly

Hi Patrick,

I am receiving an error at line 230 about that the index are not integers or logical.
Could you please tell me that what is the problem behind.

13 Mar 2014 Nad

Hi Patrick,

thanks a lot. The code worked for me without bug with the exemplary dicom image.

13 Mar 2014 Nad  
24 Jul 2013 Muhammad Ghani

Hi Patrick, I am receiving an error at line 232 about that the index are not integers or logical.
Could you please tell me that what is the problem behind. I am in desperate help need

06 Feb 2013 Shimon Zerbib

impossible to download the file ...

15 Jan 2013 Cristina

I am very new to matlab so my question might be silly, but every time I double click on the cropped area, I get the following error:

Error using interp1 (line 257)
The values of X should be distinct.

Error in SlantEdgeScript (line 218)
edge_position_temp = interp1(strip_cropped,temp_y,threshold,'pchip');

I am stuck at this error and can't proceed. Any advice would be greatly appreciated.

04 Dec 2012 Pierre

i didn't have any problem with the cropping.
I had to modify the way to estimate the variable level.
and I had to modify many things after because the program worked only when the image is not noisy at all.
(I had to modify the way to find the edge position).

25 Nov 2012 Patrick Granton

Pierre, I fixed some issues with the cropping of the image and have made it a GUI for more easy of use. Perhaps this might help you.

22 Nov 2012 Pierre

doesn't work at all.

lot of error to debug in it.

12 Apr 2012 XIN JIN

Excellent code! It helps a lot. Appreciate for this.

Contact us