JP2 memory limit?

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

JP2 memory limit?

Anda Cornea
Hello!

I am trying to open jp2 images of 20-30MB and get the error message below.  I can open tiffs of 100MB and more.  I can open jp2 of 2-5MB.  This is true on a 64 bit just updated to latest ImageJ (Maximum memory 4000 and 4 parallel threads) and LOCI, and on my regular 32 bit 1.44p(Maximum memory 618 MB and 2 parallel threads, from which I copy the message.

java.lang.OutOfMemoryError: Java heap space
                at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:58)
                at java.awt.image.ComponentSampleModel.createDataBuffer(ComponentSampleModel.java:397)
                at java.awt.image.Raster.createWritableRaster(Raster.java:938)
                at com.sun.media.imageioimpl.plugins.jpeg2000.J2KReadState.readBufferedImage(J2KReadState.java:371)
                at com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReader.read(J2KImageReader.java:454)
                at javax.imageio.ImageReader.read(ImageReader.java:923)
                at loci.formats.services.JAIIIOServiceImpl.readImage(JAIIIOServiceImpl.java:121)
                at loci.formats.codec.JPEG2000Codec.decompress(JPEG2000Codec.java:184)
                at loci.formats.in.NativeND2Reader.openBytes(NativeND2Reader.java:209)
                at loci.formats.DelegateReader.openBytes(DelegateReader.java:184)
                at loci.formats.FormatReader.openBytes(FormatReader.java:739)
                at loci.formats.ChannelFiller.getLookupTableComponentCount(ChannelFiller.java:262)
                at loci.formats.ChannelFiller.setId(ChannelFiller.java:245)
                at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:480)
                at loci.formats.ChannelSeparator.setId(ChannelSeparator.java:238)
                at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:480)
                at loci.formats.DimensionSwapper.setId(DimensionSwapper.java:279)
                at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:480)
                at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:480)
                at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:480)
                at loci.plugins.in.ImportProcess.setId(ImportProcess.java:652)
                at loci.plugins.in.ImportProcess.initializeStack(ImportProcess.java:513)
                at loci.plugins.in.ImportProcess.execute(ImportProcess.java:142)
                at loci.plugins.in.Importer.showDialogs(Importer.java:125)
                at loci.plugins.in.Importer.run(Importer.java:77)
                at loci.plugins.LociImporter.run(LociImporter.java:77)
                at ij.IJ.runUserPlugIn(IJ.java:183)
                at ij.IJ.runPlugIn(IJ.java:150)
                at ij.IJ.runPlugIn(IJ.java:139)
                at HandleExtraFileTypes.openImage(HandleExtraFileTypes.java:243)
                at HandleExtraFileTypes.run(HandleExtraFileTypes.java:37)
                at ij.IJ.runUserPlugIn(IJ.java:183)

Any suggestions?

Anda Cornea, Ph.D.
Director of the Imaging and Morphology Core
Oregon National Primate Research Center
503-690-5293
Reply | Threaded
Open this post in threaded view
|

Re: JP2 memory limit?

Melissa Linkert-2
Hi Anda,

This error message indicates that the uncompressed size of the image
exceeds the amount of available memory or 2GB (whichever is smaller).
If the uncompressed size of the image is less than 2 GB, you can try
increasing the amount of memory allocated to ImageJ.

Otherwise, there is unfortunately no workaround at the moment.  We (the
Bio-Formats developers) are very aware that large JPEG and JPEG-2000 files
cannot be opened, and are working as hard as we can to find an acceptable
solution.  Unfortunately, it is not an easy problem to solve.

Note that if you have large images in other formats (e.g. TIFF, Aperio SVS, ...)
you can open them in sections by selecting the "Crop on import" option
in the "Bio-Formats Import Options" window.  This will not solve the
problem for JPEG or JPEG-2000 images, though.

Regards,
-Melissa

On Wed, Mar 02, 2011 at 12:26:12PM -0800, Anda Cornea wrote:

> Hello!
>
> I am trying to open jp2 images of 20-30MB and get the error message below.  I can open tiffs of 100MB and more.  I can open jp2 of 2-5MB.  This is true on a 64 bit just updated to latest ImageJ (Maximum memory 4000 and 4 parallel threads) and LOCI, and on my regular 32 bit 1.44p(Maximum memory 618 MB and 2 parallel threads, from which I copy the message.
>
> java.lang.OutOfMemoryError: Java heap space
>                 at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:58)
>                 at java.awt.image.ComponentSampleModel.createDataBuffer(ComponentSampleModel.java:397)
>                 at java.awt.image.Raster.createWritableRaster(Raster.java:938)
>                 at com.sun.media.imageioimpl.plugins.jpeg2000.J2KReadState.readBufferedImage(J2KReadState.java:371)
>                 at com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReader.read(J2KImageReader.java:454)
>                 at javax.imageio.ImageReader.read(ImageReader.java:923)
>                 at loci.formats.services.JAIIIOServiceImpl.readImage(JAIIIOServiceImpl.java:121)
>                 at loci.formats.codec.JPEG2000Codec.decompress(JPEG2000Codec.java:184)
>                 at loci.formats.in.NativeND2Reader.openBytes(NativeND2Reader.java:209)
>                 at loci.formats.DelegateReader.openBytes(DelegateReader.java:184)
>                 at loci.formats.FormatReader.openBytes(FormatReader.java:739)
>                 at loci.formats.ChannelFiller.getLookupTableComponentCount(ChannelFiller.java:262)
>                 at loci.formats.ChannelFiller.setId(ChannelFiller.java:245)
>                 at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:480)
>                 at loci.formats.ChannelSeparator.setId(ChannelSeparator.java:238)
>                 at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:480)
>                 at loci.formats.DimensionSwapper.setId(DimensionSwapper.java:279)
>                 at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:480)
>                 at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:480)
>                 at loci.formats.ReaderWrapper.setId(ReaderWrapper.java:480)
>                 at loci.plugins.in.ImportProcess.setId(ImportProcess.java:652)
>                 at loci.plugins.in.ImportProcess.initializeStack(ImportProcess.java:513)
>                 at loci.plugins.in.ImportProcess.execute(ImportProcess.java:142)
>                 at loci.plugins.in.Importer.showDialogs(Importer.java:125)
>                 at loci.plugins.in.Importer.run(Importer.java:77)
>                 at loci.plugins.LociImporter.run(LociImporter.java:77)
>                 at ij.IJ.runUserPlugIn(IJ.java:183)
>                 at ij.IJ.runPlugIn(IJ.java:150)
>                 at ij.IJ.runPlugIn(IJ.java:139)
>                 at HandleExtraFileTypes.openImage(HandleExtraFileTypes.java:243)
>                 at HandleExtraFileTypes.run(HandleExtraFileTypes.java:37)
>                 at ij.IJ.runUserPlugIn(IJ.java:183)
>
> Any suggestions?
>
> Anda Cornea, Ph.D.
> Director of the Imaging and Morphology Core
> Oregon National Primate Research Center
> 503-690-5293