Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NGFF spec version to --version output #155

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ public class Converter implements Callable<Void> {
/** Version of the bioformats2raw layout. */
public static final Integer LAYOUT = 3;

/** NGFF specification version.*/
public static final String NGFF_VERSION = "0.4";

@Parameters(
index = "0",
arity = "1",
Expand Down Expand Up @@ -426,6 +429,7 @@ public Void call() throws Exception {
).orElse("development");
System.out.println("Version = " + version);
System.out.println("Bio-Formats version = " + FormatTools.VERSION);
System.out.println("NGFF specification version = " + NGFF_VERSION);
return null;
}

Expand Down Expand Up @@ -1519,6 +1523,7 @@ private void saveHCSMetadata(IMetadata meta) throws IOException {
plateMap.put("rows", rows);

plateMap.put("field_count", maxField + 1);
plateMap.put("version", NGFF_VERSION);

Map<String, Object> attributes = root.getAttributes();
attributes.put("plate", plateMap);
Expand Down Expand Up @@ -1570,7 +1575,7 @@ private void setSeriesLevelMetadata(int series, int resolutions)
multiscale.put("type", downsampling.getName());
}
multiscale.put("metadata", metadata);
multiscale.put("version", nested ? "0.4" : "0.1");
multiscale.put("version", nested ? NGFF_VERSION : "0.1");
multiscales.add(multiscale);

IFormatReader v = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,7 @@ public void testHCSMetadata() throws Exception {
Map<String, Object> plate =
(Map<String, Object>) z.getAttributes().get("plate");
assertEquals(fieldCount, ((Number) plate.get("field_count")).intValue());
assertEquals("0.4", plate.get("version"));

List<Map<String, Object>> acquisitions =
(List<Map<String, Object>>) plate.get("acquisitions");
Expand Down Expand Up @@ -1028,6 +1029,7 @@ public void testHCSMetadataNoAcquisitions() throws Exception {
Map<String, Object> plate =
(Map<String, Object>) z.getAttributes().get("plate");
assertEquals(fieldCount, ((Number) plate.get("field_count")).intValue());
assertEquals("0.4", plate.get("version"));

List<Map<String, Object>> rows =
(List<Map<String, Object>>) plate.get("rows");
Expand Down Expand Up @@ -1106,6 +1108,7 @@ public void testSingleWell() throws IOException {
Map<String, Object> plate =
(Map<String, Object>) z.getAttributes().get("plate");
assertEquals(fieldCount, ((Number) plate.get("field_count")).intValue());
assertEquals("0.4", plate.get("version"));

List<Map<String, Object>> acquisitions =
(List<Map<String, Object>>) plate.get("acquisitions");
Expand Down Expand Up @@ -1168,6 +1171,7 @@ public void testTwoWells(String resourceName) throws IOException {
Map<String, Object> plate =
(Map<String, Object>) z.getAttributes().get("plate");
assertEquals(fieldCount, ((Number) plate.get("field_count")).intValue());
assertEquals("0.4", plate.get("version"));

List<Map<String, Object>> acquisitions =
(List<Map<String, Object>>) plate.get("acquisitions");
Expand Down Expand Up @@ -1228,6 +1232,7 @@ public void testOnePlateRow() throws IOException {
Map<String, Object> plate =
(Map<String, Object>) z.getAttributes().get("plate");
assertEquals(fieldCount, ((Number) plate.get("field_count")).intValue());
assertEquals("0.4", plate.get("version"));

List<Map<String, Object>> acquisitions =
(List<Map<String, Object>>) plate.get("acquisitions");
Expand Down Expand Up @@ -1283,6 +1288,7 @@ public void testSingleWellTwoAcquisitions() throws IOException {
Map<String, Object> plate =
(Map<String, Object>) z.getAttributes().get("plate");
assertEquals(fieldCount, ((Number) plate.get("field_count")).intValue());
assertEquals("0.4", plate.get("version"));

List<Map<String, Object>> acquisitions =
(List<Map<String, Object>>) plate.get("acquisitions");
Expand Down