Hi Josh,
I understand that you are trying to calculate the "Modulation Transfer Function (MTF)" using a "Siemens star" target. The "Siemens star" is a radial pattern used to measure the spatial resolution of imaging systems. The "MTF" is a measure of the imaging system's ability to transfer contrast at a particular resolution from the subject to the image.
Please follow the below mentioned steps to compute the "MTF" using a "Seimens star" target:
- Load image: Read the image into the MATLAB workspace using the "imread" MATLAB function.
- Convert to grayscale: If the image is in color, convert it to grayscale using the "rgb2gray" MATLAB function.
- Find the centre and radii: Locate the centre and the radii of the "Seimens star" using the "imfindcircles" MATLAB function. Please adjust the parameters of the function to get the best results.
- Extract radial information: Extract radial line profiles from the center to the edge of the star at multiple angles. This involves sampling the pixel values along lines that radiate outward from the center of the star. Use the "linspace" MATLAB function to define a set of angles to sample the spokes along the radii of the star target. Use a "for" loop to iterate over the angles and use the "improfile" MATLAB function to extract the pixel values along the radius of the star target. Please specify the length and the center of the profile to get the correct values. Please refer to the example MATLAB code below:
angles = linspace(0, 2*pi, numAngles);
xCoords = centerX + radii * cos(angle);
yCoords = centerY + radii * sin(angle);
radialProfile = improfile(grayImage, xCoords, yCoords);
radialProfiles = [radialProfiles, radialProfile];
- Calculate Spatial Frequency: Apply a "Fourier Transform" using the "fft" MATLAB function to each radial profile to get the frequency domain representation. Calculate the spatial frequency for each radius. The spatial frequency increases from the center of the star to the edges. Please refer to the example MATLAB code below:
for i = 1:size(radialProfiles, 2)
ftProfile = abs(fft(radialProfiles(:, i)));
normalizedFTProfile = ftProfile / max(ftProfile);
mtfValues = [mtfValues, normalizedFTProfile];
averageMTF = mean(mtfValues, 2);
spatialFrequencies = linspace(0, 1, numel(averageMTF));
- Plot "MTF": Plot the "MTF" as a function of spatial frequency as given by the example MATLAB code below:
plot(spatialFrequencies, averageMTF);
xlabel('Spatial Frequency (cycles/mm)');
title('Modulation Transfer Function');
Using the method given above, the MTF graph for a "Seimens star" target can be computed.
Please refer to the below mentioned MATLAB R2023b documentation links for more information on the "imread" function, "rgb2gray" function, "imfindcircles" function, "linspace" function, "improfile" function and "fft" function respectively:
Please refer to the link mentioned below for gaining more insight into the procedure for using “Seimens Star” target to obtain the “MTF”:
I hope this helps to resolve your query.
Regards,
Abhimenyu