update example code for extracting thumbnail.

This commit is contained in:
Yoshihiro OKUMURA 2022-09-29 19:03:57 +09:00
parent 6d29af7f72
commit 6bd2bbc572

View File

@ -26,14 +26,17 @@ java -jar ./target/bioformats-imageinfo-1.1.0-jar-with-dependencies.jar "[path t
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.Map; import java.util.Map;
import jp.riken.neurodata.tools.BioFormatsImageInfo; import jp.riken.neurodata.tools.BioFormatsImageInfo;
import jp.riken.neurodata.tools.BioFormatsException; import jp.riken.neurodata.tools.BioFormatsImageException;
import jp.riken.neurodata.tools.BioFormatsImageThumbnail;
String path = "[path to image file]"; String path = "[path to image file]";
String format = ""; String format = "";
Map<String, Object> metadata = new LinkedHashMap<String, Object>(); Map<String, Object> metadata = new LinkedHashMap<String, Object>();
Map<String, Object> thumbnail = new LinkedHashMap<String, Object>();
try { try {
format = BioFormatsImageInfo.readMetadata(path, metadata); format = BioFormatsImageInfo.readMetadata(path, metadata);
BioFormatsImageThumbnail.readThumbnail(path, thumbnail);
} catch (BioFormatsImageException e) { } catch (BioFormatsImageException e) {
// error occurred // error occurred
e.printStackTrace(); e.printStackTrace();