LSM MDB and LOCI
Posted by suendermann on Jan 07, 2010; 10:31am
URL: http://imagej.273.s1.nabble.com/LSM-MDB-and-LOCI-tp3689815.html
Dear Users,
I'm writing a plugin, which uses loci-tools.jar to open lsm image files.
The lsm files (z-stacks) belong to a timeseries, where every timepoint
is stored in a separate file. Additionally, every series has its own mdb
file. Now I found the following strange behavior: If I open any lsm file
via the loci-tools (code see below) it always opens the first timepoint
in the series. If I delete the mdb file, the file I choosed will be opened.
Deleting the mdb file is not my method of choice, so my question is: How
can I program a workaroud (on plugin basis)?
Greetings
Fred
I use ImageJ 1.42k
Java jdk 1.6.0_16
loci-tools revision 5626
code:
private ImagePlus openWithLOCI(String fName){
ImagePlusReader r = new ImagePlusReader(new
ChannelSeparator(ImagePlusReader.makeImageReader()));
try {
r.setId(fName);
IJ.showStatus("opening "+fName);
int num = r.getImageCount();
int w = r.getSizeX();
int h = r.getSizeY();
ImageStack stack = new ImageStack(w,h);
IJ.showStatus("opening...");
for (int i=0;i<num;i++){
IJ.showProgress(i, (num-1));
ImageProcessor lociIP = r.openProcessors(i)[0];
stack.addSlice(""+i, lociIP);
}
r.close();
IJ.showStatus("generating ImagePlus");
ImagePlus lociImp = new ImagePlus(fName,stack);
IJ.showStatus("");
return lociImp;
} catch (FormatException e){
IJ.error(e.getMessage());
return null;
} catch (IOException e){
IJ.error(e.getMessage());
return null;
}
}