Measures the image or selection and adds the results to the default results table.
()
| 260 | |
| 261 | /** Measures the image or selection and adds the results to the default results table. */ |
| 262 | public void measure() { |
| 263 | String lastHdr = rt.getColumnHeading(ResultsTable.LAST_HEADING); |
| 264 | if (lastHdr==null || lastHdr.charAt(0)!='M') { |
| 265 | if (!reset()) return; |
| 266 | } |
| 267 | firstParticle = lastParticle = 0; |
| 268 | Roi roi = imp.getRoi(); |
| 269 | if (roi!=null && roi.getType()==Roi.POINT) { |
| 270 | measurePoint(roi); |
| 271 | return; |
| 272 | } |
| 273 | if (roi!=null && roi.getType()==Roi.ANGLE) { |
| 274 | measureAngle(roi); |
| 275 | return; |
| 276 | } |
| 277 | if (roi!=null && roi.isLine()) { |
| 278 | measureLength(roi); |
| 279 | return; |
| 280 | } |
| 281 | ImageStatistics stats; |
| 282 | if (isRedirectImage()) { |
| 283 | stats = getRedirectStats(measurements, roi); |
| 284 | if (stats==null) return; |
| 285 | } else |
| 286 | stats = imp.getStatistics(measurements); |
| 287 | if (!IJ.isResultsWindow() && IJ.getInstance()!=null) |
| 288 | reset(); |
| 289 | saveResults(stats, roi); |
| 290 | } |
| 291 | |
| 292 | /* |
| 293 | void showHeadings() { |
no test coverage detected