Package ij.measure

Examples of ij.measure.Calibration


    String directory = sd.getDirectory();
   
    ImageStack stack = imp.getStack();
    ImagePlus imp2 = new ImagePlus();
    imp2.setTitle(imp.getTitle());
    Calibration cal = imp.getCalibration();
    int nSlices = stack.getSize();
    String path,label=null;
    for (int i=1; i<=nSlices; i++) {
      IJ.showStatus("writing: "+i+"/"+nSlices);
      IJ.showProgress((double)i/nSlices);
View Full Code Here


        ImageStack s2 = null;
      if (arg.equals("right"))
          s2 = sp.rotateRight();
        else
          s2 = sp.rotateLeft();
        Calibration cal = imp.getCalibration();
        imp.setStack(null, s2);
        double pixelWidth = cal.pixelWidth;
        cal.pixelWidth = cal.pixelHeight;
        cal.pixelHeight = pixelWidth;
      return;
View Full Code Here

    if (options!=null && IJ.isJava14()) {
      String options2 = options.replaceAll(" depth=", " slices=");
      options2 = options2.replaceAll(" interval=", " frame=");
      Macro.setOptions(options2);
    }
    Calibration cal = imp.getCalibration();
    Calibration calOrig = cal.copy();
    oldUnitIndex = getUnitIndex(cal.getUnit());
    oldUnitsPerCm = getUnitsPerCm(oldUnitIndex);
    int stackSize = imp.getImageStackSize();
    int channels = imp.getNChannels();
    int slices = imp.getNSlices();
View Full Code Here

         return;
     } else {
       int flags = setupDialog(imp, 0);
       if (flags==PlugInFilter.DONE) return;
      stackHistogram = flags==PlugInFilter.DOES_STACKS;
      Calibration cal = imp.getCalibration();
       nBins = 256;
      if (stackHistogram && ((bitDepth==8&&!cal.calibrated())||bitDepth==24)) {
        xMin = 0.0;
        xMax = 256.0;
        useImageMinAndMax = false;
      } else
        useImageMinAndMax = true;
View Full Code Here

    if (imp.getID()!=imageID || (min==xMin&&min==xMax))
      useImageMinAndMax = true;
    if (imp.getID()!=imageID || useImageMinAndMax) {
      xMin = min;
      xMax = max;
      Calibration cal = imp.getCalibration();
      xMin = cal.getCValue(xMin);
      xMax = cal.getCValue(xMax);
    }
    defaultMin = IJ.d2s(xMin,2);
    defaultMax = IJ.d2s(xMax,2);
    imageID = imp.getID();
    int stackSize = imp.getStackSize();
View Full Code Here

      drawBorder(montage, w2, w2, montageWidth-w2, montageHeight-w2, borderWidth);
    }
    IJ.showProgress(1.0);
    ImagePlus imp2 = new ImagePlus("Montage", montage);
    imp2.setCalibration(imp.getCalibration());
    Calibration cal = imp2.getCalibration();
    if (cal.scaled()) {
      cal.pixelWidth /= scale;
      cal.pixelHeight /= scale;
    }
        imp2.setProperty("Info", "xMontage="+columns+"\nyMontage="+rows+"\n");
    imp2.show();
View Full Code Here

    imp.unlock(); // so users can adjust brightness/contrast/threshold
    swin.running2 = true;
    long time, nextTime=System.currentTimeMillis();
    Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
    int sliceIncrement = 1;
    Calibration cal = imp.getCalibration();
    if (cal.fps!=0.0)
      animationRate = cal.fps;
    while (swin.running2) {
      time = System.currentTimeMillis();
      if (time<nextTime)
View Full Code Here

    if (firstFrame<1 || firstFrame>nSlices || lastFrame<1 || lastFrame>nSlices) {
      firstFrame = 1;
      lastFrame = nSlices;
    }
    boolean start = !swin.running2;
    Calibration cal = imp.getCalibration();
    if (cal.fps!=0.0)
      animationRate = cal.fps;
    else if (cal.frameInterval!=0.0 && cal.getTimeUnit().equals("sec"))
      animationRate = 1.0/cal.frameInterval;
    int decimalPlaces = (int)animationRate==animationRate?0:1;
    GenericDialog gd = new GenericDialog("Animation Options");
    gd.addNumericField("Speed (0.1-100 fps):", animationRate, decimalPlaces);
    gd.addNumericField("First Frame:", firstFrame, 0);
View Full Code Here

    /** Splits the specified RGB image or stack into three 8-bit grayscale images or stacks. */
    public void split(ImagePlus imp) {
      boolean keepSource = IJ.altKeyDown();
        String title = imp.getTitle();
        Calibration cal = imp.getCalibration();
        split(imp.getStack(), keepSource);
        if (!keepSource)
            {imp.unlock(); imp.close();}
        ImagePlus rImp = new ImagePlus(title+" (red)",red);
        rImp.setCalibration(cal);
View Full Code Here

  }
 
  /** Save the image as tab-delimited text using the specified path. */
  public boolean saveAsText(String path) {
    try {
      Calibration cal = imp.getCalibration();
      int precision = Analyzer.getPrecision();
      TextEncoder file = new TextEncoder(imp.getProcessor(), cal, precision);
      DataOutputStream out = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(path)));
      file.write(out);
      out.close();
View Full Code Here

TOP

Related Classes of ij.measure.Calibration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.