ImagePlus[] imp = null;
RandomAccessFile file;
LsmFileInfo lsm;
try {
file = new RandomAccessFile(new File(directory, filename), "r");
RandomAccessStream stream = new RandomAccessStream(file);
lsm = new LsmFileInfo(masterModel);
lsm.fileName = filename;
lsm.directory = directory;
if (isLSMfile(stream)) {
// read first image directory
ImageDirectory imDir = readImageDirectoy(stream, 8, thumb);
lsm.imageDirectories.add(imDir);
while (imDir.OFFSET_NEXT_DIRECTORY != 0) {
imDir = readImageDirectoy(stream,
imDir.OFFSET_NEXT_DIRECTORY, thumb);
lsm.imageDirectories.add(imDir);
}
// printImDirData(lsm);
imp = open(stream, lsm, verbose, thumb);
stream.close();
if (showInfoFrames)
showEventList(lsm);
} else
IJ.error("Not a valid lsm file");
} catch (FileNotFoundException e) {