[ImageJ-devel] opening a tif file from a resource

Chris chris at gaiag.net
Tue Jan 15 23:50:37 CST 2013

I can open a jpeg file using 

        java.net.URL url;
        url = getClass().getResource(image.jpg);
        java.awt.Image image = Toolkit.getDefaultToolkit().getImage(url);
        imp = new ImagePlus("", image);
        if (imp != null) {

but this will not work for a tiff image.  My tiff image is a stack.  How can I open the tiff stack that is bundled in the resources folder of my jar file?

Thanks for any help.

Chris Coulon

Christopher Coulon, Ph.D.
The GAIA Group

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20130115/558b3e8d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-2.tiff
Type: image/tiff
Size: 132622 bytes
Desc: not available
URL: <http://imagej.net/pipermail/imagej-devel/attachments/20130115/558b3e8d/attachment-0001.tiff>

More information about the ImageJ-devel mailing list