Package ij.measure

Examples of ij.measure.Calibration.scaled()


      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;
 
View Full Code Here


    if (virtual) {
      IJ.showProgress(1.0);
      imp.setTitle(imp.getTitle());
    }
    Calibration cal = imp.getCalibration();
    if (cal.scaled()) cal.pixelDepth *= factor;
  }
 
  public void reduceHyperstack(ImagePlus imp, int factor, boolean reduceSlices) {
    int channels = imp.getNChannels();
    int slices = imp.getNSlices();
View Full Code Here

        }
      }
    }
    imp.setStack(stack2, channels, slices2, frames2);
    Calibration cal = imp.getCalibration();
    if (cal.scaled()) cal.pixelDepth *= zfactor;
    if (virtual) imp.setTitle(imp.getTitle());
    IJ.showProgress(1.0);
  }

}
View Full Code Here

      Rectangle r = roi.getBounds();
      width = r.width;
      height = r.height;
      xRoi = r.x;
      yRoi = r.y;
      if (scaledUnits && cal.scaled()) {
        xRoi = xRoi*cal.pixelWidth;
        yRoi = yRoi*cal.pixelHeight;
        width = width*cal.pixelWidth;
        height = height*cal.pixelHeight;
      }
 
View Full Code Here

     *  option for oval, and option for whether x & y coordinates to be centered.
     */
    void showDialog() {
      Calibration cal = imp.getCalibration();
      int digits = 0;
      if (scaledUnits && cal.scaled())
        digits = 2;
      Roi roi = imp.getRoi();
      if (roi==null)
        drawRoi();
        GenericDialog gd = new GenericDialog("Specify");
View Full Code Here

        gd.addNumericField("Y Coordinate:", yRoi, digits);
        if (stackSize>1)
          gd.addNumericField("Slice:", iSlice, 0);
        gd.addCheckbox("Oval", oval);
        gd.addCheckbox("Centered",centered);
        if (cal.scaled())
            gd.addCheckbox("Scaled Units ("+cal.getUnits()+")", scaledUnits);
        fields = gd.getNumericFields();
        gd.addDialogListener(this);
        gd.showDialog();
        if (gd.wasCanceled()) {
View Full Code Here

      iY = (int)(yRoi - (height/2));
    }
    int iWidth = (int)width;
    int iHeight = (int)height;
    Calibration cal = imp.getCalibration();
    if (scaledUnits && cal.scaled()) {
      iX = (int)Math.round(iX/cal.pixelWidth);
      iY = (int)Math.round(iY/cal.pixelHeight);
      iWidth = (int)Math.round(width/cal.pixelWidth);
      iHeight = (int)Math.round(height/cal.pixelHeight);
      prevPixelWidth = cal.pixelWidth;
View Full Code Here

      fi.fileName = "";
      fi.directory = directory;
      imp2.setFileInfo(fi); // saves FileInfo of the first image
      if (allSameCalibration) {
        // use calibration from first image
        if (scale!=100.0 && cal.scaled()) {
          cal.pixelWidth /= scale/100.0;
          cal.pixelHeight /= scale/100.0;
        }
        if (cal.pixelWidth!=1.0 && cal.pixelDepth==1.0)
          cal.pixelDepth = cal.pixelWidth;
View Full Code Here

    }
    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

TOP
Copyright © 2018 www.massapi.com. 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.