Package ij.measure

Examples of ij.measure.Calibration


      s += "t:"+t+"/"+nFrames;
      s += "; ";
    }
    if (running2) return s;
      int type = imp.getType();
      Calibration cal = imp.getCalibration();
      if (cal.scaled())
        s += IJ.d2s(imp.getWidth()*cal.pixelWidth,2) + "x" + IJ.d2s(imp.getHeight()*cal.pixelHeight,2)
       + " " + cal.getUnits() + " (" + imp.getWidth() + "x" + imp.getHeight() + "); ";
      else
        s += imp.getWidth() + "x" + imp.getHeight() + " pixels; ";
    int size = (imp.getWidth()*imp.getHeight()*imp.getStackSize())/1024;
      switch (type) {
        case ImagePlus.GRAY8:
View Full Code Here


  /** Returns the perimeter length. */
  public double getLength() {
    double pw=1.0, ph=1.0;
    if (imp!=null) {
      Calibration cal = imp.getCalibration();
      pw = cal.pixelWidth;
      ph = cal.pixelHeight;
    }
    return Math.PI*(width*pw+height*ph)/2.0;
  }
 
View Full Code Here

  /** Returns Feret's diameter, the greatest distance between
    any two points along the ROI boundary. */
  public double getFeretsDiameter() {
    double pw=1.0, ph=1.0;
    if (imp!=null) {
      Calibration cal = imp.getCalibration();
      pw = cal.pixelWidth;
      ph = cal.pixelHeight;
    }
    return width*pw>=height*ph?width*pw:height*ph;
  }
 
View Full Code Here

   
    /** Returns the plot as an ImagePlus. */
    public ImagePlus getImagePlus() {
        draw();
        ImagePlus img = new ImagePlus(title, ip);
        Calibration cal = img.getCalibration();
        cal.xOrigin = LEFT_MARGIN;
        cal.yOrigin = TOP_MARGIN+frameHeight+yMin*yScale;
        cal.pixelWidth = 1.0/xScale;
        cal.pixelHeight = 1.0/yScale;
        cal.setInvertY(true);
        return img;
    }
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

    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

    double lower = ip.getMinThreshold();
    if (lower!=ImageProcessor.NO_THRESHOLD) {
      transparencyLower = (int)lower;
      transparencyUpper = (int)ip.getMaxThreshold();
    }
    Calibration cal = imp.getCalibration();
    GenericDialog gd = new GenericDialog("3D Projection");
    gd.addChoice("Projection Method:", methodList, methodList[projectionMethod]);
    gd.addChoice("Axis of Rotation:", axisList, axisList[axisOfRotation]);
    //gd.addMessage("");
    gd.addNumericField("Slice Spacing ("+cal.getUnits()+"):",cal.pixelDepth,2);

    gd.addNumericField("Initial Angle (0-359 degrees):", initAngle, 0);
    gd.addNumericField("Total Rotation (0-359 degrees):", totalAngle, 0);
    gd.addNumericField("Rotation Angle Increment:", angleInc, 0);
    gd.addNumericField("Lower Transparency Bound:", transparencyLower, 0);
View Full Code Here

        RGBStackSplitter splitter = new RGBStackSplitter();
        splitter.split(imp.getStack(), true);
        ImagePlus red = new ImagePlus("Red", splitter.red);
        ImagePlus green = new ImagePlus("Green", splitter.green);
        ImagePlus blue = new ImagePlus("Blue", splitter.blue);
        Calibration cal = imp.getCalibration();
        Roi roi = imp.getRoi();
        if (roi!=null)
          {red.setRoi(roi); green.setRoi(roi); blue.setRoi(roi);}
        red.setCalibration(cal); green.setCalibration(cal); blue.setCalibration(cal);
        label = "Red: ";
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

  }
 
  /** 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.