Search in sources :

Example 51 with ImagePlus

use of ij.ImagePlus in project bioformats by openmicroscopy.

the class ImporterTest method defaultBehaviorTester.

// ******** specific testers  **********************************
/**
 * tests BioFormats when directly calling BF.openImagePlus(path) (no options set)
 */
private void defaultBehaviorTester(int pixType, int x, int y, int z, int c, int t) {
    String path = constructFakeFilename("default", pixType, x, y, z, c, t, -1, false, -1, false, -1);
    ImagePlus[] imps = null;
    try {
        imps = BF.openImagePlus(path);
    } catch (IOException e) {
        fail(e.getMessage());
    } catch (FormatException e) {
        fail(e.getMessage());
    }
    impsCountTest(imps, 1);
    ImagePlus imp = imps[0];
    xyzctTest(imp, x, y, z, c, t);
}
Also used : IOException(java.io.IOException) ImagePlus(ij.ImagePlus) FormatException(loci.formats.FormatException)

Example 52 with ImagePlus

use of ij.ImagePlus in project bioformats by openmicroscopy.

the class Simple_Read method run.

public void run(String arg) {
    OpenDialog od = new OpenDialog("Open Image File...", arg);
    String dir = od.getDirectory();
    String name = od.getFileName();
    String id = dir + name;
    try {
        ImagePlus[] imps = BF.openImagePlus(id);
        for (ImagePlus imp : imps) imp.show();
    } catch (FormatException exc) {
        IJ.error("Sorry, an error occurred: " + exc.getMessage());
    } catch (IOException exc) {
        IJ.error("Sorry, an error occurred: " + exc.getMessage());
    }
}
Also used : IOException(java.io.IOException) ImagePlus(ij.ImagePlus) FormatException(loci.formats.FormatException) OpenDialog(ij.io.OpenDialog)

Example 53 with ImagePlus

use of ij.ImagePlus in project bioformats by openmicroscopy.

the class ROIHandler method readFromOverlays.

/**
 * Returns rois if any from the overlay.
 * @return See above
 */
public static Roi[] readFromOverlays() {
    ImagePlus image = IJ.getImage();
    Overlay overlay = image.getOverlay();
    if (overlay == null)
        return null;
    return overlay.toArray();
}
Also used : Overlay(ij.gui.Overlay) ImagePlus(ij.ImagePlus)

Example 54 with ImagePlus

use of ij.ImagePlus in project bioformats by openmicroscopy.

the class LociFunctions method openImagePlus.

public void openImagePlus(String path) {
    ImagePlus[] imps = null;
    try {
        ImporterOptions options = new ImporterOptions();
        options.setId(path);
        options.setSeriesOn(series, true);
        imps = BF.openImagePlus(options);
        for (ImagePlus imp : imps) imp.show();
    } catch (IOException exc) {
        IJ.handleException(exc);
    } catch (FormatException exc) {
        IJ.handleException(exc);
    }
}
Also used : ImporterOptions(loci.plugins.in.ImporterOptions) IOException(java.io.IOException) ImagePlus(ij.ImagePlus) FormatException(loci.formats.FormatException)

Example 55 with ImagePlus

use of ij.ImagePlus in project bioformats by openmicroscopy.

the class LociFunctions method openThumbImagePlus.

public void openThumbImagePlus(String path) {
    ImagePlus[] imps = null;
    try {
        ImporterOptions options = new ImporterOptions();
        options.setId(path);
        options.setSeriesOn(series, true);
        imps = BF.openThumbImagePlus(options);
        for (ImagePlus imp : imps) imp.show();
    } catch (IOException exc) {
        IJ.handleException(exc);
    } catch (FormatException exc) {
        IJ.handleException(exc);
    }
}
Also used : ImporterOptions(loci.plugins.in.ImporterOptions) IOException(java.io.IOException) ImagePlus(ij.ImagePlus) FormatException(loci.formats.FormatException)

Aggregations

ImagePlus (ij.ImagePlus)363 ImageStack (ij.ImageStack)85 ImageProcessor (ij.process.ImageProcessor)74 Rectangle (java.awt.Rectangle)60 ArrayList (java.util.ArrayList)46 IOException (java.io.IOException)40 File (java.io.File)36 Roi (ij.gui.Roi)32 Point (java.awt.Point)32 ByteProcessor (ij.process.ByteProcessor)29 FormatException (loci.formats.FormatException)29 GenericDialog (ij.gui.GenericDialog)27 Calibration (ij.measure.Calibration)26 FloatProcessor (ij.process.FloatProcessor)22 Future (java.util.concurrent.Future)22 ExtendedGenericDialog (uk.ac.sussex.gdsc.core.ij.gui.ExtendedGenericDialog)22 LinkedList (java.util.LinkedList)21 ExecutorService (java.util.concurrent.ExecutorService)19 MemoryPeakResults (uk.ac.sussex.gdsc.smlm.results.MemoryPeakResults)19 PointRoi (ij.gui.PointRoi)17