diff --git a/src/main/java/jp/riken/neurodata/tools/BioFormatsImageInfo.java b/src/main/java/jp/riken/neurodata/tools/BioFormatsImageInfo.java index 632262b..d922c4f 100644 --- a/src/main/java/jp/riken/neurodata/tools/BioFormatsImageInfo.java +++ b/src/main/java/jp/riken/neurodata/tools/BioFormatsImageInfo.java @@ -271,8 +271,8 @@ public class BioFormatsImageInfo { results.put("status", status); results.put("message", message); results.put("format", format); - results.put("thumbnail", thumbnail.isEmpty() ? null : thumbnail); results.put("metadata", metadata.isEmpty() ? null : metadata); + results.put("thumbnail", thumbnail.isEmpty() ? null : thumbnail); System.out.println(getJsonString(results)); if (!status) { diff --git a/src/main/java/jp/riken/neurodata/tools/BioFormatsImageThumbnail.java b/src/main/java/jp/riken/neurodata/tools/BioFormatsImageThumbnail.java index 1ab6e5e..7c0f880 100644 --- a/src/main/java/jp/riken/neurodata/tools/BioFormatsImageThumbnail.java +++ b/src/main/java/jp/riken/neurodata/tools/BioFormatsImageThumbnail.java @@ -149,12 +149,21 @@ public class BioFormatsImageThumbnail { throw new BioFormatsImageException("unsupported file: " + path); } try { - final int series = 0; + int series = 0; + final int seriesCount = reader.getSeriesCount(); + for (int i = 0; i < seriesCount; i++) { + reader.setSeries(i); + if (reader.isThumbnailSeries()) { + series = i; + break; + } + } + reader.setSeries(series); final int no = 0; - // System.out.println("series count: " + reader.getSeriesCount()); + // System.out.println("series count: " + seriesCount); // System.out.println("image count: " + reader.getImageCount()); // System.out.println("resolution: " + reader.getResolutionCount()); - reader.setSeries(series); + // System.out.println("thubmail series: " + series); ret = reader.openThumbImage(no); } catch (final Throwable e) { for (Throwable t = e; t != null; t = t.getCause()) {