Posted by
Albert Cardona on
May 21, 2009; 1:46pm
URL: http://imagej.273.s1.nabble.com/What-is-this-error-tp3692451p3692454.html
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