diff --git a/components/formats-gpl/src/loci/formats/in/SVSReader.java b/components/formats-gpl/src/loci/formats/in/SVSReader.java index b48b4dff9b5..9bc9728ed96 100644 --- a/components/formats-gpl/src/loci/formats/in/SVSReader.java +++ b/components/formats-gpl/src/loci/formats/in/SVSReader.java @@ -100,6 +100,9 @@ public class SVSReader extends BaseTiffReader { // total number of extra (label and macro) images private int extraImages = 0; + private transient Double physicalDistanceFromLeftEdge; + private transient Double physicalDistanceFromTopEdge; + // -- Constructor -- /** Constructs a new SVS reader. */ @@ -481,6 +484,12 @@ else if (t.toLowerCase().indexOf("macro") >= 0) { int color = Integer.parseInt(value); displayColor = new Color((color << 8) | 0xff); break; + case "Left": + physicalDistanceFromLeftEdge = DataTools.parseDouble(value); + break; + case "Top": + physicalDistanceFromTopEdge = DataTools.parseDouble(value); + break; } } } @@ -498,7 +507,10 @@ protected void initMetadataStore() throws FormatException { super.initMetadataStore(); MetadataStore store = makeFilterMetadata(); - MetadataTools.populatePixels(store, this, getImageCount() > 1); + boolean populatePlaneData = getImageCount() > 1 || + physicalDistanceFromTopEdge != null || + physicalDistanceFromLeftEdge != null; + MetadataTools.populatePixels(store, this, populatePlaneData); String instrument = MetadataTools.createLSID("Instrument", 0); String objective = MetadataTools.createLSID("Objective", 0, 0); @@ -513,6 +525,21 @@ protected void initMetadataStore() throws FormatException { store.setImageInstrumentRef(instrument, i); store.setObjectiveSettingsID(objective, i); + if (i == 0) { + if (physicalDistanceFromTopEdge != null) { + Length yPos = FormatTools.getStagePosition(physicalDistanceFromTopEdge, UNITS.MM); + for (int p=0; p extraImages) { store.setImageName("Series " + (i + 1), i); }