def get_setup(): ''' Returns the drift correction mode and three image. The order of return values is drift detection mode, pre-edge 1, pre-edge 2, post-edge. ''' options = drift.get_options() modes = drift.get_modes() dialog = GenericDialog('3-window-method setup') dialog.addMessage('Select the mode for drift correction\n' + 'and the images to process.') dialog.addChoice('Mode:', options, options[0]) image_ids = WindowManager.getIDList() if not image_ids or len(image_ids) < 2: return [None]*4 image_titles = [WindowManager.getImage(id).getTitle() for id in image_ids] dialog.addMessage('Post-edge is divided by the pre-edge.') dialog.addChoice('Pre-edge 1', image_titles, image_titles[0]) dialog.addChoice('Pre-edge 2', image_titles, image_titles[1]) dialog.addChoice('Post-edge', image_titles, image_titles[2]) dialog.showDialog() if dialog.wasCanceled(): return [None]*4 mode = modes[dialog.getNextChoiceIndex()] img1 = WindowManager.getImage(image_ids[dialog.getNextChoiceIndex()]) img2 = WindowManager.getImage(image_ids[dialog.getNextChoiceIndex()]) img3 = WindowManager.getImage(image_ids[dialog.getNextChoiceIndex()]) return mode, img1, img2, img3
def get_setup(): ''' Returns the drift correction mode and two image.''' options = drift.get_options() modes = drift.get_modes() dialog = GenericDialog('Jump-ratio setup') dialog.addMessage('Select the mode for drift correction\n' + 'and the images to process.') dialog.addChoice('Mode:', options, options[0]) image_ids = WindowManager.getIDList() if not image_ids or len(image_ids) < 2: return [None]*3 image_titles = [WindowManager.getImage(id).getTitle() for id in image_ids] dialog.addMessage('Post-edge is divided by the pre-edge.') dialog.addChoice('Pre-edge', image_titles, image_titles[0]) dialog.addChoice('Post-edge', image_titles, image_titles[1]) dialog.showDialog() if dialog.wasCanceled(): return [None]*3 mode = modes[dialog.getNextChoiceIndex()] img1 = WindowManager.getImage(image_ids[dialog.getNextChoiceIndex()]) img2 = WindowManager.getImage(image_ids[dialog.getNextChoiceIndex()]) return mode, img1, img2