0

I have many medical images with dcm file format. There are circles in the photos (6 circles but the sixth is too small to see). I want to calculate the radius of these circles very precisely. At least the radius of the first three or two circles I need. I use Hough transform for this. The results are not good for my purpose yet. How could I find these circles and their radius more precisely? The Images and my code are below.

clear, 
close all,
imtool close all,
clc,
% I - raw image data
I = dicomread('193500.dcm');
% scale with [scale] = 1mm/Pixel
k = 253/1024;
% Wiener filter for noise reduction
I = wiener2(I,[6,6]);
% Optimizing the contrast
I = imadjust(I,[0.388 0.398]);
imshow(I)
% Check for circles
[centers, radii] = imfindcircles(I,[6 40],'ObjectPolarity','dark');
% representation of the circles
viscircles(centers, radii,'Color','b');
%
radii = sortrows(radii,'descend');
radii = k*radii;
radii(2:4)

enter image description here

enter image description here

shm
  • 439
  • 2
  • 11
  • 25
  • You are being vague. "not precise enough" is undefined, unless you define what is precise enough. What you show looks good for an untrained eye, you will need to precisely define what is OK and what is not – Ander Biguri May 24 '22 at 14:19
  • @AnderBiguri Thanks for your response. These circles are actually on a metal plate. They were drilled very precisely. For example, the largest circle has a radius of 7.5 mm, but the program gives me something like 7.7 or 7.3 for many images. That's not accurate for my project. – shm May 24 '22 at 14:31
  • @AnderBiguri and the images were taken with an accurate, stable medical device. – shm May 24 '22 at 14:31
  • And for the rest, I assume you want us to guess what the drill sizes are, and guess what is accurate enough for you? Or will you share that extremely relevant information? – Ander Biguri May 24 '22 at 14:32
  • @AnderBiguri I just wanted to try to explain what "accurate" means to me with this information. I said the circle is actually 7.5mm, but my code gives me 7.3 or 7.7. And that's inaccurate to me. I would like to optimize the accuracy, e.g. up to 7.4 or 7.6 – shm May 24 '22 at 14:37
  • You are being inaccurate in your explanation. Accuracy like this can only come from some mathematical equation/threshold. an equation with e.g. is not an equation. I am sorry, but in medical imaging, this is extremely important: being accurate with what you mean with "accurate" – Ander Biguri May 24 '22 at 14:44
  • @AnderBiguri Sorry, I'm just a beginner and student. I try it again, I mean: The Standard deviation is too big. I don't know, how to explain it mathematically. – shm May 24 '22 at 14:57
  • No worries. But then, you need to go, figure out how to describe it mathematically, and then come back. Otherwise, we ma spend 5h trying to get you a solution, and then you will say "its not enough", but we will never know what is. You need this for you too. – Ander Biguri May 24 '22 at 15:14
  • Hough transform is an acceptable start. it's useful to _find_ circles *roughly* but if you want them located precisely, you'd have to add a few steps. -- simply threshold this picture and find connected components or contours. if using contours, you can fit an ellipse. if using CCs, you could assume circular shape (maybe check that...) and figure radius from area. -- you ought to *also* provide *input data*, nothing with any scribbles on it at all, and nothing *downscaled* either! -- what's the second picture? you don't explain that at all. is it even relevant? – Christoph Rackwitz May 24 '22 at 18:27

0 Answers0