/*
 * #%L
 * SCIFIO Bio-Formats compatibility format.
 * %%
 * Copyright (C) 2013 Open Microscopy Environment:
 *   - Board of Regents of the University of Wisconsin-Madison
 *   - Glencoe Software, Inc.
 *   - University of Dundee
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 2 of the 
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public 
 * License along with this program.  If not, see
 * <http://www.gnu.org/licenses/gpl-2.0.html>.
 * #L%
 */

import io.scif.Format;
import io.scif.FormatException;
import io.scif.SCIFIO;

import java.io.File;

import javax.swing.JFileChooser;

/**
 * A simple manual test for the SCIFIO Bio-Formats compatibility layer.
 * 
 * @author Curtis Rueden
 */
public class ReadFile {

  public static void main(String[] args) throws FormatException {
    final SCIFIO scifio = new SCIFIO();

    final JFileChooser opener = new javax.swing.JFileChooser(System.getProperty("user.home"));
    int result = opener.showOpenDialog(null);
    if (result != JFileChooser.APPROVE_OPTION) return;
    final File file = opener.getSelectedFile();

    final Format format = scifio.format().getFormat(file.getAbsolutePath());
    System.out.println("file = " + file);
    System.out.println("format = " + format);
  }

}

@@ -963,16 +963,64 @@
 eption;%0A
+import io.scif.Metadata;%0Aimport io.scif.Parser;%0A
 import i
@@ -1055,16 +1055,44 @@
 io.File;
+%0Aimport java.io.IOException;
 %0A%0Aimport
@@ -1119,16 +1119,51 @@
 ooser;%0A%0A
+import net.imglib2.meta.AxisType;%0A%0A
 /**%0A * A
@@ -1351,16 +1351,29 @@
 xception
+, IOException
  %7B%0A    f
@@ -1818,15 +1818,463 @@
 ormat);%0A
+    final Parser parser = format.createParser();%0A    final Metadata meta = parser.parse(file);%0A    for (int i=0; i%3Cmeta.getImageCount(); i++) %7B%0A      System.out.println(%22image #%22 + i + %22 dimensions:%22);%0A      for (int a=0; a%3Cmeta.getAxisCount(i); a++) %7B%0A        final AxisType axisType = meta.getAxisType(i, a);%0A        final int axisLength = meta.getAxisLength(i, a);%0A        System.out.println(%22%5Ct%22 + axisLength + %22 : %22 + axisType);%0A      %7D%0A    %7D%0A
   %7D%0A%0A%7D%0A

print out dimensional sizes per image