Package ij.measure

Examples of ij.measure.Calibration


      firstZ = lastZ = imp.getSlice();
      firstT = lastT = imp.getFrame();
    }
    imp2 = run(imp, firstC, lastC, firstZ, lastZ, firstT, lastT);
    if (imp2==null) return;
    Calibration cal = imp2.getCalibration();
    if (roi!=null && (cal.xOrigin!=0.0||cal.yOrigin!=0.0)) {
      cal.xOrigin -= roi.getBounds().x;
      cal.yOrigin -= roi.getBounds().y;
    }
    imp2.setTitle(newTitle);
View Full Code Here


    imp.unlock(); // so users can adjust brightness/contrast/threshold
    swin.setAnimate(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;
    if (animationRate<0.1)
      animationRate = 1.0;
    int frames = imp.getNFrames();
View Full Code Here

        lastFrame = frames;
      else if (slices>1)
        lastFrame=slices;
    }
    boolean start = !swin.getAnimate();
    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:3;
    GenericDialog gd = new GenericDialog("Animation Options");
    gd.addNumericField("Speed (0.1-1000 fps):", animationRate, decimalPlaces);
    if (!imp.isDisplayedHyperStack()) {
View Full Code Here

      if (size>maxSize) {
        maxSize = size;
        maxWidth = w;
        maxHeight = h;
      }
      Calibration cal = image[i].getCalibration();
      if (!image[i].getCalibration().equals(cal2))
        cal2 = null;
      image[index++] = image[i];
    }
    return index;
View Full Code Here

        double max = dd.windowCenter+dd.windowWidth/2;
        if (Prefs.openDicomsAsFloat) {
          min -= dd.rescaleIntercept;
          max -= dd.rescaleIntercept;
        } else {
          Calibration cal = imp.getCalibration();
          min = cal.getRawValue(min);
          max = cal.getRawValue(max);
        }
        ip.setMinAndMax(min, max);
        if (IJ.debugMode) IJ.log("window: "+min+"-"+max);
      }
      if (imp.getStackSize()>1)
View Full Code Here

    if (IJ.debugMode) IJ.log("min: "+(min-32768));
    if (min>=32768) {
      for (int i=0; i<pixels.length; i++)
        pixels[i] = (short)(pixels[i]-32768);
      ip.resetMinAndMax();
      Calibration cal = imp.getCalibration();
      cal.setFunction(Calibration.NONE, null, "Gray Value");
      fi.fileType = FileInfo.GRAY16_UNSIGNED;
    }
  }
View Full Code Here

      ip2 = straighten(imp, roi, width);
      imp2 = new ImagePlus(WindowManager.getUniqueName(imp.getTitle()), ip2);
    }
    if (imp2==null)
      return;
    Calibration cal = imp.getCalibration();
    if (cal.pixelWidth==cal.pixelHeight)
      imp2.setCalibration(cal);
    imp2.show();
    //imp.setRoi(roi);
    //if (type==Roi.POLYLINE&& !((PolygonRoi)roi).isSplineFit()) {
View Full Code Here

    if (!(format.equals("jpeg")||format.equals("png")))
      isOverlay = false;
    ImageStack stack = imp.getStack();
    ImagePlus imp2 = new ImagePlus();
    imp2.setTitle(imp.getTitle());
    Calibration cal = imp.getCalibration();
    int nSlices = stack.getSize();
    String path,label=null;
    imp.lock();
    for (int i=1; i<=nSlices; i++) {
      IJ.showStatus("writing: "+i+"/"+nSlices);
View Full Code Here

  public double getLength() {
    double length = 0.0;
    double dx, dy;
    double w2=1.0, h2=1.0;
    if (imp!=null) {
      Calibration cal = imp.getCalibration();
      w2 = cal.pixelWidth*cal.pixelWidth;
      h2 = cal.pixelHeight*cal.pixelHeight;
    }
    for (int i=0; i<(nPoints-1); i++) {
      dx = xpf[i+1]-xpf[i];
View Full Code Here

  public double[] getFeretValues() {
    double a[] = super.getFeretValues();
    double pw=1.0, ph=1.0;
    if (imp!=null) {
      Calibration cal = imp.getCalibration();
      pw = cal.pixelWidth;
      ph = cal.pixelHeight;
    }
    double[] p = getParams();
    double dx = (p[2] - p[0])*pw;
 
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.