Skip to content

Commit

Permalink
Check the value of the "bioformats2raw.layout" attribute
Browse files Browse the repository at this point in the history
Fail fast if the attribute is missing or indicates an unsupported format version.
  • Loading branch information
melissalinkert committed May 1, 2020
1 parent 5a2e1f0 commit ebb14c7
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,11 @@ public void initialize()
if (n5Reader == null) {
throw new FormatException("Could not create an N5 reader");
}
Integer layoutVersion =
n5Reader.getAttribute("/", "bioformats2raw.layout", Integer.class);
if (layoutVersion == null || layoutVersion != 1) {
throw new FormatException("Unsupported version: " + layoutVersion);
}

LOG.info("Creating tiled pyramid file {}", this.outputFilePath);

Expand Down

0 comments on commit ebb14c7

Please sign in to comment.