Exporting files using Bio-Formats ================================= This guide pertains to version 4.2 and later. Basic conversion ---------------- The first thing we need to do is set up a reader: :: // create a reader that will automatically handle any supported format IFormatReader reader = new ImageReader(); // tell the reader where to store the metadata from the dataset MetadataStore metadata; try { ServiceFactory factory = new ServiceFactory(); OMEXMLService service = factory.getInstance(OMEXMLService.class); metadata = service.createOMEXMLMetadata(); } catch (DependencyException exc) { throw new FormatException("Could not create OME-XML store.", exc); } catch (ServiceException exc) { throw new FormatException("Could not create OME-XML store.", exc); } reader.setMetadataStore(metadata); // initialize the dataset reader.setId("/path/to/file"); Now, we set up our writer: :: // create a writer that will automatically handle any supported output format IFormatWriter writer = new ImageWriter(); // give the writer a MetadataRetrieve object, which encapsulates all of the // dimension information for the dataset (among many other things) OMEXMLService service = factory.getInstance(OMEXMLService.class); writer.setMetadataRetrieve(service.asRetrieve(reader.getMetadataStore())); // initialize the writer writer.setId("/path/to/output/file"); Note that the extension of the file name passed to 'writer.setId(…)' determines the file format of the exported file. Now that everything is set up, we can start writing planes: :: for (int series=0; series`_