Returns the active image or stack slice as an ImageProcessor, or displays an error message and aborts the plugin or macro if no images are open.
()
| 1911 | /** Returns the active image or stack slice as an ImageProcessor, or displays |
| 1912 | an error message and aborts the plugin or macro if no images are open. */ |
| 1913 | public static ImageProcessor getProcessor() { |
| 1914 | ImagePlus imp = IJ.getImage(); |
| 1915 | return imp.getProcessor(); |
| 1916 | } |
| 1917 | |
| 1918 | /** Switches to the specified stack slice, where 1<='slice'<=stack-size. */ |
| 1919 | public static void setSlice(int slice) { |