I'm developing a program that receives a stack of images. Then, it computes the average of all pixels and displays it as a new image. Then, for the program to keep running, I need the user to select a ROI with the mouse. But I don't know how to do that. How do you get the user to select the ROI and after he does the program keeps running?