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)
| 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 */ |
no test coverage detected