diff --git a/pom.xml b/pom.xml index b75ae332..3df74f4a 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ fr.igred simple-omero-client - 5.16.0 + 5.17.0-SNAPSHOT jar Simple OMERO Client @@ -35,7 +35,7 @@ ppouchin Pierre Pouchin pierre.pouchin@uca.fr - https://www.igred.fr/directory/member/pierre-pouchin/ + https://www.igred.fr/en/member/pierre_pouchin/ GReD (INSERM U1103 / CNRS UMR 6293 / UCA) https://www.igred.fr diff --git a/src/main/java/fr/igred/omero/AnnotatableWrapper.java b/src/main/java/fr/igred/omero/AnnotatableWrapper.java index 36585e59..b7293684 100644 --- a/src/main/java/fr/igred/omero/AnnotatableWrapper.java +++ b/src/main/java/fr/igred/omero/AnnotatableWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/Browser.java b/src/main/java/fr/igred/omero/Browser.java index 39b43cdd..7e0c0c6b 100644 --- a/src/main/java/fr/igred/omero/Browser.java +++ b/src/main/java/fr/igred/omero/Browser.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/Client.java b/src/main/java/fr/igred/omero/Client.java index 766e1ebf..237ec7f3 100644 --- a/src/main/java/fr/igred/omero/Client.java +++ b/src/main/java/fr/igred/omero/Client.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/GatewayWrapper.java b/src/main/java/fr/igred/omero/GatewayWrapper.java index 75bfbb7e..7f6f9b0a 100644 --- a/src/main/java/fr/igred/omero/GatewayWrapper.java +++ b/src/main/java/fr/igred/omero/GatewayWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/GenericObjectWrapper.java b/src/main/java/fr/igred/omero/GenericObjectWrapper.java index 315588a7..30c098c4 100644 --- a/src/main/java/fr/igred/omero/GenericObjectWrapper.java +++ b/src/main/java/fr/igred/omero/GenericObjectWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/annotations/AnnotationList.java b/src/main/java/fr/igred/omero/annotations/AnnotationList.java index a6010eef..a29f225c 100644 --- a/src/main/java/fr/igred/omero/annotations/AnnotationList.java +++ b/src/main/java/fr/igred/omero/annotations/AnnotationList.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/annotations/FileAnnotationWrapper.java b/src/main/java/fr/igred/omero/annotations/FileAnnotationWrapper.java index a5cd3ace..599c0787 100644 --- a/src/main/java/fr/igred/omero/annotations/FileAnnotationWrapper.java +++ b/src/main/java/fr/igred/omero/annotations/FileAnnotationWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/annotations/GenericAnnotationWrapper.java b/src/main/java/fr/igred/omero/annotations/GenericAnnotationWrapper.java index 32783073..8560c7b6 100644 --- a/src/main/java/fr/igred/omero/annotations/GenericAnnotationWrapper.java +++ b/src/main/java/fr/igred/omero/annotations/GenericAnnotationWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/annotations/MapAnnotationWrapper.java b/src/main/java/fr/igred/omero/annotations/MapAnnotationWrapper.java index 3951a7c2..4d9b0b80 100644 --- a/src/main/java/fr/igred/omero/annotations/MapAnnotationWrapper.java +++ b/src/main/java/fr/igred/omero/annotations/MapAnnotationWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/annotations/RatingAnnotationWrapper.java b/src/main/java/fr/igred/omero/annotations/RatingAnnotationWrapper.java index 0842dc5f..7518724d 100644 --- a/src/main/java/fr/igred/omero/annotations/RatingAnnotationWrapper.java +++ b/src/main/java/fr/igred/omero/annotations/RatingAnnotationWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/annotations/TableWrapper.java b/src/main/java/fr/igred/omero/annotations/TableWrapper.java index da40554b..7bb34704 100644 --- a/src/main/java/fr/igred/omero/annotations/TableWrapper.java +++ b/src/main/java/fr/igred/omero/annotations/TableWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/annotations/TagAnnotationWrapper.java b/src/main/java/fr/igred/omero/annotations/TagAnnotationWrapper.java index 7082e0cf..bf3413f4 100644 --- a/src/main/java/fr/igred/omero/annotations/TagAnnotationWrapper.java +++ b/src/main/java/fr/igred/omero/annotations/TagAnnotationWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/annotations/TagSetWrapper.java b/src/main/java/fr/igred/omero/annotations/TagSetWrapper.java index dcfd3b8f..90ce57d5 100644 --- a/src/main/java/fr/igred/omero/annotations/TagSetWrapper.java +++ b/src/main/java/fr/igred/omero/annotations/TagSetWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/annotations/TextualAnnotationWrapper.java b/src/main/java/fr/igred/omero/annotations/TextualAnnotationWrapper.java index c75269a7..6bf7258b 100644 --- a/src/main/java/fr/igred/omero/annotations/TextualAnnotationWrapper.java +++ b/src/main/java/fr/igred/omero/annotations/TextualAnnotationWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/annotations/package-info.java b/src/main/java/fr/igred/omero/annotations/package-info.java index ce942350..6caeaddd 100644 --- a/src/main/java/fr/igred/omero/annotations/package-info.java +++ b/src/main/java/fr/igred/omero/annotations/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/exception/AccessException.java b/src/main/java/fr/igred/omero/exception/AccessException.java index 7f1ca0ee..858b6baf 100644 --- a/src/main/java/fr/igred/omero/exception/AccessException.java +++ b/src/main/java/fr/igred/omero/exception/AccessException.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/exception/ExceptionHandler.java b/src/main/java/fr/igred/omero/exception/ExceptionHandler.java index 9587d6d1..e7fc652f 100644 --- a/src/main/java/fr/igred/omero/exception/ExceptionHandler.java +++ b/src/main/java/fr/igred/omero/exception/ExceptionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/exception/OMEROServerError.java b/src/main/java/fr/igred/omero/exception/OMEROServerError.java index 8e4a4b07..fe08ba5c 100644 --- a/src/main/java/fr/igred/omero/exception/OMEROServerError.java +++ b/src/main/java/fr/igred/omero/exception/OMEROServerError.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/exception/ServiceException.java b/src/main/java/fr/igred/omero/exception/ServiceException.java index 3057f72a..2eea4fdb 100644 --- a/src/main/java/fr/igred/omero/exception/ServiceException.java +++ b/src/main/java/fr/igred/omero/exception/ServiceException.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/exception/package-info.java b/src/main/java/fr/igred/omero/exception/package-info.java index 21a87a84..3b09b193 100644 --- a/src/main/java/fr/igred/omero/exception/package-info.java +++ b/src/main/java/fr/igred/omero/exception/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/meta/ExperimenterWrapper.java b/src/main/java/fr/igred/omero/meta/ExperimenterWrapper.java index 6da30a26..242ddb4b 100644 --- a/src/main/java/fr/igred/omero/meta/ExperimenterWrapper.java +++ b/src/main/java/fr/igred/omero/meta/ExperimenterWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/meta/GroupWrapper.java b/src/main/java/fr/igred/omero/meta/GroupWrapper.java index a4eb3f76..aae8849c 100644 --- a/src/main/java/fr/igred/omero/meta/GroupWrapper.java +++ b/src/main/java/fr/igred/omero/meta/GroupWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/meta/PlaneInfoWrapper.java b/src/main/java/fr/igred/omero/meta/PlaneInfoWrapper.java index e8b3f677..ae3e9b56 100644 --- a/src/main/java/fr/igred/omero/meta/PlaneInfoWrapper.java +++ b/src/main/java/fr/igred/omero/meta/PlaneInfoWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/meta/package-info.java b/src/main/java/fr/igred/omero/meta/package-info.java index 619f34a4..3291d59f 100644 --- a/src/main/java/fr/igred/omero/meta/package-info.java +++ b/src/main/java/fr/igred/omero/meta/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/package-info.java b/src/main/java/fr/igred/omero/package-info.java index 34ef8db5..8fb42c6c 100644 --- a/src/main/java/fr/igred/omero/package-info.java +++ b/src/main/java/fr/igred/omero/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/repository/ChannelWrapper.java b/src/main/java/fr/igred/omero/repository/ChannelWrapper.java index fda9f1f7..12e81c5d 100644 --- a/src/main/java/fr/igred/omero/repository/ChannelWrapper.java +++ b/src/main/java/fr/igred/omero/repository/ChannelWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/repository/DatasetWrapper.java b/src/main/java/fr/igred/omero/repository/DatasetWrapper.java index 33d8e0e2..e199ac7b 100644 --- a/src/main/java/fr/igred/omero/repository/DatasetWrapper.java +++ b/src/main/java/fr/igred/omero/repository/DatasetWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/repository/FolderWrapper.java b/src/main/java/fr/igred/omero/repository/FolderWrapper.java index 2e397f7f..571d19d6 100644 --- a/src/main/java/fr/igred/omero/repository/FolderWrapper.java +++ b/src/main/java/fr/igred/omero/repository/FolderWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/repository/GenericRepositoryObjectWrapper.java b/src/main/java/fr/igred/omero/repository/GenericRepositoryObjectWrapper.java index a4bb4d20..37ac697c 100644 --- a/src/main/java/fr/igred/omero/repository/GenericRepositoryObjectWrapper.java +++ b/src/main/java/fr/igred/omero/repository/GenericRepositoryObjectWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/repository/ImageWrapper.java b/src/main/java/fr/igred/omero/repository/ImageWrapper.java index 1ce0dd59..02d454dc 100644 --- a/src/main/java/fr/igred/omero/repository/ImageWrapper.java +++ b/src/main/java/fr/igred/omero/repository/ImageWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/repository/PixelsWrapper.java b/src/main/java/fr/igred/omero/repository/PixelsWrapper.java index a6f7e44e..67236170 100644 --- a/src/main/java/fr/igred/omero/repository/PixelsWrapper.java +++ b/src/main/java/fr/igred/omero/repository/PixelsWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/repository/PlateAcquisitionWrapper.java b/src/main/java/fr/igred/omero/repository/PlateAcquisitionWrapper.java index d67377c1..f5b43023 100644 --- a/src/main/java/fr/igred/omero/repository/PlateAcquisitionWrapper.java +++ b/src/main/java/fr/igred/omero/repository/PlateAcquisitionWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/repository/PlateWrapper.java b/src/main/java/fr/igred/omero/repository/PlateWrapper.java index ad4594e2..d2ee382c 100644 --- a/src/main/java/fr/igred/omero/repository/PlateWrapper.java +++ b/src/main/java/fr/igred/omero/repository/PlateWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/repository/ProjectWrapper.java b/src/main/java/fr/igred/omero/repository/ProjectWrapper.java index ddaf8171..9e0d071b 100644 --- a/src/main/java/fr/igred/omero/repository/ProjectWrapper.java +++ b/src/main/java/fr/igred/omero/repository/ProjectWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/repository/ScreenWrapper.java b/src/main/java/fr/igred/omero/repository/ScreenWrapper.java index 25c617be..037ea343 100644 --- a/src/main/java/fr/igred/omero/repository/ScreenWrapper.java +++ b/src/main/java/fr/igred/omero/repository/ScreenWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/repository/WellSampleWrapper.java b/src/main/java/fr/igred/omero/repository/WellSampleWrapper.java index 5eadfd32..b7149b2d 100644 --- a/src/main/java/fr/igred/omero/repository/WellSampleWrapper.java +++ b/src/main/java/fr/igred/omero/repository/WellSampleWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/repository/WellWrapper.java b/src/main/java/fr/igred/omero/repository/WellWrapper.java index ee06f3c5..82bcc8fc 100644 --- a/src/main/java/fr/igred/omero/repository/WellWrapper.java +++ b/src/main/java/fr/igred/omero/repository/WellWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/repository/package-info.java b/src/main/java/fr/igred/omero/repository/package-info.java index e565a013..648c5d9e 100644 --- a/src/main/java/fr/igred/omero/repository/package-info.java +++ b/src/main/java/fr/igred/omero/repository/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/roi/EllipseWrapper.java b/src/main/java/fr/igred/omero/roi/EllipseWrapper.java index 5ac146ea..afb9c858 100644 --- a/src/main/java/fr/igred/omero/roi/EllipseWrapper.java +++ b/src/main/java/fr/igred/omero/roi/EllipseWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/roi/GenericShapeWrapper.java b/src/main/java/fr/igred/omero/roi/GenericShapeWrapper.java index ac8693db..5daa4d58 100644 --- a/src/main/java/fr/igred/omero/roi/GenericShapeWrapper.java +++ b/src/main/java/fr/igred/omero/roi/GenericShapeWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software @@ -23,6 +23,7 @@ import fr.igred.omero.exception.AccessException; import fr.igred.omero.exception.ServiceException; import ij.ImagePlus; +import ij.gui.ImageRoi; import ij.gui.Line; import ij.gui.Roi; import ij.gui.ShapeRoi; @@ -30,6 +31,7 @@ import ome.model.units.BigResult; import omero.gateway.model.AnnotationData; import omero.gateway.model.ShapeData; +import omero.gateway.model.ShapeSettingsData; import omero.model.AffineTransform; import omero.model.AffineTransformI; import omero.model.LengthI; @@ -38,6 +40,8 @@ import omero.model.enums.UnitsLength; import java.awt.Color; +import java.awt.Font; +import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.util.Arrays; import java.util.Collection; @@ -59,6 +63,9 @@ public abstract class GenericShapeWrapper extends Annotatab /** Annotation link name for this type of object */ public static final String ANNOTATION_LINK = "ShapeAnnotationLink"; + /** Default IJ property to store shape ID. */ + public static final String IJ_IDPROPERTY = "SHAPE_ID"; + /** Transparent color */ private static final Color TRANSPARENT = new Color(0, 0, 0, 0); @@ -123,6 +130,8 @@ static ShapeList fromImageJ(ij.gui.Roi ijRoi) { default: if (ijRoi instanceof TextRoi) { list.add(new TextWrapper((TextRoi) ijRoi)); + } else if (ijRoi instanceof ImageRoi) { + list.add(new MaskWrapper((ImageRoi) ijRoi)); } else { list.add(new RectangleWrapper(ijRoi)); } @@ -132,6 +141,24 @@ static ShapeList fromImageJ(ij.gui.Roi ijRoi) { } + /** + * Extracts the angle from an AffineTransform. + * + * @param transform The AffineTransform. + * + * @return See above. + */ + private static double extractAngle(java.awt.geom.AffineTransform transform) { + Point2D p1 = new Point2D.Double(0, 0); + Point2D p2 = new Point2D.Double(1, 0); + Point2D tp1 = transform.transform(p1, null); + Point2D tp2 = transform.transform(p2, null); + double dx = tp2.getX() - tp1.getX(); + double dy = tp2.getY() - tp1.getY(); + return StrictMath.atan2(dy, dx); + } + + /** * Copies details from an ImageJ ROI (position, stroke color, stroke width). * @@ -183,11 +210,51 @@ protected void copyFromIJRoi(ij.gui.Roi ijRoi) { data.setC(Math.max(-1, c - 1)); data.setZ(Math.max(-1, z - 1)); data.setT(Math.max(-1, t - 1)); + + if (ijRoi instanceof TextRoi) { + copyFromIJTextRoi((TextRoi) ijRoi); + } + } + + + /** + * Copies details from an ImageJ TextRoi (angle, font). + * + * @param text An ImageJ TextRoi. + */ + private void copyFromIJTextRoi(ij.gui.TextRoi text) { + Font font = text.getCurrentFont(); + setFontSize(font.getSize()); + + int style = font.getStyle(); + + String styleName; + if (style == java.awt.Font.BOLD) { + styleName = ShapeSettingsData.FONT_BOLD; + } else if (style == java.awt.Font.ITALIC) { + styleName = ShapeSettingsData.FONT_ITALIC; + } else if (style == java.awt.Font.BOLD + java.awt.Font.ITALIC) { + styleName = ShapeSettingsData.FONT_BOLD_ITALIC; + } else { + styleName = ShapeSettingsData.FONT_REGULAR; + } + data.getShapeSettings().setFontStyle(styleName); + data.getShapeSettings().setFontFamily(font.getFamily()); + + // Angle is negative and in degrees in IJ + double angle = StrictMath.toRadians(-text.getAngle()); + double x = text.getBounds().getX(); + double y = text.getBounds().getY(); + + java.awt.geom.AffineTransform at = new java.awt.geom.AffineTransform(); + at.rotate(angle, x, y); + setTransform(at); } /** * Copies details to an ImageJ ROI (name, position, stroke color, fill color, stroke width). + *

