Fit cirle - how to get centre and radius?


#1

Hello, I am trying to describe the x and y coordinates and radius of a circle in which my polygon, a circle with flat part, is inscribed.Using do wand function I had the selection of my shape and then I opened a for loop to investigate sets of three points not aligned. Then I have used Fit Circle function and then Measure function for x and y centre and the area to calculate the radius. As I need to investigate several sets of three points and make the same process for 2000 images and with this method the code it’s really slow, is there a way to have the centre and the radius after using fit circle function without showing results table and using so measure function?

    for(z=1;z<=s;z++){					
				setSlice(z);{	
				doWand((w/2), (h/2));//auto selection
				run("Interpolate", "interval=1"); 
                getSelectionCoordinates(x, y); //having coordinates of the selection
                an180=floor(x.length/2);//find second point
				an90=floor(an180/2);//find third  point
				parray=newArray(an90+1);
				rarray=newArray(an90+1);
				xcarray=newArray(an90+1);
				ycarray=newArray(an90+1);
     				 for (i=0;i<=an90;i++){
     				 	run ("Select None");
						 makePoint(x[0+i], y[0+i]);// set three point - One and only circle passes through any three points
						 setKeyDown("shift");
						 makePoint(x[an90+i], y[an90+i]);
						 setKeyDown("shift");
						 makePoint(x[an180+i], y[an180+i]);						
						 run("Fit Circle");
						 run("Set Measurements...", "area centroid redirect=None decimal=4");
						 run("Measure");						 
						    parray[i]=getResult("Area", i);// area array
						    xcarray[i]=round(getResult("X", i));//xc array for all the cirlces
						    ycarray[i]=round(getResult("Y", i));//yc arrayfor all the cirlces
						    rarray[i]=round(sqrt(parray[i]/PI));// radius for all the cirlces
						    }