Page 1 of 1

opening .spl with matlab

PostPosted: Sun Oct 20, 2013 3:42 pm
by gradstudent
I posted something on Friday to one of these forums but it was deleted for some reason so I'm reposting. If you're going to delete this please tell me why so it won't happen again.

I'm trying to read the images out of a .spl file that was created using slidebook v4.2. Upon finding the matlab functions to read the file formats I was very excited but I ran into a problem when I tried to use the bfopen function. I used it successfully with one .spl file but I tried on another and I got an error. This is the text of the error I received.

I am using Matlab 2011b on a Mac with the image processing toolbox (and other toolboxes).

Code: Select all
I = bfopen('filename.spl');
Finding offsets to pixel data
Determining dimensions
Reading series #1
    .Error using loci.formats.ChannelSeparator/openBytes
Java exception occurred:
java.lang.IllegalArgumentException: Negative position
   at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:600)
   at
        loci.common.NIOByteBufferProvider.allocateDirect(NIOByteBufferProvider.java:133)
   at loci.common.NIOByteBufferProvider.allocate(NIOByteBufferProvider.java:118)
   at loci.common.NIOFileHandle.buffer(NIOFileHandle.java:532)
   at loci.common.NIOFileHandle.seek(NIOFileHandle.java:254)
   at loci.common.RandomAccessInputStream.seek(RandomAccessInputStream.java:140)
   at loci.formats.in.SlidebookReader.openBytes(SlidebookReader.java:130)
   at loci.formats.ImageReader.openBytes(ImageReader.java:414)
   at loci.formats.ChannelFiller.openBytes(ChannelFiller.java:197)
   at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:226)
   at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:159)

Error in bfGetPlane (line 75)
plane = r.openBytes(iPlane - 1, ip.Results.x - 1, ip.Results.y - 1, ...

Error in bfopen (line 144)
        arr = bfGetPlane(r, i, varargin{:});



Any advice you guys could give me on how to circumvent this error would be great.

Thanks!

Re: opening .spl with matlab

PostPosted: Sun Oct 20, 2013 6:50 pm
by sbesson
Hi,

Could you please confirm that you are using the most recent version of Bio-Formats (4.4.9)? Using MATLAB, the version number should be given by

Code: Select all
char(loci.formats.FormatTools.VERSION)


If upgrading does not solve the problem, then could you please send one of the SlideBook files that causes this error message so that we can better fix the problem? You can upload the file to:

http://qa.openmicroscopy.org.uk/qa/upload/

Best regards,
Sébastien

Re: opening .spl with matlab

PostPosted: Sun Oct 20, 2013 7:17 pm
by gradstudent
Yes it should be the latest version. I downloaded it on Wednesday. I can try to upload some files tomorrow

Re: opening .spl with matlab

PostPosted: Mon Oct 21, 2013 5:57 pm
by gradstudent
Yes I am using the latest version.

I tried some more files today and I think that the problem might be with files over a certain size. bfopen seems to work with smaller files but not with the larger files I've tried.

I can't upload the files because '.spl' is not in the list of file types to upload. Do you want me to change the extension?

Edit: I tried reading some of the files that give me an error in Matlab into FIJI/ImageJ to see if it is just a matlab problem. This is the error I got:

Code: Select all
(Fiji Is Just) ImageJ 1.48c; Java 1.6.0_51 [64-bit]; Mac OS X 10.8.4; 29MB of 8163MB (<1%)

java.lang.IllegalArgumentException: Negative position
   at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:600)
   at loci.common.NIOByteBufferProvider.allocateDirect(NIOByteBufferProvider.java:133)
   at loci.common.NIOByteBufferProvider.allocate(NIOByteBufferProvider.java:118)
   at loci.common.NIOFileHandle.buffer(NIOFileHandle.java:532)
   at loci.common.NIOFileHandle.seek(NIOFileHandle.java:254)
   at loci.common.RandomAccessInputStream.seek(RandomAccessInputStream.java:140)
   at loci.formats.in.SlidebookReader.openBytes(SlidebookReader.java:129)
   at loci.formats.ChannelFiller.openBytes(ChannelFiller.java:197)
   at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:226)
   at loci.formats.ChannelSeparator.openBytes(ChannelSeparator.java:159)
   at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:305)
   at loci.formats.DimensionSwapper.openBytes(DimensionSwapper.java:248)
   at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:305)
   at loci.formats.ReaderWrapper.openBytes(ReaderWrapper.java:305)
   at loci.plugins.util.ImageProcessorReader.openProcessors(ImageProcessorReader.java:190)
   at loci.plugins.util.ImageProcessorReader.openProcessors(ImageProcessorReader.java:87)
   at loci.plugins.util.ImageProcessorSource.getObject(ImageProcessorSource.java:74)
   at loci.formats.cache.Cache.recache(Cache.java:212)
   at loci.formats.cache.Cache.recache(Cache.java:232)
   at loci.formats.cache.Cache.<init>(Cache.java:96)
   at loci.plugins.util.BFVirtualStack.<init>(BFVirtualStack.java:123)
   at loci.plugins.in.ImagePlusReader.createVirtualStack(ImagePlusReader.java:331)
   at loci.plugins.in.ImagePlusReader.readImage(ImagePlusReader.java:276)
   at loci.plugins.in.ImagePlusReader.readImages(ImagePlusReader.java:238)
   at loci.plugins.in.ImagePlusReader.readImages(ImagePlusReader.java:216)
   at loci.plugins.in.ImagePlusReader.openImagePlus(ImagePlusReader.java:114)
   at loci.plugins.in.Importer.readPixels(Importer.java:150)
   at loci.plugins.in.Importer.run(Importer.java:89)
   at loci.plugins.LociImporter.run(LociImporter.java:81)
   at ij.IJ.runUserPlugIn(IJ.java:196)
   at ij.IJ.runPlugIn(IJ.java:160)
   at ij.Executer.runCommand(Executer.java:131)
   at ij.Executer.run(Executer.java:64)
   at java.lang.Thread.run(Thread.java:680)

Re: opening .spl with matlab

PostPosted: Mon Oct 21, 2013 7:05 pm
by sbesson
Hi,

Thanks for the Fiji stack trace. The similarity with the error you get in Matlab suggests the problem comes from the reader itself.

You should be able to first zip your file and upload the zip file to the http://qa.openmicroscopy.org.uk/qa/upload/

Let me know if this does not work,
Sebastien

Re: opening .spl with matlab

PostPosted: Mon Oct 21, 2013 9:19 pm
by gradstudent
I uploaded it but I'm not sure that it went through. Let me know if I need to upload it again

Re: opening .spl with matlab

PostPosted: Tue Oct 22, 2013 3:33 pm
by mlinkert
Thank you for uploading a file - the upload was successful, so there is no need to do it again.

I have opened a ticket on our issue tracking system to resolve this problem:

https://trac.openmicroscopy.org.uk/ome/ticket/11560

You have been CC'd on the ticket, and so will receive an automated email with "[OME] #11560" in the subject line each time the ticket is updated. If you would prefer not to receive these emails, please let me know.

-Melissa

Re: opening .spl with matlab

PostPosted: Tue Oct 22, 2013 4:14 pm
by gradstudent
Thanks so much! Do you have any idea on the timeline for when this bug will be fixed?

Re: opening .spl with matlab

PostPosted: Wed Oct 23, 2013 12:21 am
by mlinkert
Not at the moment, but the ticket will be updated as soon as we have an estimated timeline.