Package ij.measure

Examples of ij.measure.Calibration


    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


         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

    if (IJ.debugMode) IJ.log("FolderOpener: "+directory+" ("+list.length+" files)");
    int width=0,height=0,depth=0,bitDepth=0;
    ImageStack stack = null;
    double min = Double.MAX_VALUE;
    double max = -Double.MAX_VALUE;
    Calibration cal = null;
    boolean allSameCalibration = true;
    IJ.resetEscape();   
    try {
      for (int i=0; i<list.length; i++) {
        IJ.redirectErrorMessages();
View Full Code Here

      if (stacks[stackCount].getSize() > 0) {
        ImagePlus imp = new ImagePlus(lsmFi.fileName,
            stacks[stackCount]);
        imp.setFileInfo(lsmFi);

        Calibration cal = new Calibration();
        cal.setUnit(lsmFi.unit);
        cal.pixelDepth = lsmFi.pixelDepth;
        cal.pixelHeight = lsmFi.pixelHeight;
        cal.pixelWidth = lsmFi.pixelWidth;
        imp.setCalibration(cal);
        imp.setTitle(lsmFi.fileName + " Channel : "
View Full Code Here

      if (stacks[stackCount].getSize() > 0) {
        ImagePlus imp = new ImagePlus(lsmFi.fileName,
            stacks[stackCount]);
        imp.setFileInfo(lsmFi);

        Calibration cal = new Calibration();
        cal.setUnit(lsmFi.unit);
        cal.pixelDepth = lsmFi.pixelDepth;
        cal.pixelHeight = lsmFi.pixelHeight;
        cal.pixelWidth = lsmFi.pixelWidth;
        imp.setCalibration(cal);
        imp.setTitle(lsmFi.fileName + " Channel : "
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.changes=false; imp.close();}
        ImagePlus rImp = new ImagePlus(title+" (red)",red);
        rImp.setCalibration(cal);
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 ) {
      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

    if (label && pageWidth-dstWidth<fontSize+5) {
      dstY += fontSize+5;
      pageHeight -= fontSize+5;
    }
    if (actualSize) {
      Calibration cal = imp.getCalibration();
      int unitIndex = ImageProperties.getUnitIndex(cal.getUnit());
      if (unitIndex!=ImageProperties.OTHER_UNIT) {
        double unitsPerCm = ImageProperties.getUnitsPerCm(unitIndex);
        double widthInCm = width*cal.pixelWidth/unitsPerCm;
        double heightInCm = height*cal.pixelHeight/unitsPerCm;
        dstWidth = (int)((widthInCm*(72*0.3937))*scale);
 
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.