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

Method plotLanes

ij/src/main/java/ij/plugin/GelAnalyzer.java:264–399  ·  view source on GitHub ↗
(ImagePlus imp, boolean replot)

Source from the content-addressed store, hash-verified

262 }
263
264 void plotLanes(ImagePlus imp, boolean replot) {
265 int topMargin = 16;
266 int bottomMargin = 2;
267 double min = Double.MAX_VALUE;
268 double max = -Double.MAX_VALUE;
269 int plotWidth;
270 double[][] profiles;
271 profiles = new double[MAX_LANES+1][];
272 IJ.showStatus("Plotting " + nLanes + " lanes");
273 ImageProcessor ipRotated = imp.getProcessor();
274 if (isVertical)
275 ipRotated = ipRotated.rotateLeft();
276 ImagePlus imp2 = new ImagePlus("", ipRotated);
277 imp2.setCalibration(imp.getCalibration());
278 if (uncalibratedOD && (imp2.getType()==ImagePlus.GRAY16 || imp2.getType()==ImagePlus.GRAY32))
279 new ImageConverter(imp2).convertToGray8();
280 if (invertPeaks) {
281 ImageProcessor ip2 = imp2.getProcessor().duplicate();
282 ip2.invert();
283 imp2.setProcessor(null, ip2);
284 }
285 //imp2.show();
286
287 for (int i=1; i<=nLanes; i++) {
288 if (isVertical)
289 imp2.setRoi(firstRect.y,
290 ipRotated.getHeight() - x[i] - firstRect.width,
291 firstRect.height, firstRect.width);
292 else
293 imp2.setRoi(firstRect.x, x[i], firstRect.width, firstRect.height);
294 ProfilePlot pp = new ProfilePlot(imp2);
295 profiles[i] = pp.getProfile();
296 if (pp.getMin()<min)
297 min = pp.getMin();
298 if (pp.getMax()>max)
299 max = pp.getMax();
300 if (uncalibratedOD)
301 profiles[i] = od(profiles[i]);
302 }
303 if (uncalibratedOD) {
304 min = odMin;
305 max = odMax;
306 }
307
308 if (isVertical)
309 plotWidth = firstRect.height;
310 else
311 plotWidth = firstRect.width;
312 if (plotWidth<650)
313 plotWidth = 650;
314 if (isVertical) {
315 if (plotWidth>4*firstRect.height)
316 plotWidth = 4*firstRect.height;
317 } else {
318 if (plotWidth>4*firstRect.width)
319 plotWidth = 4*firstRect.width;
320 }
321

Callers 1

runMethod · 0.95

Calls 15

showStatusMethod · 0.95
rotateLeftMethod · 0.95
setCalibrationMethod · 0.95
getTypeMethod · 0.95
getProcessorMethod · 0.95
invertMethod · 0.95
setProcessorMethod · 0.95
setRoiMethod · 0.95
getHeightMethod · 0.95
getProfileMethod · 0.95
getMinMethod · 0.95
getMaxMethod · 0.95

Tested by

no test coverage detected