//
// SubResolutionExample.java
//

import java.io.IOException;

import loci.formats.FormatException;
import loci.formats.IFormatReader;
import loci.formats.ImageReader;

/**
 * Demonstration of the sub-resolution API.
 *
 * <dl><dt><b>Source code:</b></dt>
 * <dd><a href="http://trac.openmicroscopy.org.uk/ome/browser/bioformats.git/components/bio-formats/utils/SubResolutionExample.java">Trac</a>,
 * <a href="http://git.openmicroscopy.org/?p=bioformats.git;a=blob;f=components/bio-formats/utils/SubResolutionExample.java;hb=HEAD">Gitweb</a></dd></dl>
 */
public class SubResolutionExample {

  public static void main(String[] args) throws FormatException, IOException {
    // parse command line arguments
    if (args.length < 1) {
      System.err.println("Usage: java SubResolutionExample imageFile");
      System.exit(1);
    }
    String id = args[0];

    // configure reader
    IFormatReader reader = new ImageReader();
    reader.setFlattenedResolutions(false);
    System.out.println("Initializing file: " + id);
    reader.setId(id); // parse metadata

    int seriesCount = reader.getSeriesCount();

    System.out.println("  Series count = " + seriesCount);

    for (int series=0; series<seriesCount; series++) {
      reader.setSeries(series);
      int resolutionCount = reader.getResolutionCount();

      System.out.println("    Resolution count for series #" + series +
        " = " + resolutionCount);

      for (int r=0; r<resolutionCount; r++) {
        reader.setResolution(r);
        System.out.println("      Resolution #" + r + " dimensions = " +
          reader.getSizeX() + " x " + reader.getSizeY());
      }
    }

    reader.close();
  }

}

@@ -1,37 +1,958 @@
 /
-/%0A// SubResolutionExample.java%0A/
+*%0A * #%25L%0A * OME Bio-Formats package for reading and converting biological file formats.%0A * %25%25%0A * Copyright (C) 2005 - 2012 Open Microscopy Environment:%0A *   - Board of Regents of the University of Wisconsin-Madison%0A *   - Glencoe Software, Inc.%0A *   - University of Dundee%0A * %25%25%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU General Public License as%0A * published by the Free Software Foundation, either version 2 of the %0A * License, or (at your option) any later version.%0A * %0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU General Public License for more details.%0A * %0A * You should have received a copy of the GNU General Public %0A * License along with this program.  If not, see%0A * %3Chttp://www.gnu.org/licenses/gpl-2.0.html%3E.%0A * #L%25%0A *
 /%0A%0Ai

fix header text