Package ij

Examples of ij.ImagePlus


   * ConvolveG constructor
   * creates ImagePlus and ImageProcessor.
   */
  public ConvolveG() {
    try {
      imp = new ImagePlus(CoreInterface.getFile().getAbsolutePath());
      imgpr = imp.getProcessor();
    } catch (NullPointerException npe) {
      npe.printStackTrace();
      throw npe;
    }
View Full Code Here


        }
        if (!canceled)
            postProcess(ip1);
        if (debug) {
            movie.addSlice("Post-processed", ip1.duplicate());
            new ImagePlus("The movie", movie).show();
        }
    }
View Full Code Here

      }
    });
  }

  public Vector getImageGroupIDs(int idBelongingtoGroup) {
    ImagePlus imp = WindowManager.getImage(idBelongingtoGroup);
    int[] ids = WindowManager.getIDList();
    LsmFileInfo fi = (LsmFileInfo) imp.getOriginalFileInfo();
    Vector v = new Vector();
    for (int i = 0; i < ids.length; i++) {
      if (imp.getOriginalFileInfo() instanceof LsmFileInfo) {
        LsmFileInfo lsmFI = (LsmFileInfo) (WindowManager
            .getImage(ids[i]).getOriginalFileInfo());
        if (fi.equals(lsmFI))
          v.add(new Integer(ids[i]));
      }
View Full Code Here

        if (impTab[i].getImageStackSize() > 1)
          for (int j = 1; j <= impTab[i].getImageStackSize(); j++) {
            String title = lsm.fileName+" - "+cz.channelNamesAndColors.ChannelNames[i]
                + " - " + new Integer(j).toString();
            save(new ImagePlus(title, impTab[i].getImageStack()
                .getProcessor(j)), finalDir, format, title);
          }
        else {
            String title = lsm.fileName+" - "+cz.channelNamesAndColors.ChannelNames[i];
            save(new ImagePlus(title, impTab[i].getImageStack().getProcessor(1)), finalDir, format, title);
        }
      }
    }
  }
View Full Code Here

  private void updateShowInfo() {
    int ids[] = WindowManager.getIDList();
    if (ids != null) {
      for (int i = 0; i < ids.length; i++) {
        ImagePlus imp = WindowManager.getImage(ids[0]);
        if (imp.getOriginalFileInfo() instanceof LsmFileInfo)
          showInfoButton.setEnabled(true);
        else {
          showInfoButton.setEnabled(false);
        }
      }
View Full Code Here

          for (int i = 0; i < imageVals.length; i++) {
            Vector v = id.getImageGroupIDs(imageVals[i]);

            for (int j = 0; j < v.size(); j++) {

              ImagePlus imp = WindowManager.getImage(((Integer) v
                  .get(j)).intValue());
              LsmFileInfo openLSM = (LsmFileInfo) imp
                  .getOriginalFileInfo();
              CZ_LSMInfo cz = (CZ_LSMInfo) ((ImageDirectory) openLSM.imageDirectories
                  .get(0)).TIF_CZ_LSMINFO;
              Recording r = (Recording) cz.scanInfo.recordings.get(0);
              double planeSpacing = ((Double) r.records.get("PLANE SPACING")).doubleValue();
              if (choice.equals("Dump to textfile")) {
                String twstr = new String("");
                double ps = 0;
                for (int k = 1; i <= cz.DimensionZ; k++) {
                  String s = IJ.d2s(ps, 2) + " "+MasterModel.micrometer;
                  ps += planeSpacing; // moved from line -2
                  twstr = twstr + s + "\n";
                }
                new TextWindow("Z-stamps", "Z-stamps", twstr,
                    200, 400);

              } else {
                applyZSTAMP(imp, (LsmFileInfo) imp
                    .getOriginalFileInfo());
              }
            }
          }
        }
View Full Code Here

          for (int i = 0; i < imageVals.length; i++) {
            Vector v = id.getImageGroupIDs(imageVals[i]);

            for (int j = 0; j < v.size(); j++) {

              ImagePlus imp = WindowManager.getImage(((Integer) v
                  .get(j)).intValue());
              LsmFileInfo openLSM = (LsmFileInfo) imp
                  .getOriginalFileInfo();
              CZ_LSMInfo cz = (CZ_LSMInfo) ((ImageDirectory) openLSM.imageDirectories
                  .get(0)).TIF_CZ_LSMINFO;
              if (choice.equals("Dump to textfile")) {
                String twstr = new String("");
                for (int k = 0; k < cz.timeStamps.NumberTimeStamps; k++)
                  twstr = twstr
                      + Double
                          .toString(masterModel
                              .getCz().timeStamps.TimeStamps[k])
                      + "\n";
                new TextWindow("Timestamps", "Timestamps",
                    twstr, 200, 400);
              } else {
                applyTSTAMP(imp, (LsmFileInfo) imp
                    .getOriginalFileInfo());
              }
            }
          }
        }
