use of loci.common.services.DependencyException in project digilib by robcast.
the class BioFormatsDocuImage method loadImage.
@Override
public void loadImage(ImageInput ii) throws FileOpException {
logger.debug("loadImage: " + ii);
this.input = ii;
reader = new ImageReader();
try {
// construct the object that stores OME-XML metadata
ServiceFactory factory = new ServiceFactory();
OMEXMLService service = factory.getInstance(OMEXMLService.class);
meta = service.createOMEXMLMetadata();
// set up the reader and associate it with the input file
reader = new ImageReader();
reader.setMetadataStore(meta);
reader.setId(ii.getFile().getAbsolutePath());
BufferedImageReader biReader = BufferedImageReader.makeBufferedImageReader(reader);
img = biReader.openImage(0);
logger.debug("image loaded: " + img);
} catch (FormatException e) {
throw new FileOpException("Unable to load image format: " + e);
} catch (IOException e) {
throw new FileOpException("Unable to load image file: " + e);
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (DependencyException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
Aggregations