From 17cab676af40ceaf858cc237c66c8bafae193337 Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Fri, 24 May 2024 14:26:53 -0500 Subject: [PATCH 1/2] Fix invalid Shape.TheC value The* values should always be non-negative, -1 is invalid. --- .../java/qupath/lib/images/servers/omero/OmeroShapes.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/qupath/lib/images/servers/omero/OmeroShapes.java b/src/main/java/qupath/lib/images/servers/omero/OmeroShapes.java index 99aeb82b..2912cb65 100644 --- a/src/main/java/qupath/lib/images/servers/omero/OmeroShapes.java +++ b/src/main/java/qupath/lib/images/servers/omero/OmeroShapes.java @@ -217,7 +217,7 @@ private static int ARGBToRGBA(int argb) { public static abstract class OmeroShape { @SerializedName(value = "TheC") - private int c = -1; + private int c; @SerializedName(value = "TheZ") private int z; @SerializedName(value = "TheT") @@ -471,4 +471,4 @@ private static String pointsToString(List points) { } -} \ No newline at end of file +} From defb154faedb351cbb6cc8990d3c1947cd43841d Mon Sep 17 00:00:00 2001 From: Melissa Linkert Date: Thu, 30 May 2024 12:05:53 -0500 Subject: [PATCH 2/2] Use Integer instead of int for `The*` attributes int will always be serialized, but Integer will only be serialized if not null. --- .../java/qupath/lib/images/servers/omero/OmeroShapes.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/qupath/lib/images/servers/omero/OmeroShapes.java b/src/main/java/qupath/lib/images/servers/omero/OmeroShapes.java index 2912cb65..4cd48e57 100644 --- a/src/main/java/qupath/lib/images/servers/omero/OmeroShapes.java +++ b/src/main/java/qupath/lib/images/servers/omero/OmeroShapes.java @@ -217,11 +217,11 @@ private static int ARGBToRGBA(int argb) { public static abstract class OmeroShape { @SerializedName(value = "TheC") - private int c; + private Integer c; @SerializedName(value = "TheZ") - private int z; + private Integer z; @SerializedName(value = "TheT") - private int t; + private Integer t; @SerializedName(value = "@type") private String type;