(ImageProcessor ip)
| 126 | } |
| 127 | |
| 128 | public void label(ImageProcessor ip) { |
| 129 | if (!IJ.isMacro()) { |
| 130 | IJ.error("Label", "To label a selection, enable \"Add to overlay\" in Analyze>\nSet Measurements and press 'm' (Analyze>Measure)."); |
| 131 | return; |
| 132 | } |
| 133 | if (Analyzer.getCounter()==0) { |
| 134 | IJ.error("Label", "Measurement counter is zero"); |
| 135 | return; |
| 136 | } |
| 137 | if (Analyzer.firstParticle<Analyzer.lastParticle) |
| 138 | drawParticleLabels(ip); |
| 139 | else { |
| 140 | ip.setColor(Toolbar.getForegroundColor()); |
| 141 | ImageCanvas ic = imp.getCanvas(); |
| 142 | if (ic!=null) { |
| 143 | double mag = ic.getMagnification(); |
| 144 | if (mag<1.0) { |
| 145 | int lineWidth = 1; |
| 146 | lineWidth = (int)(lineWidth/mag); |
| 147 | ip.setLineWidth(lineWidth); |
| 148 | } |
| 149 | } |
| 150 | roi.drawPixels(ip); |
| 151 | ip.setLineWidth(1); |
| 152 | drawLabel(ip); |
| 153 | } |
| 154 | } |
| 155 | |
| 156 | void drawParticleLabels(ImageProcessor ip) { |
| 157 | ResultsTable rt = ResultsTable.getResultsTable(); |
no test coverage detected