use of loci.formats.ImageWriter in project bioformats by openmicroscopy.
the class FileExport method initializeWriter.
/**
* Set up the file writer.
*
* @param omexml the IMetadata object that is to be associated with the writer
* @return true if the file writer was successfully initialized; false if an
* error occurred
*/
private boolean initializeWriter(IMetadata omexml) {
// create the file writer and associate the OME-XML metadata with it
writer = new ImageWriter();
writer.setMetadataRetrieve(omexml);
Exception exception = null;
try {
writer.setId(outputFile);
} catch (FormatException e) {
exception = e;
} catch (IOException e) {
exception = e;
}
if (exception != null) {
System.err.println("Failed to initialize file writer.");
exception.printStackTrace();
}
return exception == null;
}
Aggregations