View Full Code Here

          for (int i = 0; i < imageVals.length; i++) {
            Vector v = id.getImageGroupIDs(imageVals[i]);

            for (int j = 0; j < v.size(); j++) {

              ImagePlus imp = WindowManager.getImage(((Integer) v
                  .get(j)).intValue());
              LsmFileInfo openLSM = (LsmFileInfo) imp
                  .getOriginalFileInfo();
              CZ_LSMInfo cz = (CZ_LSMInfo) ((ImageDirectory) openLSM.imageDirectories
                  .get(0)).TIF_CZ_LSMINFO;

              if (cz.SpectralScan != 1) {
                IJ
                    .error("Image not issued from spectral scan. Lambda stamp obsolete!");
                return;
              }

              if (choice.equals("Dump to textfile")) {
                String twstr = new String("");
                for (int k = 0; k < cz.channelWavelength.Channels; k++)
                  twstr = twstr
                      + Double
                          .toString(cz.channelWavelength.LambdaStamps[k])
                      + "\n";

                new TextWindow("Lambdastamps", "Lambdastamps",
                    twstr, 200, 400);

              } else {
                applyLSTAMP(imp, (LsmFileInfo) imp
                    .getOriginalFileInfo(),
                    cz.channelWavelength.LambdaStamps[j]);
              }
            }
          }
View Full Code Here

        try {

            RandomAccessStream stream = new RandomAccessStream(
                    new RandomAccessFile(file, "r"));
            if (reader.isLSMfile(stream)) {
                ImagePlus imp[] = reader.open(file.getParent(), file.getName(), false, false, true);
                if (imp != null && imp.length>0)
                    tmpIcon = new ImageIcon(imp[0].getImage());
                else {
                    thumbnail = null;
                    return;
View Full Code Here

            File f = new File(dir1+list[i]);
            if (!f.isDirectory()) {
                Reader reader = new Reader(masterModel);
                ImagePlus [] impTab = reader.open(dir1, list[i],false,false,false);
                for (int k=0; k<impTab.length; k++){
                    ImagePlus img = impTab[k];
                    if (img!=null) {
                        img = process(img);
                        if (img!=null){
                            if (img.getStackSize() != 1) {
                                for (int slice=0; slice<img.getStackSize(); slice++){
                                    img.setSlice(slice);
                                    ImageProcessor ip = img.getProcessor();
                                    ImageProcessor newip = ip.createProcessor(ip.getWidth(),ip.getHeight());
                                    newip.setPixels(ip.getPixelsCopy());
                                    String slicename = img.getTitle();
                                    slicename +=("_slice");
                                    String numb = IJ.d2s(slice,0);
                                    slicename += "_"+numb;
                                    ImagePlus img2 = new ImagePlus(slicename, newip);
                                    save(img2, dir2, format, k);
                                    slicename ="";
                                    numb ="";
                                }
                            } else save(img, dir2, format, k);
View Full Code Here

TOP

Related Classes of ij.ImagePlus

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.