How to load an overlay from java code

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to load an overlay from java code

Mohamed Tleis
Dear Members,

I have a saved image with an image overlay, and evidently the following
code wouldn't work because the ImagePlus seems not to hold the image
overlay in it.
Am I missing something, to load the overlay?

public static void main( String args[] )
    {
           ImagePlus imp = new ImagePlus("../overlay.tif");
           imp.show();
           Overlay ol = new Overlay();
           System.out.print(" Ol size: " + ol.size());
           ol = imp.getOverlay();
           System.out.print(" Ol size: " + ol.size());  // Null pointer
exception
    }

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html