What is this error?

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

What is this error?

Gabriel Landini
Can somebody suggest what might be the error below?

I got this intermittently while using the Auto Local Threshold with the
Bernsen method.
It happened twice after so many images are processed, but the images seem to
be segmented correctly anyway.

Thanks

Gabriel


Exception in thread "Run$_AWT-EventQueue-0" java.lang.NullPointerException
        at
java.awt.image.IndexColorModel.isCompatibleRaster(IndexColorModel.java:1324)
        at java.awt.image.BufferedImage.<init>(BufferedImage.java:610)
        at
ij.process.ByteProcessor.createBufferedImage(ByteProcessor.java:103)
        at ij.process.ByteProcessor.createImage(ByteProcessor.java:82)
        at ij.ImagePlus.updateImage(ImagePlus.java:309)
        at ij.gui.ImageCanvas.paint(ImageCanvas.java:135)
        at ij.gui.ImageCanvas.update(ImageCanvas.java:122)
        at sun.awt.RepaintArea.updateComponent(RepaintArea.java:239)
        at sun.awt.X11.XRepaintArea.updateComponent(XRepaintArea.java:43)
        at sun.awt.RepaintArea.paint(RepaintArea.java:216)
        at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:688)
        at java.awt.Component.dispatchEventImpl(Component.java:4659)
        at java.awt.Component.dispatchEvent(Component.java:4413)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
        at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
        at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
        at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
 - - - - -
Reply | Threaded
Open this post in threaded view
|

Re: What is this error?

Colin Poczatek
I could be wrong...
But it looks like something I've seen in parts of our plugin that redraw
a lot. But there's some race condition to get it to happen. It does seem
fairly innocuous though since if it causes any "real" error, doing
anything to redraw the image (eg changing slice) fixes it. I'll see if I
have the print of the exception anywhere. BTW this happens for me with
ij 1.42o and java 1.6.0_11

Collin

Gabriel Landini wrote:

> Can somebody suggest what might be the error below?
>
> I got this intermittently while using the Auto Local Threshold with the
> Bernsen method.
> It happened twice after so many images are processed, but the images seem to
> be segmented correctly anyway.
>
> Thanks
>
> Gabriel
>
>
> Exception in thread "Run$_AWT-EventQueue-0" java.lang.NullPointerException
>         at
> java.awt.image.IndexColorModel.isCompatibleRaster(IndexColorModel.java:1324)
>         at java.awt.image.BufferedImage.<init>(BufferedImage.java:610)
>         at
> ij.process.ByteProcessor.createBufferedImage(ByteProcessor.java:103)
>         at ij.process.ByteProcessor.createImage(ByteProcessor.java:82)
>         at ij.ImagePlus.updateImage(ImagePlus.java:309)
>         at ij.gui.ImageCanvas.paint(ImageCanvas.java:135)
>         at ij.gui.ImageCanvas.update(ImageCanvas.java:122)
>         at sun.awt.RepaintArea.updateComponent(RepaintArea.java:239)
>         at sun.awt.X11.XRepaintArea.updateComponent(XRepaintArea.java:43)
>         at sun.awt.RepaintArea.paint(RepaintArea.java:216)
>         at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:688)
>         at java.awt.Component.dispatchEventImpl(Component.java:4659)
>         at java.awt.Component.dispatchEvent(Component.java:4413)
>         at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
>         at
> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
>         at
> java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
>         at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
>         at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
>         at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
>  - - - - -
>  



The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.
Reply | Threaded
Open this post in threaded view
|

Re: What is this error?

Albert Cardona
In reply to this post by Gabriel Landini
Gabriel,

>  Can somebody suggest what might be the error below?
>
>  I got this intermittently while using the Auto Local Threshold with the
>  Bernsen method.
>  It happened twice after so many images are processed, but the images
seem to
>  be segmented correctly anyway.



The 'cm' pointer is null, and thus the constructor for the BufferedImage
fails when it tries to call

     if (!cm.isCompatibleRaster(raster)) {


... at line BufferedImage.java:610


The reason why the plugin execution doesn't fail: the repaint (or other)
method fails and it gets called again, and then it succeeds because the
'cm' pointer is no longer null.

How can 'cm' be null? Only when using the ByteProcessor(int, int, int[],
ColorModel) can cm be null, if the 4rth argument is null. If then one
calls getBufferedImage() directly, without calling first createImage()
(that will set cm to not null), you may get this error.

Albert

--
Albert Cardona
http://albert.rierol.net
Reply | Threaded
Open this post in threaded view
|

Re: What is this error?

Gabriel Landini
In reply to this post by Colin Poczatek
Thank you Colin and Albert for the explanations.
I wonder if this error is more likely to happen in multicore machines (the two
I tried were so).

Cheers,

Gabriel