use of loci.plugins.in.ImporterOptions in project bioformats by openmicroscopy.
the class LociFunctions method openImagePlus.
public void openImagePlus(String path) {
ImagePlus[] imps = null;
try {
ImporterOptions options = new ImporterOptions();
options.setId(path);
options.setSeriesOn(series, true);
imps = BF.openImagePlus(options);
for (ImagePlus imp : imps) imp.show();
} catch (IOException exc) {
IJ.handleException(exc);
} catch (FormatException exc) {
IJ.handleException(exc);
}
}
use of loci.plugins.in.ImporterOptions in project bioformats by openmicroscopy.
the class LociFunctions method openThumbImagePlus.
public void openThumbImagePlus(String path) {
ImagePlus[] imps = null;
try {
ImporterOptions options = new ImporterOptions();
options.setId(path);
options.setSeriesOn(series, true);
imps = BF.openThumbImagePlus(options);
for (ImagePlus imp : imps) imp.show();
} catch (IOException exc) {
IJ.handleException(exc);
} catch (FormatException exc) {
IJ.handleException(exc);
}
}
use of loci.plugins.in.ImporterOptions in project bioformats by openmicroscopy.
the class LociFunctions method openThumbImage.
public void openThumbImage(String title, Double no) throws FormatException, IOException {
ImporterOptions options = new ImporterOptions();
options.setWindowless(true);
options.setId(r.getCurrentFile());
options.setCrop(true);
options.setSpecifyRanges(true);
options.setSeriesOn(r.getSeries(), true);
int[] zct = r.getZCTCoords(no.intValue());
options.setCBegin(r.getSeries(), zct[1]);
options.setZBegin(r.getSeries(), zct[0]);
options.setTBegin(r.getSeries(), zct[2]);
options.setCEnd(r.getSeries(), zct[1]);
options.setZEnd(r.getSeries(), zct[0]);
options.setTEnd(r.getSeries(), zct[2]);
ImportProcess process = new ImportProcess(options);
process.execute();
ImagePlusReader reader = new ImagePlusReader(process);
final ImagePlus imp = reader.openThumbImagePlus()[0];
Calibrator calibrator = new Calibrator(process);
calibrator.applyCalibration(imp);
process.getReader().close();
imp.show();
}
use of loci.plugins.in.ImporterOptions in project bioformats by openmicroscopy.
the class LociFunctions method openSubImage.
public void openSubImage(String title, Double no, Double x, Double y, Double w, Double h) throws FormatException, IOException {
ImporterOptions options = new ImporterOptions();
options.setWindowless(true);
options.setId(r.getCurrentFile());
options.setCrop(true);
options.setSpecifyRanges(true);
options.setSeriesOn(r.getSeries(), true);
int[] zct = r.getZCTCoords(no.intValue());
options.setCBegin(r.getSeries(), zct[1]);
options.setZBegin(r.getSeries(), zct[0]);
options.setTBegin(r.getSeries(), zct[2]);
options.setCEnd(r.getSeries(), zct[1]);
options.setZEnd(r.getSeries(), zct[0]);
options.setTEnd(r.getSeries(), zct[2]);
Region region = new Region(x.intValue(), y.intValue(), w.intValue(), h.intValue());
options.setCropRegion(r.getSeries(), region);
ImportProcess process = new ImportProcess(options);
process.execute();
ImagePlusReader reader = new ImagePlusReader(process);
final ImagePlus imp = reader.openImagePlus()[0];
Calibrator calibrator = new Calibrator(process);
calibrator.applyCalibration(imp);
process.getReader().close();
imp.show();
}
use of loci.plugins.in.ImporterOptions in project bioformats by openmicroscopy.
the class BF method openThumbImagePlus.
public static ImagePlus[] openThumbImagePlus(String path) throws FormatException, IOException {
ImporterOptions options = new ImporterOptions();
options.setId(path);
return openThumbImagePlus(options);
}
Aggregations