def getEdgeCoord(x, y, circRad, imp, msg): IJ.run(imp, "Select None", "") imp.setRoi(IJ.OvalRoi(x, y, circRad * 2, circRad * 2)) gd = NonBlockingGenericDialog(msg) gd.addMessage('Select ' + msg + ' coordinates') gd.showDialog() if gd.wasCanceled(): return None # wait for user input coord = imp.getRoi().getContourCentroid() IJ.run(imp, "Select None", "") return coord[0] - circRad, coord[1] - circRad
def makeSelections(x, y, rm, imp, circRad): rm.reset() for j in range(len(x)): for i in range(len(x[-1])): imp.setRoi(IJ.OvalRoi(x[j][i], y[j][i], circRad * 2, circRad * 2)) rm.addRoi(imp.getRoi()) rm.runCommand(imp, "Show All with labels") gd = NonBlockingGenericDialog('Confirm ROI positions') gd.addMessage('Are the ROIs positioned correctly? Move them if necessary') gd.showDialog() if gd.wasCanceled(): return None return imp, rm