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!