procedure tcircle (image, clob, Xc, Yc, R, flux, dimensi, applmask, maskName, autodisp, frm) string image {prompt="Image with ring needing centre"} bool clob {yes,prompt="Del existing tcircle o/p on this image?"} int Xc {prompt="X-coord of ring pattern centre"} int Yc {prompt="Y-coord of ring pattern centre"} int R {prompt="Radius of the fit"} int flux {prompt="Brightness of circle"} string dimensi {"1024,1024", prompt="Dimensions of image"} bool applmask {no,prompt="Apply mask image?"} string maskName {prompt="Name of mask image to apply"} int frm {1, prompt="Ximtool frame to display into"} bool autodisp {yes,prompt="Automatically display result?"} begin # Variable Declarations: int lineCount # line counter used when reading files string message # string containing a message output to user string newImage # name of new image with circle superimposed string newExpr # string containing expression for circle imdelete(images="tempCircle",verify=no,default=yes, go_ahead=yes) imdelete(images="tempCircle2",verify=no,default=yes, go_ahead=yes) newImage = image//"_circ" imdelete(images=newImage,verify=no,default=yes, go_ahead=yes) if (clob==yes) { imdelete(images=newImage,verify=no,default=yes, go_ahead=yes) } print (" ") print("Creating an image with ring superimposed ...") print (" ") newExp = "( ((sqrt((I-"//Xc//")**2 + (J-"//Yc//")**2) > ("//R//"-2)) && (sqrt((I-"//Xc//")**2 + (J-"//Yc//")**2) < ("//R//"+2))) || (sqrt((I-"//Xc//")**2 + (J-"//Yc//")**2) < 7) ) ? "//flux//" : 0" # i.e. points on circle are set to 100; zero otherwise imexpr (expr=newExp, output="tempCircle", dims=dimensi, outtype="real", intype="double") if (applmask==yes) { print("Please wait while I apply the image mask ...") imarith(operand1="tempCircle", op="*", operand2=maskName, result="tempCircle2", verb=no) } if (applmask==no) { imrename(oldname="tempCircle", newname="tempCircle2", verb-) } imarith(operand1="tempCircle2", op="+", operand2=image, result=newImage, verb=no) print(" ") message = "The image "//newImage//" has been created ..." print(message) print(" ") imdelete(images="tempCircle",verify=no,default=yes, go_ahead=yes) imdelete(images="tempCircle2",verify=no,default=yes, go_ahead=yes) if (autodisp==yes) { display (image=newImage,fra=frm,erase+,bord-, sele+,repe-,fill-,zscal+,ztrans="linear") } end