Also sets the {@code SHAPE_ID} property to the shape ID.

* * @param ijRoi An ImageJ Roi. */ @@ -196,12 +263,39 @@ protected void copyToIJRoi(ij.gui.Roi ijRoi) { ijRoi.setStrokeColor(getStroke()); Color fill = getFill(); if (!TRANSPARENT.equals(fill)) { - ijRoi.setFillColor(getFill()); + ijRoi.setFillColor(fill); } int c = Math.max(0, getC() + 1); int z = Math.max(0, getZ() + 1); int t = Math.max(0, getT() + 1); ijRoi.setPosition(c, z, t); + if (ijRoi instanceof TextRoi) { + copyToIJTextRoi((TextRoi) ijRoi); + } + ijRoi.setProperty(IJ_IDPROPERTY, String.valueOf(data.getId())); + } + + + /** + * Copies details to an ImageJ TextRoi (angle, font). + * + * @param text An ImageJ TextRoi. + */ + private void copyToIJTextRoi(ij.gui.TextRoi text) { + // Set negative angle in degrees for IJ + double angle = -StrictMath.toDegrees(extractAngle(toAWTTransform())); + text.setAngle(angle); + + String fontFamily = data.getShapeSettings().getFontFamily(); + int fontStyle = Font.PLAIN; + if (data.getShapeSettings().getFontStyle().equals(ShapeSettingsData.FONT_BOLD)) { + fontStyle = Font.BOLD; + } else if (data.getShapeSettings().getFontStyle().equals(ShapeSettingsData.FONT_ITALIC)) { + fontStyle = Font.ITALIC; + } else if (data.getShapeSettings().getFontStyle().equals(ShapeSettingsData.FONT_BOLD_ITALIC)) { + fontStyle = Font.BOLD + Font.ITALIC; + } + text.setFont(new Font(fontFamily, fontStyle, (int) getFontSize())); } diff --git a/src/main/java/fr/igred/omero/roi/LineWrapper.java b/src/main/java/fr/igred/omero/roi/LineWrapper.java index 594c8d3f..7511d76d 100644 --- a/src/main/java/fr/igred/omero/roi/LineWrapper.java +++ b/src/main/java/fr/igred/omero/roi/LineWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/roi/MaskWrapper.java b/src/main/java/fr/igred/omero/roi/MaskWrapper.java index a17e2821..ee2fa16e 100644 --- a/src/main/java/fr/igred/omero/roi/MaskWrapper.java +++ b/src/main/java/fr/igred/omero/roi/MaskWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software @@ -18,11 +18,15 @@ package fr.igred.omero.roi; +import ij.gui.ImageRoi; import ij.gui.Roi; +import ij.process.ImageProcessor; import omero.gateway.model.MaskData; +import java.awt.Color; import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; +import java.awt.image.BufferedImage; /** @@ -32,6 +36,9 @@ public class MaskWrapper extends GenericShapeWrapper { + private static final double MAX_UINT8 = 255.0; + + /** * Constructor of the MaskWrapper class using a MaskData. * @@ -50,6 +57,41 @@ public MaskWrapper() { } + /** + * Constructor of the MaskWrapper class using an ImageJ ImageRoi. + * + * @param imageRoi An ImageJ ImageRoi. + */ + public MaskWrapper(ImageRoi imageRoi) { + this(); + data.setX(imageRoi.getXBase()); + data.setY(imageRoi.getYBase()); + data.setWidth(imageRoi.getFloatWidth()); + data.setHeight(imageRoi.getFloatHeight()); + + ImageProcessor ip = imageRoi.getProcessor(); + ip.flipVertical(); + data.setMask(ip.getIntArray()); + ip.flipVertical(); + + Color lut = new Color(ip.getCurrentColorModel().getRGB((int) ip.getMax())); + int r = lut.getRed(); + int g = lut.getGreen(); + int b = lut.getBlue(); + int a = (int) (imageRoi.getOpacity() * MAX_UINT8); + + data.setText(imageRoi.getName()); + super.copyFromIJRoi(imageRoi); + data.getShapeSettings().setFill(new Color(r, g, b, a)); + + // Always 0 as long as ImageRoi::getAngle() method is not updated + double angle = StrictMath.toRadians(-imageRoi.getAngle()); + AffineTransform transform = new AffineTransform(); + transform.rotate(angle, imageRoi.getXBase(), imageRoi.getYBase()); + super.setTransform(transform); + } + + /** * Constructor of the MaskWrapper class using a new MaskData. * @@ -187,6 +229,16 @@ public int[][] getMaskAsBinaryArray() { } + /** + * Returns the mask image. + * + * @return See above. + */ + public BufferedImage getMaskAsBufferedImage() { + return data.getMaskAsBufferedImage(); + } + + /** * Returns the mask as a byte array. * @@ -288,7 +340,12 @@ public Roi toImageJ() { Roi roi; if (transform.getType() == AffineTransform.TYPE_IDENTITY) { - roi = new ij.gui.Roi(getX(), getY(), getWidth(), getHeight()); + int x = (int) getX(); + int y = (int) getY(); + ImageRoi imgRoi = new ImageRoi(x, y, getMaskAsBufferedImage()); + imgRoi.setZeroTransparent(true); + imgRoi.setOpacity(getFill().getAlpha() / MAX_UINT8); + roi = imgRoi; } else { PointWrapper p1 = new PointWrapper(getX(), getY() + getHeight() / 2); PointWrapper p2 = new PointWrapper(getX() + getWidth(), getY() + getHeight() / 2); diff --git a/src/main/java/fr/igred/omero/roi/PointWrapper.java b/src/main/java/fr/igred/omero/roi/PointWrapper.java index f9bf39d5..cb1362ef 100644 --- a/src/main/java/fr/igred/omero/roi/PointWrapper.java +++ b/src/main/java/fr/igred/omero/roi/PointWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/roi/PolygonWrapper.java b/src/main/java/fr/igred/omero/roi/PolygonWrapper.java index 71ac875c..68546450 100644 --- a/src/main/java/fr/igred/omero/roi/PolygonWrapper.java +++ b/src/main/java/fr/igred/omero/roi/PolygonWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/roi/PolylineWrapper.java b/src/main/java/fr/igred/omero/roi/PolylineWrapper.java index 8e6cbf6a..65663f21 100644 --- a/src/main/java/fr/igred/omero/roi/PolylineWrapper.java +++ b/src/main/java/fr/igred/omero/roi/PolylineWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/roi/ROIWrapper.java b/src/main/java/fr/igred/omero/roi/ROIWrapper.java index a7bd8bc8..ac9d77a5 100644 --- a/src/main/java/fr/igred/omero/roi/ROIWrapper.java +++ b/src/main/java/fr/igred/omero/roi/ROIWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software @@ -29,6 +29,7 @@ import fr.igred.omero.repository.PixelsWrapper.Bounds; import fr.igred.omero.repository.PixelsWrapper.Coordinates; import ij.IJ; +import ij.gui.PointRoi; import ij.gui.ShapeRoi; import omero.RString; import omero.gateway.model.AnnotationData; @@ -63,9 +64,7 @@ public class ROIWrapper extends AnnotatableWrapper { /** Annotation link name for this type of object */ public static final String ANNOTATION_LINK = "RoiAnnotationLink"; - /** - * Default IJ property to store ROI local labels / indices. - */ + /** Default IJ property to store ROI local labels / indices. */ public static final String IJ_PROPERTY = "ROI"; @@ -278,6 +277,78 @@ public static List toImageJ(Collection rois, S } + /** + * Combines a list of ROIs into a single ROI. + *

{@code SHAPE_ID} property is the concatenation of shape IDs.

+ * + * @param rois The ROIs to combine (must contain at least 1 element). + * + * @return See above. + */ + private static ij.gui.Roi xor(Collection rois) { + String idProperty = GenericShapeWrapper.IJ_IDPROPERTY; + String shapeIDs = rois.stream() + .map(r -> r.getProperty(idProperty)) + .collect(Collectors.joining(",")); + + ij.gui.Roi roi = rois.iterator().next(); + if (rois.size() > 1) { + ij.gui.Roi xor = rois.stream() + .map(ShapeRoi::new) + .reduce(ShapeRoi::xor) + .map(ij.gui.Roi.class::cast) + .orElse(roi); + xor.setStrokeColor(roi.getStrokeColor()); + xor.setFillColor(roi.getFillColor()); + xor.setPosition(roi.getCPosition(), roi.getZPosition(), roi.getTPosition()); + xor.setName(roi.getName()); + xor.setProperty(idProperty, shapeIDs); + roi = xor; + } + return roi; + } + + + /** + * Combines a list of points into a single PointRoi. + * + * @param points The points to combine (must contain at least 1 element). + * + * @return See above. + */ + private static PointRoi combine(Collection points) { + String idProperty = GenericShapeWrapper.IJ_IDPROPERTY; + String shapeIDs = points.stream() + .map(p -> p.getProperty(idProperty)) + .collect(Collectors.joining(",")); + + PointRoi point = points.iterator().next(); + points.stream() + .skip(1) + .forEachOrdered(p -> point.addPoint(p.getXBase(), p.getYBase())); + point.setProperty(idProperty, shapeIDs); + return point; + } + + + /** + * Converts a shape to an ImageJ ROI and adds a name if there is none. + * + * @param shape The shape to convert. + * + * @return See above. + */ + private ij.gui.Roi shapeToIJRoiWithName(GenericShapeWrapper shape) { + ij.gui.Roi roi = shape.toImageJ(); + String name = roi.getName(); + String defaultName = String.format("%d-%d", getId(), shape.getId()); + if (name.isEmpty()) { + roi.setName(defaultName); + } + return roi; + } + + /** * Gets the ROI name. * @@ -338,7 +409,9 @@ public void addShape(GenericShapeWrapper shape) { public ShapeList getShapes() { List shapeData = data.getShapes(); ShapeList shapes = new ShapeList(shapeData.size()); - shapeData.stream().sorted(Comparator.comparing(ShapeData::getId)).forEach(shapes::add); + shapeData.stream() + .sorted(Comparator.comparing(ShapeData::getId)) + .forEachOrdered(shapes::add); return shapes; } @@ -454,6 +527,10 @@ public List toImageJ() { */ public List toImageJ(String property) { property = checkProperty(property); + String ijIDProperty = ijIDProperty(property); + String ijNameProperty = ijNameProperty(property); + String roiID = String.valueOf(getId()); + ShapeList shapes = getShapes(); Map>> sameSlice = shapes.stream() @@ -463,28 +540,39 @@ public List toImageJ(String property) { sameSlice.values().removeIf(List::isEmpty); List rois = new ArrayList<>(shapes.size()); for (List> slice : sameSlice.values()) { - GenericShapeWrapper shape = slice.iterator().next(); - - ij.gui.Roi roi = shape.toImageJ(); - String txt = shape.getText(); - if (slice.size() > 1) { - ij.gui.Roi xor = slice.stream() - .map(GenericShapeWrapper::toImageJ) - .map(ShapeRoi::new) - .reduce(ShapeRoi::xor) - .map(ij.gui.Roi.class::cast) - .orElse(roi); - xor.setStrokeColor(roi.getStrokeColor()); - xor.setPosition(roi.getCPosition(), roi.getZPosition(), roi.getTPosition()); - roi = xor; + // Handle 2D shapes using XOR (Rectangles, Ellipses and Polygons) + List toXOR = slice.stream() + .filter(s -> (s instanceof RectangleWrapper) + || (s instanceof EllipseWrapper) + || (s instanceof PolygonWrapper)) + .map(this::shapeToIJRoiWithName) + .collect(Collectors.toList()); + if (!toXOR.isEmpty()) { + rois.add(xor(toXOR)); } - if (txt.isEmpty()) { - roi.setName(String.format("%d-%d", getId(), shape.getId())); - } else { - roi.setName(txt); + + // Handle points by combining them + List points = slice.stream() + .filter(PointWrapper.class::isInstance) + .map(this::shapeToIJRoiWithName) + .map(PointRoi.class::cast) + .collect(Collectors.toList()); + if (!points.isEmpty()) { + rois.add(combine(points)); } - roi.setProperty(ijIDProperty(property), String.valueOf(getId())); - rois.add(roi); + + // Simply convert and add the others + slice.stream() + .filter(s -> !(s instanceof RectangleWrapper) + && !(s instanceof EllipseWrapper) + && !(s instanceof PolygonWrapper) + && !(s instanceof PointWrapper)) + .map(this::shapeToIJRoiWithName) + .forEachOrdered(rois::add); + + // Add properties + rois.forEach(r -> r.setProperty(ijIDProperty, roiID)); + rois.forEach(r -> r.setProperty(ijNameProperty, getName())); } return rois; } diff --git a/src/main/java/fr/igred/omero/roi/RectangleWrapper.java b/src/main/java/fr/igred/omero/roi/RectangleWrapper.java index 06b47e90..df2d6210 100644 --- a/src/main/java/fr/igred/omero/roi/RectangleWrapper.java +++ b/src/main/java/fr/igred/omero/roi/RectangleWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/roi/ShapeList.java b/src/main/java/fr/igred/omero/roi/ShapeList.java index cce1f3fc..f9fe30f7 100644 --- a/src/main/java/fr/igred/omero/roi/ShapeList.java +++ b/src/main/java/fr/igred/omero/roi/ShapeList.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/roi/TextWrapper.java b/src/main/java/fr/igred/omero/roi/TextWrapper.java index a9c5cfe9..ad2568ce 100644 --- a/src/main/java/fr/igred/omero/roi/TextWrapper.java +++ b/src/main/java/fr/igred/omero/roi/TextWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/roi/package-info.java b/src/main/java/fr/igred/omero/roi/package-info.java index b2901e72..f377c2c0 100644 --- a/src/main/java/fr/igred/omero/roi/package-info.java +++ b/src/main/java/fr/igred/omero/roi/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/util/LibraryChecker.java b/src/main/java/fr/igred/omero/util/LibraryChecker.java index 013dda5b..1de59670 100644 --- a/src/main/java/fr/igred/omero/util/LibraryChecker.java +++ b/src/main/java/fr/igred/omero/util/LibraryChecker.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/util/Wrapper.java b/src/main/java/fr/igred/omero/util/Wrapper.java index 40276ceb..cd94e94e 100644 --- a/src/main/java/fr/igred/omero/util/Wrapper.java +++ b/src/main/java/fr/igred/omero/util/Wrapper.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/main/java/fr/igred/omero/util/package-info.java b/src/main/java/fr/igred/omero/util/package-info.java index 06c28503..1ac1583a 100644 --- a/src/main/java/fr/igred/omero/util/package-info.java +++ b/src/main/java/fr/igred/omero/util/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/BasicTest.java b/src/test/java/fr/igred/omero/BasicTest.java index 74ca4cfe..f56df760 100644 --- a/src/test/java/fr/igred/omero/BasicTest.java +++ b/src/test/java/fr/igred/omero/BasicTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/ClientTest.java b/src/test/java/fr/igred/omero/ClientTest.java index 1be2b7c2..440e19b2 100644 --- a/src/test/java/fr/igred/omero/ClientTest.java +++ b/src/test/java/fr/igred/omero/ClientTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/ConnectionTest.java b/src/test/java/fr/igred/omero/ConnectionTest.java index c2a7e7e4..0c2daa1d 100644 --- a/src/test/java/fr/igred/omero/ConnectionTest.java +++ b/src/test/java/fr/igred/omero/ConnectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/LoggingExtension.java b/src/test/java/fr/igred/omero/LoggingExtension.java index 96ecce10..239da804 100644 --- a/src/test/java/fr/igred/omero/LoggingExtension.java +++ b/src/test/java/fr/igred/omero/LoggingExtension.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/RootTest.java b/src/test/java/fr/igred/omero/RootTest.java index c2d5227b..52a428f2 100644 --- a/src/test/java/fr/igred/omero/RootTest.java +++ b/src/test/java/fr/igred/omero/RootTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/SudoTest.java b/src/test/java/fr/igred/omero/SudoTest.java index 37577fd6..1034a93f 100644 --- a/src/test/java/fr/igred/omero/SudoTest.java +++ b/src/test/java/fr/igred/omero/SudoTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/TestObject.java b/src/test/java/fr/igred/omero/TestObject.java index cb7d15ad..3cacbf1c 100644 --- a/src/test/java/fr/igred/omero/TestObject.java +++ b/src/test/java/fr/igred/omero/TestObject.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/UserTest.java b/src/test/java/fr/igred/omero/UserTest.java index 52bfaa2d..8cdbe7fe 100644 --- a/src/test/java/fr/igred/omero/UserTest.java +++ b/src/test/java/fr/igred/omero/UserTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/annotations/ImageJTableTest.java b/src/test/java/fr/igred/omero/annotations/ImageJTableTest.java index 80e12674..4ef776dc 100644 --- a/src/test/java/fr/igred/omero/annotations/ImageJTableTest.java +++ b/src/test/java/fr/igred/omero/annotations/ImageJTableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/annotations/MapAnnotationTest.java b/src/test/java/fr/igred/omero/annotations/MapAnnotationTest.java index ac3e5c61..1f064d80 100644 --- a/src/test/java/fr/igred/omero/annotations/MapAnnotationTest.java +++ b/src/test/java/fr/igred/omero/annotations/MapAnnotationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/annotations/RatingAnnotationTest.java b/src/test/java/fr/igred/omero/annotations/RatingAnnotationTest.java index adb141f3..31aa2676 100644 --- a/src/test/java/fr/igred/omero/annotations/RatingAnnotationTest.java +++ b/src/test/java/fr/igred/omero/annotations/RatingAnnotationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/annotations/TableTest.java b/src/test/java/fr/igred/omero/annotations/TableTest.java index fdf33d07..14983c2e 100644 --- a/src/test/java/fr/igred/omero/annotations/TableTest.java +++ b/src/test/java/fr/igred/omero/annotations/TableTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/annotations/TagSetTest.java b/src/test/java/fr/igred/omero/annotations/TagSetTest.java index 4cd4c500..d060ed6c 100644 --- a/src/test/java/fr/igred/omero/annotations/TagSetTest.java +++ b/src/test/java/fr/igred/omero/annotations/TagSetTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/annotations/TagTest.java b/src/test/java/fr/igred/omero/annotations/TagTest.java index 58dc5ec5..167764ae 100644 --- a/src/test/java/fr/igred/omero/annotations/TagTest.java +++ b/src/test/java/fr/igred/omero/annotations/TagTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/annotations/TextualAnnotationTest.java b/src/test/java/fr/igred/omero/annotations/TextualAnnotationTest.java index 31da2282..77c4fbe2 100644 --- a/src/test/java/fr/igred/omero/annotations/TextualAnnotationTest.java +++ b/src/test/java/fr/igred/omero/annotations/TextualAnnotationTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/exception/AccessExceptionTest.java b/src/test/java/fr/igred/omero/exception/AccessExceptionTest.java index 1aa86fdb..eef9712d 100644 --- a/src/test/java/fr/igred/omero/exception/AccessExceptionTest.java +++ b/src/test/java/fr/igred/omero/exception/AccessExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/exception/ExceptionTest.java b/src/test/java/fr/igred/omero/exception/ExceptionTest.java index 80d49805..7fb5dca3 100644 --- a/src/test/java/fr/igred/omero/exception/ExceptionTest.java +++ b/src/test/java/fr/igred/omero/exception/ExceptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/meta/ExperimenterTest.java b/src/test/java/fr/igred/omero/meta/ExperimenterTest.java index fce13742..029b13d9 100644 --- a/src/test/java/fr/igred/omero/meta/ExperimenterTest.java +++ b/src/test/java/fr/igred/omero/meta/ExperimenterTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/meta/GroupTest.java b/src/test/java/fr/igred/omero/meta/GroupTest.java index a2e35a3e..9784c0f6 100644 --- a/src/test/java/fr/igred/omero/meta/GroupTest.java +++ b/src/test/java/fr/igred/omero/meta/GroupTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/meta/PlaneInfoWrapperTest.java b/src/test/java/fr/igred/omero/meta/PlaneInfoWrapperTest.java index a8a4a14c..a5aea1dc 100644 --- a/src/test/java/fr/igred/omero/meta/PlaneInfoWrapperTest.java +++ b/src/test/java/fr/igred/omero/meta/PlaneInfoWrapperTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/repository/ChannelTest.java b/src/test/java/fr/igred/omero/repository/ChannelTest.java index e8f2d9df..b0859714 100644 --- a/src/test/java/fr/igred/omero/repository/ChannelTest.java +++ b/src/test/java/fr/igred/omero/repository/ChannelTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/repository/DatasetTest.java b/src/test/java/fr/igred/omero/repository/DatasetTest.java index 761f7156..2ea85f58 100644 --- a/src/test/java/fr/igred/omero/repository/DatasetTest.java +++ b/src/test/java/fr/igred/omero/repository/DatasetTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/repository/FolderTest.java b/src/test/java/fr/igred/omero/repository/FolderTest.java index 2438ef56..3c7e32d7 100644 --- a/src/test/java/fr/igred/omero/repository/FolderTest.java +++ b/src/test/java/fr/igred/omero/repository/FolderTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/repository/ImageImportTest.java b/src/test/java/fr/igred/omero/repository/ImageImportTest.java index 0d1890c4..00b45297 100644 --- a/src/test/java/fr/igred/omero/repository/ImageImportTest.java +++ b/src/test/java/fr/igred/omero/repository/ImageImportTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/repository/ImageTest.java b/src/test/java/fr/igred/omero/repository/ImageTest.java index 1bf4e778..771f8a30 100644 --- a/src/test/java/fr/igred/omero/repository/ImageTest.java +++ b/src/test/java/fr/igred/omero/repository/ImageTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/repository/PixelsTest.java b/src/test/java/fr/igred/omero/repository/PixelsTest.java index 4e03e1cd..d11a49b7 100644 --- a/src/test/java/fr/igred/omero/repository/PixelsTest.java +++ b/src/test/java/fr/igred/omero/repository/PixelsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/repository/PlateAcquisitionTest.java b/src/test/java/fr/igred/omero/repository/PlateAcquisitionTest.java index 3d5206aa..398251ad 100644 --- a/src/test/java/fr/igred/omero/repository/PlateAcquisitionTest.java +++ b/src/test/java/fr/igred/omero/repository/PlateAcquisitionTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/repository/PlateTest.java b/src/test/java/fr/igred/omero/repository/PlateTest.java index 5aa4d280..122a564c 100644 --- a/src/test/java/fr/igred/omero/repository/PlateTest.java +++ b/src/test/java/fr/igred/omero/repository/PlateTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/repository/ProjectTest.java b/src/test/java/fr/igred/omero/repository/ProjectTest.java index ba3c6838..81332865 100644 --- a/src/test/java/fr/igred/omero/repository/ProjectTest.java +++ b/src/test/java/fr/igred/omero/repository/ProjectTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/repository/ScreenTest.java b/src/test/java/fr/igred/omero/repository/ScreenTest.java index a404a77e..0d27d54b 100644 --- a/src/test/java/fr/igred/omero/repository/ScreenTest.java +++ b/src/test/java/fr/igred/omero/repository/ScreenTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/repository/WellSampleTest.java b/src/test/java/fr/igred/omero/repository/WellSampleTest.java index 980fe691..82d46171 100644 --- a/src/test/java/fr/igred/omero/repository/WellSampleTest.java +++ b/src/test/java/fr/igred/omero/repository/WellSampleTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/repository/WellTest.java b/src/test/java/fr/igred/omero/repository/WellTest.java index f19c8587..5c5d68af 100644 --- a/src/test/java/fr/igred/omero/repository/WellTest.java +++ b/src/test/java/fr/igred/omero/repository/WellTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/roi/ROI2ImageJTest.java b/src/test/java/fr/igred/omero/roi/ROI2ImageJTest.java index 672d3815..2876a873 100644 --- a/src/test/java/fr/igred/omero/roi/ROI2ImageJTest.java +++ b/src/test/java/fr/igred/omero/roi/ROI2ImageJTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software @@ -31,8 +31,11 @@ import ij.gui.ShapeRoi; import ij.gui.TextRoi; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; import java.awt.Color; +import java.awt.Font; import java.awt.geom.AffineTransform; import java.awt.geom.Ellipse2D; import java.awt.geom.Point2D; @@ -41,7 +44,9 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; import static org.junit.jupiter.api.Assertions.assertNull; @@ -325,23 +330,40 @@ void convertMask() { MaskWrapper mask = new MaskWrapper(); mask.setCoordinates(3, 3, 10, 10); mask.setCZT(0, 0, 2); + mask.setFill(Color.WHITE); - Roi ijRectangle = mask.toImageJ(); - assertEquals(mask.toAWTShape().getBounds(), ijRectangle.getBounds()); + int[][] maskPixels = new int[10][10]; + for (int i = 0; i < 10; i++) { + for (int j = 0; j < 10; j++) { + if (i > 3 && i < 7 && j > 4 && j < 8) { + maskPixels[i][j] = 1; + } + } + } + mask.setMask(maskPixels); + + Roi imgRoi = mask.toImageJ(); + assertEquals(mask.toAWTShape().getBounds(), imgRoi.getBounds()); List roiList = new ArrayList<>(1); - roiList.add(ijRectangle); + roiList.add(imgRoi); ROIWrapper roi = ROIWrapper.fromImageJ(roiList).get(0); - RectangleWrapper newRectangle = roi.getShapes().getElementsOf(RectangleWrapper.class).get(0); + MaskWrapper newMask = roi.getShapes().getElementsOf(MaskWrapper.class).get(0); + int[][] checkMask = newMask.getMaskAsBinaryArray(); + + assertEquals(mask.getX(), newMask.getX(), Double.MIN_VALUE); + assertEquals(mask.getY(), newMask.getY(), Double.MIN_VALUE); + assertEquals(mask.getWidth(), newMask.getWidth(), Double.MIN_VALUE); + assertEquals(mask.getHeight(), newMask.getHeight(), Double.MIN_VALUE); + assertEquals(mask.getC(), newMask.getC()); + assertEquals(mask.getZ(), newMask.getZ()); + assertEquals(mask.getT(), newMask.getT()); + assertEquals(maskPixels.length, checkMask.length); + for (int i = 0; i < maskPixels.length; i++) { + assertArrayEquals(maskPixels[i], checkMask[i]); + } - assertEquals(mask.getX(), newRectangle.getX(), Double.MIN_VALUE); - assertEquals(mask.getY(), newRectangle.getY(), Double.MIN_VALUE); - assertEquals(mask.getWidth(), newRectangle.getWidth(), Double.MIN_VALUE); - assertEquals(mask.getHeight(), newRectangle.getHeight(), Double.MIN_VALUE); - assertEquals(mask.getC(), newRectangle.getC()); - assertEquals(mask.getZ(), newRectangle.getZ()); - assertEquals(mask.getT(), newRectangle.getT()); } @@ -399,6 +421,30 @@ void convertText() { } + @ParameterizedTest(name = "{0}") + @ValueSource(ints = {Font.PLAIN, Font.BOLD, Font.ITALIC, Font.BOLD | Font.ITALIC}) + void convertText(int style) { + Font font = new Font("Arial", style, 25); + List roiList = new ArrayList<>(1); + TextRoi ijText = new TextRoi(3, 3, "Text"); + ijText.setAngle(33); + ijText.setFont(font); + roiList.add(ijText); + + Roi ijRoi = ROIWrapper.toImageJ(ROIWrapper.fromImageJ(roiList)).get(0); + + assertInstanceOf(TextRoi.class, ijRoi); + assertEquals(ijText.getXBase(), ijRoi.getXBase(), Double.MIN_VALUE); + assertEquals(ijText.getYBase(), ijRoi.getYBase(), Double.MIN_VALUE); + assertEquals(ijText.getAngle(), ijRoi.getAngle(), Double.MIN_VALUE); + + Font newFont = ((TextRoi) ijRoi).getCurrentFont(); + assertEquals(font.getFamily(), newFont.getFamily()); + assertEquals(font.getStyle(), newFont.getStyle()); + assertEquals(font.getSize(), newFont.getSize()); + } + + @Test void convertPolygon() { List points2D = new ArrayList<>(3); diff --git a/src/test/java/fr/igred/omero/roi/ROITest.java b/src/test/java/fr/igred/omero/roi/ROITest.java index 467708a2..4006f0ef 100644 --- a/src/test/java/fr/igred/omero/roi/ROITest.java +++ b/src/test/java/fr/igred/omero/roi/ROITest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/roi/ShapeErrorTest.java b/src/test/java/fr/igred/omero/roi/ShapeErrorTest.java index 83849b33..fe1c8751 100644 --- a/src/test/java/fr/igred/omero/roi/ShapeErrorTest.java +++ b/src/test/java/fr/igred/omero/roi/ShapeErrorTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/roi/ShapeTest.java b/src/test/java/fr/igred/omero/roi/ShapeTest.java index 9b4d3821..32ffd4b4 100644 --- a/src/test/java/fr/igred/omero/roi/ShapeTest.java +++ b/src/test/java/fr/igred/omero/roi/ShapeTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/util/LibraryCheckerTest.java b/src/test/java/fr/igred/omero/util/LibraryCheckerTest.java index 4f1ab800..d8fb8056 100644 --- a/src/test/java/fr/igred/omero/util/LibraryCheckerTest.java +++ b/src/test/java/fr/igred/omero/util/LibraryCheckerTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software diff --git a/src/test/java/fr/igred/omero/util/WrapperTest.java b/src/test/java/fr/igred/omero/util/WrapperTest.java index 54b0a5c2..ca5aa2b7 100644 --- a/src/test/java/fr/igred/omero/util/WrapperTest.java +++ b/src/test/java/fr/igred/omero/util/WrapperTest.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2020-2023 GReD + * Copyright (C) 2020-2024 GReD * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free Software