Last active
June 29, 2018 10:51
-
-
Save ctrueden/8c14e07d5f2d9b4623b42b2e80feca30 to your computer and use it in GitHub Desktop.
Simple SCIFIO example which parses metadata and prints it
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.restlesscoder.sandbox.imagej; | |
import io.scif.FieldPrinter; | |
import io.scif.Format; | |
import io.scif.Metadata; | |
import net.imagej.ImageJ; | |
public class ParseMetadata { | |
public static void main(final String... args) throws Exception { | |
ImageJ ij = new ImageJ(); | |
final String filePath = "/Users/curtis/data/toucan.png"; | |
Format format = ij.scifio().format().getFormat(filePath); | |
Metadata metadata = format.createParser().parse(filePath); | |
System.out.println(new FieldPrinter(metadata)); | |
ImageMetadata imageMeta = metadata.get(0); | |
System.out.println(imageMeta); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment