Methods inherited from class ĪddNotify, finalize, getAccessibleContext, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, paramString, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated PlugInFrameįocusGained, focusLost, run, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened "Fill", "Deselect", "Select All", "Combine", "Split" or "Sort" command.Įxecutes the ROI Manager "Open", "Save" or "Rename" command. ProcessWindowEvent( e)Įxecutes the ROI Manager "Add", "Add & Draw", "Update", "Delete", "Measure", "Draw", Returns the name of the selection with the specified index. ,, įields inherited from class ĬROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSORįields inherited from class īOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTįields inherited from interface ĪBORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHĪctionPerformed( e) This plugin implements the Analyze/Tools/ROI Manager command. Public class RoiManager extends PlugInFrame implements, ,, Ij. ij. All Implemented Interfaces:, ,, ,, ,, ,, PlugIn, java.io.Serializable, Images = getDirectory(“folder with images”) įor (i = 0 i < list.SUMMARY: NESTED | FIELD | CONSTR | METHOD Here’s the code in case it is useful for someone else in the future. I used the suggestion of Mathew and changed it slightly. Thanks everyone for your help! I got it to work now. NewName = imp.getShortTitle() + "-Roi_" + (listRoi.size()) Rm.rename(i, imp.getShortTitle() + "-Roi_1") NewName = imp.getShortTitle() + "-Roi_1" // Rename according to img name and roi number TODO : consider replace or putIfAbsent Check if img is already in the hashmap, if not, add it with the current roi as a list IJ.log(" Skipping " + roi.getName() + ": cannot find associated image (imgID " + imgID + " ).") Throw new IllegalArgumentException("Please record one ROI at least.") * Given an open ROI manager and open images in the workspace, maps the Rois to the images It is a work in progress, you may consider improving the for…loop part and the processing of the lists, or consider the opposite: looping over the open images and get the ROIs that belong to them in the ROI manager. The key function is imgID = roi.getImageID() The ROIs found in the ROI manager are renamed according to the image they were drawn on. It maps the content of the ROI manager to a hashmap, with Images as keys, and lists of Rois as values, e.g.: You can use it as a function, or an external script that will be called with ScriptService. Here’s a Groovy script that you may find useful. I happened to be working on something quite similar recently.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |