Returns the plot as an ImagePlus. If an ImagePlus for this plot already exists, displays the plot in that ImagePlus and returns it.
()
| 1670 | /** Returns the plot as an ImagePlus. |
| 1671 | * If an ImagePlus for this plot already exists, displays the plot in that ImagePlus and returns it. */ |
| 1672 | public ImagePlus getImagePlus() { |
| 1673 | if (stack != null) { |
| 1674 | if (imp != null) |
| 1675 | return imp; |
| 1676 | else { |
| 1677 | imp = new ImagePlus(title, stack); |
| 1678 | adjustCalibration(imp.getCalibration()); |
| 1679 | return imp; |
| 1680 | } |
| 1681 | } |
| 1682 | if (plotDrawn) |
| 1683 | updateImage(); |
| 1684 | else |
| 1685 | draw(); |
| 1686 | if (imp != null) { |
| 1687 | if (imp.getProcessor() != ip) |
| 1688 | imp.setProcessor(ip); |
| 1689 | return imp; |
| 1690 | } else { |
| 1691 | ImagePlus imp = new ImagePlus(title, ip); |
| 1692 | setImagePlus(imp); |
| 1693 | return imp; |
| 1694 | } |
| 1695 | } |
| 1696 | |
| 1697 | /** Sets the ImagePlus where the plot will be displayed. If the ImagePlus is not |
| 1698 | * known otherwise (e.g. from getImagePlus), this is needed for changes such as |
no test coverage detected