(ImagePlus imp)
| 417 | } |
| 418 | |
| 419 | private synchronized void incrementCounter(ImagePlus imp) { |
| 420 | counts[counter]++; |
| 421 | boolean isStack = imp!=null && imp.getStackSize()>1; |
| 422 | if (counter!=0 || isStack || counters!=null) { |
| 423 | if (counters==null) { |
| 424 | int size = nPoints*2; |
| 425 | if (size<100) size=100; |
| 426 | counters = new short[size]; |
| 427 | positions = new int[size]; |
| 428 | } |
| 429 | if (nPoints>=counters.length) { |
| 430 | short[] temp = new short[counters.length*2]; |
| 431 | System.arraycopy(counters, 0, temp, 0, counters.length); |
| 432 | counters = temp; |
| 433 | int[] temp1 = new int[counters.length*2]; |
| 434 | System.arraycopy(positions, 0, temp1, 0, positions.length); |
| 435 | positions = temp1; |
| 436 | } |
| 437 | counters[nPoints-1] = (short)counter; |
| 438 | if (imp!=null) |
| 439 | positions[nPoints-1] = imp.getStackSize()>1 ? imp.getCurrentSlice() : 0; |
| 440 | } |
| 441 | if (rt!=null && WindowManager.getFrame(getCountsTitle())!=null) |
| 442 | displayCounts(); |
| 443 | } |
| 444 | |
| 445 | /** Returns the index of the current counter. */ |
| 446 | public int getCounter() { |
no test coverage detected