Returns a reference to the active image, or displays an error message and aborts the plugin or macro if no images are open.
()
| 1889 | /** Returns a reference to the active image, or displays an error |
| 1890 | message and aborts the plugin or macro if no images are open. */ |
| 1891 | public static ImagePlus getImage() { |
| 1892 | ImagePlus img = WindowManager.getCurrentImage(); |
| 1893 | if (img==null) { |
| 1894 | IJ.noImage(); |
| 1895 | if (ij==null) |
| 1896 | System.exit(0); |
| 1897 | else |
| 1898 | abort(); |
| 1899 | } |
| 1900 | return img; |
| 1901 | } |
| 1902 | |
| 1903 | /**The macro interpreter uses this method to call getImage().*/ |
| 1904 | public static ImagePlus getImage(Interpreter interpreter) { |
no test coverage detected