ThreePointCircularROI


#1

Good Morning/Evening

i need to measure the radius of curvature in 2d images, after some research i found this plugin
so i tried using ThreePointCircularROI plugin on fiji, but it says it’s too old to compile
i tried with an older version of imagej and it did compile but when the plugin prompts me to select 3 points nothing happens

any help please or alternatively is there an other way to measure the radius of curvature

thank you in advance
mohamed.


#2

@Salem_med_medhat

So… I’ve never used that plugin myself. I know that @oburri developed some beanshell code that calculates the curvature radius of ROIs. Have a look at his code here. Perhaps this will work for you?

eta :slight_smile:


#3

When calculating 3-point curvature in the past (for measuring the curvature of fungal hyphae!), I’ve found these two wiki pages eminently helpful:



#4

Dug out and tidied up my old IJ1 code for calculating Menger Curvature. The following will give you the radius of the circumcircle, coordinates of the circumcentre and curvature of the three points.

Hope that helps!


#5

Thank you for the replies,
I will keep you updated


#6

@dnmason thanks your code is pretty much what i need
two things if i may ask

  • is it possible to make it loop as i have several .tif?
  • is there something to remove overlay when the code loops (something like overlay.removeSelection or something)

thank you very much


#7

Hi, sorry for the slow reply.

There are templates in the script editor for processing a folder of images, you should be able to take parts of the code in the repo and add them into that. As the script currently relies on the user marking points, I’m not sure that batch processing like this is an ideal solution.

There are lots of commands available to manipulate overlays (see https://imagej.net/ij/developer/macro/functions.html#Overlay) but the overlay is purely visual, so you can also just prevent the overlay from being drawn in the first place by deleting all of this:

//-- Create an overlay

//-- Triangle
makePolygon(x[0],y[0],x[1],y[1],x[2],y[2]);
Overlay.addSelection("cyan");

//-- Circumcentre
makeLine(cenX-5,cenY,cenX+5,cenY);
Overlay.addSelection("magenta");
makeLine(cenX,cenY-5,cenX,cenY+5);
Overlay.addSelection("magenta");

//-- Circumcircle
run("Specify...", "width="+(r*2)+" height="+(r*2)+" x="+cenX+" y="+cenY+" oval centered");
Overlay.addSelection("red");

run("Select None");