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) writer.setMetadataRetrieve(MetadataTools.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 4 GB) this is problematic. The solution is to break each image plane into a set of reasonably-sized tiles and save each tile separately - thus substantially reducing the amount of memory required for conversion. For now, we'll assume that your tile size is 1024 x 1024, though in practice you will likely want to adjust this. Assuming you have an IFormatReader and IFormatWriter set up as in the previous example, let's start writing planes: :: int tileWidth = 1024; int tileHeight = 1024; for (int series=0; series`_