How to calculate multiple diameter calculation across an image?
Show older comments
I have an image that I convert from a .mat file (size of .mat file is 406x512x380 double) below.
I need to calculate the diameter and it's change across the length of the image measured by the x-axis value (at each section -4, -2, 0, 2, 4 mm) what is the diameter? Here is my current code right now using imdistline() but clearly that is not the most effective when setting multiple locations.
%% pick frame of choice and run grid overlay %%
img = 40;
image = figure('Color', 'k');imagesc(X_1,Z_1,10*log10(R1_contrast(:,:,img)),[115 145]); colormap(gray); % setting colormap to gray
ax = gca;
%axis equal;
h=xlabel('Lateral (mm)'); %or h=get(gca,'xlabel')
set(h, 'FontSize', 16);
set(h,'FontWeight','bold'); %bold font
z=ylabel('Depth (mm)');
set(z, 'FontSize', 16);
set(z, 'FontWeight', 'bold');
box(ax,'off');
set(gca, 'XColor', 'white'); % set x-axis color to white
set(gca, 'YColor', 'white');
set(gca, 'FontWeight', 'bold');
grid on;
axis image;
set(gca, 'GridColor','r', 'GridAlpha',1);
set(gca, 'Layer','top');
imdistline();
4 Comments
Image Analyst
on 2 May 2020
Edited: Image Analyst
on 2 May 2020
Diameter of what? I don't see any distinct circles on your image. And attach your original image, not a screenshot. Like R1_contrast or whatever we'd need to run your code.
Shelby Hedges
on 2 May 2020
Edited: Shelby Hedges
on 2 May 2020
Image Analyst
on 2 May 2020
That does me no good. Can't you attach the image you displayed with imshow()? Without all the red lines, axes, etc.
Shelby Hedges
on 2 May 2020
Answers (0)
Categories
Find more on Convert Image Type in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!