Issue Loading .jp2 Files in ImageJ/Fiji

Hello,

I’m trying to analyze a set of images for my lab, but I’ve been running into a lot of issues with using ImageJ to import the images. The files are .jp2, but I read that the BioFormats plug-in for ImageJ or Fiji would be able to open .jp2 files.

I first downloaded the BioFormats plug-in and integrated it into my ImageJ program. However, I got this error message when I tried to run BioFormats:

ImageJ 1.50i; Java 1.6.0_65 [64-bit]; Mac OS X 10.11.6; 11MB of 3000MB (<1%)
 
java.lang.UnsupportedClassVersionError: loci/plugins/LociImporter : Unsupported major.minor version 51.0
 
This plugin requires Java 1.7 or later.

I checked the Java on my Mac, and I’m using the most updated version of Java. So I don’t know what is happening.

I decided to download Fiji instead. When I tried to open the .jp2 files in Fiji, however, I would get this error message:

(Fiji Is Just) ImageJ 2.0.0-rc-61/1.51n; Java 1.8.0_66 [64-bit]; Mac OS X 10.11.6; 1480MB of 4966MB (29%)
 
java.lang.IllegalArgumentException: Dimensions (width=98688 height=46416) are too large
	at java.awt.image.SampleModel.<init>(SampleModel.java:130)
	at java.awt.image.ComponentSampleModel.<init>(ComponentSampleModel.java:146)
	at java.awt.image.PixelInterleavedSampleModel.<init>(PixelInterleavedSampleModel.java:87)
	at java.awt.image.PixelInterleavedSampleModel.createCompatibleSampleModel(PixelInterleavedSampleModel.java:144)
	at com.sun.media.imageioimpl.plugins.jpeg2000.J2KReadState.readAsRaster(J2KReadState.java:429)
	at com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReader.readRaster(J2KImageReader.java:556)
	at loci.formats.services.JAIIIOServiceImpl.readRaster(JAIIIOServiceImpl.java:177)
	at loci.formats.codec.JPEG2000Codec.decompress(JPEG2000Codec.java:296)
	at loci.formats.codec.JPEG2000Codec.decompress(JPEG2000Codec.java:267)
	at loci.formats.in.JPEG2000Reader.openBytes(JPEG2000Reader.java:182)
	at loci.formats.ChannelFiller.openBytes(ChannelFiller.java:156)
	at loci.formats.ChannelFiller.openBytes(ChannelFiller.java:148)
	at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:198)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:348)
	at loci.formats.DimensionSwapper.openBytes(DimensionSwapper.java:249)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:348)
	at loci.formats.MinMaxCalculator.openBytes(MinMaxCalculator.java:269)
	at loci.formats.MinMaxCalculator.openBytes(MinMaxCalculator.java:260)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:334)
	at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:334)
	at loci.plugins.util.ImageProcessorReader.openProcessors(ImageProcessorReader.java:186)
	at loci.plugins.in.ImagePlusReader.readProcessors(ImagePlusReader.java:412)
	at loci.plugins.in.ImagePlusReader.readPlanes(ImagePlusReader.java:376)
	at loci.plugins.in.ImagePlusReader.readImage(ImagePlusReader.java:273)
	at loci.plugins.in.ImagePlusReader.readImages(ImagePlusReader.java:234)
	at loci.plugins.in.ImagePlusReader.readImages(ImagePlusReader.java:212)
	at loci.plugins.in.ImagePlusReader.openImagePlus(ImagePlusReader.java:107)
	at loci.plugins.in.Importer.readPixels(Importer.java:149)
	at loci.plugins.in.Importer.run(Importer.java:86)
	at loci.plugins.LociImporter.run(LociImporter.java:78)
	at ij.IJ.runUserPlugIn(IJ.java:217)
	at ij.IJ.runPlugIn(IJ.java:181)
	at ij.IJ.runPlugIn(IJ.java:170)
	at HandleExtraFileTypes.openImage(HandleExtraFileTypes.java:499)
	at HandleExtraFileTypes.run(HandleExtraFileTypes.java:72)
	at ij.IJ.runUserPlugIn(IJ.java:217)
	at ij.IJ.runPlugIn(IJ.java:181)
	at ij.IJ.runPlugIn(IJ.java:170)
	at ij.io.Opener.openWithHandleExtraFileTypes(Opener.java:515)
	at ij.io.Opener.openImage(Opener.java:369)
	at ij.io.Opener.openImage(Opener.java:243)
	at ij.io.Opener.open(Opener.java:110)
	at ij.io.Opener.open(Opener.java:73)
	at ij.plugin.Commands.run(Commands.java:27)
	at ij.IJ.runPlugIn(IJ.java:187)
	at ij.Executer.runCommand(Executer.java:137)
	at ij.Executer.run(Executer.java:66)
	at java.lang.Thread.run(Thread.java:745)</i>

The .jp2 files are rather big (typically ranging from 100-600 MB), but I did adjust the maximum file size in Fiji to be much bigger than the size of the .jp2 files (I adjusted Maximum Memory in Memory & Threads to around 5000 MB). I don’t know what to do, because I need to use ImageJ’s Color Deconvolution plug-in to analyze these images, but they just won’t load no matter how much I try to fiddle with everything. Would anyone have any advice about how to deal with this issue?

Thanks in advance!

Dear @hhdl,

Depending on which version you download, ImageJ (as well as Fiji) usually comes with a bundled Java that is used for running ImageJ.

Could you please report this issue to the Bio-Formats team as well? That’s your best chance of getting this issue fixed.

Best,
Stefan

1 Like