Returns the index of the ROI with the specified name, or -1 if not found.
(String name)
| 118 | |
| 119 | /** Returns the index of the ROI with the specified name, or -1 if not found. */ |
| 120 | public int getIndex(String name) { |
| 121 | if (name==null) return -1; |
| 122 | Roi[] rois = toArray(); |
| 123 | for (int i=rois.length-1; i>=0; i--) { |
| 124 | if (name.equals(rois[i].getName())) |
| 125 | return i; |
| 126 | } |
| 127 | return -1; |
| 128 | } |
| 129 | |
| 130 | /** Returns the index of the last ROI that contains the point (x,y) |
| 131 | or null if no ROI contains the point. */ |