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

Method setImagePlus

ij/src/main/java/ij/gui/Plot.java:1705–1723  ·  view source on GitHub ↗

Sets the ImagePlus where the plot will be displayed. If the ImagePlus is not known otherwise (e.g. from getImagePlus), this is needed for changes such as zooming in to work correctly. It also sets the calibration of the ImagePlus. The ImagePlus is not displayed or updated unless its ImageProcessor i

(ImagePlus imp)

Source from the content-addressed store, hash-verified

1703 * 'imp' may be null to disconnect the plot from its ImagePlus.
1704 * Does nothing for Plot Stacks. */
1705 @AstroImageJ(reason = "Support vectorized plot drawing", modified = true)
1706 public void setImagePlus(ImagePlus imp) {
1707 if (imp != null && imp == this.imp && imp.getProcessor() == ip)
1708 return;
1709 if (stack != null)
1710 return;
1711 if (this.imp != null) {
1712 this.imp.setProperty(PROPERTY_KEY, null);
1713 this.imp.setProperty(VectorPlotDrawing.PROPERTY_KEY, null);
1714 }
1715 this.imp = imp;
1716 if (imp != null) {
1717 imp.setIgnoreGlobalCalibration(true);
1718 adjustCalibration(imp.getCalibration());
1719 imp.setProperty(PROPERTY_KEY, this);
1720 if (ip != null && imp.getProcessor() != ip)
1721 imp.setProcessor(ip);
1722 }
1723 }
1724
1725 /** Adjusts a Calibration object to fit the current axes.
1726 * For log axes, the calibration refers to the base-10 logarithm of the value */

Callers 5

setImageMethod · 0.95
runMethod · 0.95
getImagePlusMethod · 0.95
showMethod · 0.95
drawPlotMethod · 0.80

Calls 6

adjustCalibrationMethod · 0.95
getCalibrationMethod · 0.80
getProcessorMethod · 0.45
setPropertyMethod · 0.45
setProcessorMethod · 0.45

Tested by

no test coverage detected