Package ij

Examples of ij.ImageStack


        int CoordOffset, xmax, ymax;
        boolean setPixel;

        IJ.showStatus("Finding ultimate points");
        if (debug) {
            movie = new ImageStack(ip.getWidth(), ip.getHeight());
            movie.addSlice("EDM", ip.duplicate());
        }
        if (watershed) {
            filterEDM(ip, true);
            filterEDM(ip, false);
View Full Code Here


  public void applyZSTAMP(ImagePlus imp, LsmFileInfo lfi) {
    int x = 2;
    int y = 40;
    double ps = 0;
    ImageStack stack = imp.getStack();
    Font font = new Font("SansSerif", Font.PLAIN, 20);
    ImageProcessor ip = imp.getProcessor();
    Rectangle roi = ip.getRoi();
    if (roi.width < ip.getWidth() || roi.height < ip.getHeight()) {
      x = roi.x;
      y = roi.y + roi.height;
    }
    Color c = Toolbar.getForegroundColor();
    CZ_LSMInfo cz = (CZ_LSMInfo) ((ImageDirectory) lfi.imageDirectories
        .get(0)).TIF_CZ_LSMINFO;
    if (cz.DimensionZ != 1) {
      Recording r = (Recording) cz.scanInfo.recordings
          .get(0);
      double planeSpacing = ((Double) r.records.get("PLANE SPACING"))
          .doubleValue();

      if ((cz.DimensionTime == 1)) {

        for (int slice = 1; slice <= cz.DimensionZ; slice++) {
          IJ.showStatus("MinMax: " + slice + "/"
              + cz.DimensionZ);
          String s = IJ.d2s(ps, 2) + " "+MasterModel.micrometer;
          ps += planeSpacing;
          ip = stack.getProcessor(slice);
          ip.setFont(font);
          float[] hsb = Color.RGBtoHSB(c.getRed(), c.getGreen(), c
              .getBlue(), null);
          ip.setColor(Color.getHSBColor(255, 255, 255 - hsb[2]));
          ip.moveTo(x, y);
          ip.drawString(s);
        }
      } else if (cz.DimensionTime != 1) {
        for (int slicez = 1; slicez <= cz.DimensionZ; slicez++) {
          IJ.showStatus("MinMax: " + slicez + "/"
              + cz.DimensionZ);
          String s = IJ.d2s(ps, 2) + " " + MasterModel.micrometer;
          ps += planeSpacing;
          for (int slicet = 1; slicet <= cz.DimensionTime; slicet++) {
            ip = stack
                .getProcessor((int) cz.DimensionZ
                    * (slicet - 1) + slicez);
            ip.setFont(font);
            float[] hsb = Color.RGBtoHSB(c.getRed(), c.getGreen(),
                c.getBlue(), null);
View Full Code Here

  public void applyTSTAMP(ImagePlus imp, LsmFileInfo lfi) {
    int x = 2;
    int y = 20;

    ImageStack stack = imp.getStack();
    Font font = new Font("SansSerif", Font.PLAIN, 20);
    ImageProcessor ip = imp.getProcessor();
    Rectangle roi = ip.getRoi();
    if (roi.width < ip.getWidth() || roi.height < ip.getHeight()) {
      x = roi.x;
      y = roi.y + roi.height;
    }
    Color c = Toolbar.getForegroundColor();
    CZ_LSMInfo cz = (CZ_LSMInfo) ((ImageDirectory) lfi.imageDirectories
        .get(0)).TIF_CZ_LSMINFO;
    if ((cz.DimensionTime == 1)
        ^ (cz.DimensionZ == 1)) {
      //int size = imp.getStackSize();
      for (int slice = 1; slice <= cz.timeStamps.NumberTimeStamps; slice++) {
        IJ.showStatus("MinMax: " + slice + "/"
            + cz.timeStamps.NumberTimeStamps);
        String s = IJ
            .d2s(
                cz.timeStamps.TimeStamps[slice - 1],
                2)
            + " s";
        ip = stack.getProcessor(slice);
        ip.setFont(font);
        float[] hsb = Color.RGBtoHSB(c.getRed(), c.getGreen(), c
            .getBlue(), null);
        ip.setColor(Color.getHSBColor(255, 255, 255 - hsb[2]));
        ip.moveTo(x, y);
        ip.drawString(s);
      }

    } else if ((cz.DimensionTime != 1)
        && (cz.DimensionZ != 1)) {
      for (int slicet = 1; slicet <= cz.DimensionTime; slicet++) {
        IJ.showStatus("MinMax: " + slicet + "/"
            + cz.DimensionTime);
        String s = IJ.d2s(
            cz.timeStamps.TimeStamps[slicet - 1],
            2)
            + " s";
        for (int slicez = 1; slicez <= cz.DimensionZ; slicez++) {
          ip = stack
              .getProcessor((int) cz.DimensionZ
                  * (slicet - 1) + slicez);
          ip.setFont(font);
          float[] hsb = Color.RGBtoHSB(c.getRed(), c.getGreen(), c
              .getBlue(), null);
View Full Code Here

    Rectangle roi = ip.getRoi();
    if (roi.width < ip.getWidth() || roi.height < ip.getHeight()) {
      x = roi.x;
      y = roi.y + roi.height;
    }
    ImageStack stack = imp.getStack();
    Font font = new Font("SansSerif", Font.PLAIN, 20);
    Color c = Toolbar.getForegroundColor();

    for (int slice = 1; slice <= stack.getSize(); slice++) {
      String s = IJ.d2s(channelWaveLength * 1000000000, 2) + " nm";
      ip = stack.getProcessor(slice);
      ip.setFont(font);
      float[] hsb = Color.RGBtoHSB(c.getRed(), c.getGreen(), c.getBlue(),
          null);
      ip.setColor(Color.getHSBColor(255, 255, 255 - hsb[2]));
      ip.moveTo(x, y);
View Full Code Here

            lsmFi.greens, lsmFi.blues);
      else
        cm = LookUpTable.createGrayscaleColorModel(lsmFi.whiteIsZero);

      if (!thumb)
        stacks[channelCount] = new ImageStack(
            (int) firstImDir.TIF_IMAGEWIDTH,
            (int) firstImDir.TIF_IMAGELENGTH, cm);
      else
        stacks[channelCount] = new ImageStack((int) cz.ThumbnailX,
            (int) cz.ThumbnailY, cm);
    }

    firstImDir = null;
    ImageReader reader = null;
View Full Code Here

            lsmFi.greens, lsmFi.blues);
      else
        cm = LookUpTable.createGrayscaleColorModel(lsmFi.whiteIsZero);

      if (!thumb)
        stacks[channelCount] = new ImageStack(
            (int) firstImDir.TIF_IMAGEWIDTH,
            (int) firstImDir.TIF_IMAGELENGTH, cm);
      else
        stacks[channelCount] = new ImageStack((int) cz.ThumbnailX,
            (int) cz.ThumbnailY, cm);
    }

    firstImDir = null;
    ImageReader reader = null;
View Full Code Here

    byte[] H = new byte[width*height];
    byte[] S = new byte[width*height];
    byte[] B = new byte[width*height];
    getHSB(H, S, B);
    ColorModel cm = getDefaultColorModel();
    ImageStack stack = new ImageStack(width, height, cm);
    stack.addSlice("Hue", H);
    stack.addSlice("Saturation", S);
    stack.addSlice("Brightness", B);
    return stack;
  }
View Full Code Here

TOP

Related Classes of ij.ImageStack

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.