I saw the Import -> Oranthc under ImageJ and verified that it works there.
I would like to use it under Fiji and there it fails.
Looking at the source the call is made from
public BufferedImage ReadImage(String uri) throws IOException
{
// Ask the download of "image/png", otherwise an "image/jpeg" is negociated
return ImageIO.read(OpenStream(uri, "image/png"));
}
where uri works through
sun.net.www.protocol.http.HttpURLConnection$HttpInputStream
In ImageJ this calls to
package javax.imageio;
public static BufferedImage read(InputStream input) throws IOException {
if (input == null) {
throw new IllegalArgumentException("input == null!");
}
ImageInputStream stream = createImageInputStream(input);
BufferedImage bi = read(stream);
if (bi == null) {
stream.close();
}
return bi;
}
All goes through smoothly. Not so under Fiji. Instead an exception is thrown at
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: com.sun.media.imageioimpl.common.PackageUtil.isCodecLibAvailable()Z
at com.sun.media.imageioimpl.plugins.jpeg.CLibJPEGImageReaderSpi.onRegistration(CLibJPEGImageReaderSpi.java:109)
at javax.imageio.spi.SubRegistry.registerServiceProvider(ServiceRegistry.java:726)
at javax.imageio.spi.ServiceRegistry.registerServiceProvider(ServiceRegistry.java:307)
at javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(IIORegistry.java:211)
at javax.imageio.spi.IIORegistry.<init>(IIORegistry.java:138)
at javax.imageio.spi.IIORegistry.getDefaultInstance(IIORegistry.java:159)
at javax.imageio.ImageIO.<clinit>(ImageIO.java:66)
at com.orthancserver.OrthancConnection.ReadImage(OrthancConnection.java:197)
At line 197 (above) is the ReadImage call. It goes off the ImageIO.<clinit> and from there to never, never land.
From the javax documentation
Returns a BufferedImage as the result of decoding a supplied URL with an ImageReader chosen automatically from among those currently registered. An InputStream is obtained from the URL, which is wrapped in an ImageInputStream. If no registered ImageReader claims to be able to read the resulting stream, null is returned.
I'm not at all sure if I'm on the right track but could it be that
OpenStream(uri, "image/png")
is somehow not defined for image/png in Fiji, so that <clinit> doesn't know where to go?
I would very much like to use the plugin with Fiji if it is possible to do so.
Thanks,
Ilan