MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / label

Method label

ij/src/main/java/ij/plugin/filter/Filler.java:128–154  ·  view source on GitHub ↗
(ImageProcessor ip)

Source from the content-addressed store, hash-verified

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();

Callers 1

runMethod · 0.95

Calls 11

isMacroMethod · 0.95
errorMethod · 0.95
getCounterMethod · 0.95
drawParticleLabelsMethod · 0.95
getForegroundColorMethod · 0.95
getMagnificationMethod · 0.95
drawLabelMethod · 0.95
setColorMethod · 0.65
setLineWidthMethod · 0.65
getCanvasMethod · 0.45
drawPixelsMethod · 0.45

Tested by

no test coverage detected