/** * Associates the analysis with an identifier. * * @param label * the label describing the analysis. It is used in the titles of * frames and images when displaying results * @param makeUnique * if {@code true} and ImageJ is already displaying a window * using the same label as title, a suffix ("-1", "-2", etc.) is * appended to label to ensure it is unique */ public void setDescription(String label, final boolean makeUnique) { if (makeUnique) label = WindowManager.makeUniqueName(label); imgTitle = label; }
String makeTitle() { String prefix = "AVG_"; switch (method) { case SUM_METHOD: prefix = "SUM_"; break; case MAX_METHOD: prefix = "MAX_"; break; case MIN_METHOD: prefix = "MIN_"; break; case SD_METHOD: prefix = "STD_"; break; case MEDIAN_METHOD: prefix = "MED_"; break; } return WindowManager.makeUniqueName(prefix+imp.getTitle()); }
String makeTitle() { String prefix = "AVG_"; switch (method) { case SUM_METHOD: prefix = "SUM_"; break; case MAX_METHOD: prefix = "MAX_"; break; case MIN_METHOD: prefix = "MIN_"; break; case SD_METHOD: prefix = "STD_"; break; case MEDIAN_METHOD: prefix = "MED_"; break; } return WindowManager.makeUniqueName(prefix+imp.getTitle()); }
/** Creates a new high-resolution plot by scaling it and displays that plot if showIt is true. * <code>title</code> may be null, then a default title is used. */ public ImagePlus makeHighResolution(String title, float scale, boolean antialiasedText, boolean showIt) { Plot hiresPlot = null; try { hiresPlot = (Plot)clone(); //shallow clone, thus arrays&objects are not cloned } catch (Exception e) {return null;} hiresPlot.ip = null; hiresPlot.imp = null; hiresPlot.pp = pp.clone(); if (!plotDrawn) hiresPlot.getInitialMinAndMax(); hiresPlot.setScale(scale); hiresPlot.setAntialiasedText(antialiasedText); hiresPlot.defaultMinMax = currentMinMax.clone(); ImageProcessor hiresIp = hiresPlot.getProcessor(); if (title == null || title.length() == 0) title = getTitle()+"_HiRes"; title = WindowManager.makeUniqueName(title); ImagePlus hiresImp = new ImagePlus(title, hiresIp); Calibration cal = hiresImp.getCalibration(); hiresPlot.adjustCalibration(cal); if (showIt) { hiresImp.setIgnoreGlobalCalibration(true); hiresImp.show(); } hiresPlot.dispose(); //after drawing, we don't need the plot of the high-resolution image any more return hiresImp; }
/** Creates a new high-resolution plot by scaling it and displays that plot if showIt is true. * <code>title</code> may be null, then a default title is used. */ public ImagePlus makeHighResolution(String title, float scale, boolean antialiasedText, boolean showIt) { Plot hiresPlot = null; try { hiresPlot = (Plot)clone(); //shallow clone, thus arrays&objects are not cloned } catch (Exception e) {return null;} hiresPlot.ip = null; hiresPlot.imp = null; hiresPlot.pp = pp.clone(); if (!plotDrawn) hiresPlot.getInitialMinAndMax(); hiresPlot.setScale(scale); hiresPlot.setAntialiasedText(antialiasedText); hiresPlot.defaultMinMax = currentMinMax.clone(); ImageProcessor hiresIp = hiresPlot.getProcessor(); if (title == null || title.length() == 0) title = getTitle()+"_HiRes"; title = WindowManager.makeUniqueName(title); ImagePlus hiresImp = new ImagePlus(title, hiresIp); Calibration cal = hiresImp.getCalibration(); hiresPlot.adjustCalibration(cal); if (showIt) { hiresImp.setIgnoreGlobalCalibration(true); hiresImp.show(); } hiresPlot.dispose(); //after drawing, we don't need the plot of the high-resolution image any more return hiresImp; }
} else if (errorText != null) IJ.showMessage("AVI Reader", errorText); //show the error, e.g. we may have an incomplete stack imp = new ImagePlus(WindowManager.makeUniqueName(fileName), stack); if (imp.getBitDepth()==16) imp.getProcessor().resetMinAndMax();
} else if (errorText != null) IJ.showMessage("AVI Reader", errorText); //show the error, e.g. we may have an incomplete stack imp = new ImagePlus(WindowManager.makeUniqueName(fileName), stack); if (imp.getBitDepth()==16) imp.getProcessor().resetMinAndMax();
title = WindowManager.makeUniqueName(title); gd.addStringField("Title: ", title, 20); gd.addNumericField("Scale factor", hiResFactor, 1);
title = WindowManager.makeUniqueName(title); gd.addStringField("Title: ", title, 20); gd.addNumericField("Scale factor", hiResFactor, 1);
@Override public Image5D duplicate() { final String newTitle = WindowManager.makeUniqueName(getTitle()); final ImagePlus impOrig = new ImagePlus(newTitle, imageStack); final ImagePlus impCopy = (new ij.plugin.filter.Duplicater()).duplicateStack(impOrig, newTitle); final ImageStack stackCopy = impCopy.getStack(); final Image5D i5d = new Image5D(newTitle, stackCopy, getNChannels(), getNSlices(), getNFrames()); // Copy the calibration data. i5d.setCalibration(getCalibration().copy()); // Copy the arrays for channel display handling. for (int i = 0; i < getNChannels(); i++) { i5d.setCurrentPosition(0, 0, i, 0, 0); i5d.chCalibration[i] = chCalibration[i].copy(); i5d.chDisplayProps[i] = chDisplayProps[i].copy(); i5d.restoreCurrentChannelProperties(); } i5d.setDisplayGrayInTiles(displayGrayInTiles); i5d.setDisplayMode(displayMode); // Move to current positions. i5d.setCurrentPosition(currentPosition); return i5d; }
final byte[] blues = new byte[montageImageWidth * montageImageHeight]; final String newTitle = WindowManager.makeUniqueName(imp.getTitle() + " Montage"); final ImagePlus resultImp = IJ.createImage(newTitle, "rgb black", montageImageWidth,
WindowManager.makeUniqueName(imp.getTitle() + " Montage"); final Image5D resultI5D = new Image5D(newTitle, i5d.getType(), montageImageWidth,
WindowManager.makeUniqueName(imp.getTitle() + " Projection"); final Image5D resultI5D = new Image5D(newTitle, i5d.getType(), i5d.getWidth(), i5d.getHeight(),
final byte[] blues = new byte[i5d.getWidth() * i5d.getHeight()]; final String newTitle = WindowManager.makeUniqueName(imp.getTitle() + " Projection"); final ImagePlus resultImp = IJ.createImage(newTitle, "rgb black", i5d.getWidth(), i5d.getHeight(),