def measure_gd(src_folder,file_names):
	from javax.swing import JButton
	gd = NonBlockingGenericDialog("Loci to compartment")
	gd.setResizable(True)
	gd.pack()
	gd.addMessage("Draw a freehand ROI aound loci and closest \n compartment(e.g. speckle) and press 0 on keyboard.")
	gd.addMessage("To load next image press Next Image button.")
	next_imp_bt = JButton('Next Image', actionPerformed=load_next_image)
	gd.add(next_imp_bt)
	gd.setLocation(10,10)
	gd.setAlwaysOnTop(True)
	gd.hideCancelButton()
	gd.showDialog()  
	#  
	if gd.wasOKed():  
		IJ.log( "Measurement done! You're welcome!")
def measure_gd():
    # Dialouge box for measurements.
    # It
    from javax.swing import JButton
    gd = NonBlockingGenericDialog("Loci to compartment")
    gd.setResizable(True)
    gd.pack()
    gd.addMessage(
        "Draw a freehand ROI around the loci and closest \ncompartment(e.g. speckle) and press 0 on keyboard."
    )
    next_imp_bt = JButton('Analyze active image',
                          actionPerformed=analyze_image)
    gd.add(next_imp_bt)
    gd.setLocation(10, 10)
    gd.setAlwaysOnTop(True)
    gd.hideCancelButton()
    gd.showDialog()
    #
    if gd.wasOKed():
        IJ.log("Measurement done! Happy FISHing")