If I want to get a radial profile on an image, which program should I use?

I want to get a radial profile for a circular signal on an image.
I am currently wondering which of the following two programs I should use.
I have tried both and got different profiles.
Which one is more accurate? I would appreciate your answer.

Answers (2)

Hi Kengo,
Analyzing the comparison between the two Matlab programs for generating radial profiles, accuracy emerges as a critical factor to consider.
Program 1 from Matlab Central Answer likely employs a standard approach by iteratively computing radial profiles through concentric circles around the center of the circular signal. While this method is reliable, its accuracy may vary based on implementation details and image characteristics.
On the other hand, Program 2 from Matlab Central File Exchange boasts speed in radial profile computation, which can be advantageous for large datasets. However, the trade-off with accuracy arises as speed enhancements may involve approximations or optimizations impacting precision.
To assess accuracy effectively, consider factors such as image characteristics (noise, irregularities), algorithm complexity (sophistication vs. computational intensity), and validation against ground truth data. Conducting a comparative analysis using synthetic data or known radial profiles will provide empirical insights into program performance under controlled conditions.
Ultimately, the choice between the two programs hinges on striking a balance between speed and accuracy aligned with your analysis requirements. Validation tests will be instrumental in making an informed decision on the program that best suits your needs.
Let me know if you need further assistance.

1 Comment

Thanks for the reply.
Convert DICOM image (attached JPEG) to CSV format,
Attempting to get a radial profile using the two methods attached.
I have tried both and got different profiles.
Which one is more accurate? I would appreciate your answer.

Sign in to comment.

@Kengo Igarashi I think they should be the same if they, and you, implemented the correct algorithm. Are you sure they all used the same center for the circle, and the same number of elements? If not, that would be an obvious cause for differences. Of course the accuracy will be lower near the center of the circle since there will be fewer sample points to include in the average. However the values are usually more alike there rather than far away from the center. So even though you have more sample points away from the center, the mean out there may have higher standard deviation because the values will be less alike than at the center.
If you want more help, attach your image and two scripts that you used to compute the mean radial profile.

6 Comments

Thanks for the reply.
Convert DICOM image (attached JPEG) to CSV format,
Attempting to get a radial profile using the two methods attached.
I have tried both and got different profiles.
Which one is more accurate? I would appreciate your answer.
Your code 2 does not run for me. I suggest you use code 1. It looks right for an origin/center defined at the center of the image.
I am very sorry.
Code 2,
I defined line 27 and after as "radial_profile" separately,
Would it work if I define "radial_profile" separately after line 27, and then run the code from line 1-26?
I am able to get it to work that way.
I would then like your opinion as to which is more accurate and should be used, Code 1 or Code 2.
I would like to attach the modified Code 2 file, but I keep getting a warning message and cannot attach it, so please excuse my comment.
Sorry for the delay. I am attaching the file.
Please check it.
What about it? It seems to work.
close all;
clear all;
Result=[];
radial_step=1;
slice=1;
wid=170;
xset=170;
yset=170;
x1=xset;
x2=x1+wid-1;
y1=yset;
y2=y1+wid-1;
filename=strcat('slice=1.csv');
grayImage=csvread(filename);
subplot(2, 2, 1);
imshow(grayImage, []);
title('Original Full Image')
ROI=grayImage(y1:y2,x1:x2);
subplot(2, 2, 2);
imshow(ROI, []);
title('ROI Sub-Image')
[Tics,Average]=radial_profile(ROI,radial_step);
Result(:,1)=Tics;
Result(:,2)=Average;
subplot(2, 2, 3:4);
plot(Average, 'b-', 'LineWidth', 2);
yline(0, 'LineWidth', 2, 'Color','k');
grid on;
title('Average Radial Profile')
though the center of the image is not correctly specified, and the cropped ROI is not centered around the spot.
For example, if the columns are 1, 2, 3, and 4, what is the center? It's not 4/2 = 2. That would be on the second pixel. The true mean location would be (1+4)/2 = 2.5, or halfway between column 2 and column 3.
Thank you very much.
I have confirmed that the code you created is working.
I am aware that there is an issue of where to define the center of the image.
Based on that, which is more accurate and should I use, the radial_profile you have created or the method of Code.1 that was attached earlier?

Sign in to comment.

Categories

Find more on Convert Image Type in Help Center and File Exchange

Asked:

on 7 Jul 2024

Commented:

on 15 Jul 2024

Community Treasure Hunt

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

Start Hunting!