Creates a new high-resolution plot by scaling it and displays that plot if showIt is true. title may be null, then a default title is used.
(String title, float scale, boolean antialiasedText, boolean showIt)
| 1871 | /** Creates a new high-resolution plot by scaling it and displays that plot if showIt is true. |
| 1872 | * <code>title</code> may be null, then a default title is used. */ |
| 1873 | public ImagePlus makeHighResolution(String title, float scale, boolean antialiasedText, boolean showIt) { |
| 1874 | Plot hiresPlot = null; |
| 1875 | try { |
| 1876 | hiresPlot = (Plot)clone(); //shallow clone, thus arrays&objects are not cloned, but they will be used only now |
| 1877 | } catch (Exception e) {return null;} |
| 1878 | hiresPlot.ip = null; |
| 1879 | hiresPlot.imp = null; |
| 1880 | hiresPlot.pp = pp.clone(); |
| 1881 | if (!plotDrawn) hiresPlot.getInitialMinAndMax(); |
| 1882 | hiresPlot.setScale(scale); |
| 1883 | hiresPlot.setAntialiasedText(antialiasedText); |
| 1884 | hiresPlot.defaultMinMax = currentMinMax.clone(); |
| 1885 | ImageProcessor hiresIp = hiresPlot.getProcessor(); |
| 1886 | if (title == null || title.length() == 0) |
| 1887 | title = getTitle()+"_HiRes"; |
| 1888 | title = WindowManager.makeUniqueName(title); |
| 1889 | ImagePlus hiresImp = new ImagePlus(title, hiresIp); |
| 1890 | Calibration cal = hiresImp.getCalibration(); |
| 1891 | hiresPlot.adjustCalibration(cal); |
| 1892 | if (showIt) { |
| 1893 | hiresImp.setIgnoreGlobalCalibration(true); |
| 1894 | hiresImp.show(); |
| 1895 | } |
| 1896 | hiresPlot.dispose(); //after drawing, we don't need the plot of the high-resolution image any more |
| 1897 | return hiresImp; |
| 1898 | } |
| 1899 | |
| 1900 | @AstroImageJ(reason = "Support scalable plots") |
| 1901 | public Plot duplicate() { |
no test coverage detected