From ccb600e8841eb8f94cbd6f779711e3729b12d36a Mon Sep 17 00:00:00 2001 From: tpietzsch Date: Fri, 5 Apr 2024 16:43:05 +0200 Subject: [PATCH 1/5] WIP: Update to ImgLib2 v7 Depends on upgrade of imagej-common. * Add missing getType() implementations * Follow API changes from https://github.com/imglib/imglib2-roi/pull/71 Signed-off-by: Curtis Rueden --- pom.xml | 7 +++++++ src/main/java/net/imagej/ops/coloc/ShuffledView.java | 6 ++++++ .../net/imagej/ops/geom/geom3d/DefaultInertiaTensor3D.java | 4 ++-- .../java/net/imagej/ops/image/watershed/Watershed.java | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ecad4f267..d4924bc44 100644 --- a/pom.xml +++ b/pom.xml @@ -256,6 +256,13 @@ sign,deploy-to-scijava + 7.0.3 + 4.0.3 + 0.15.0 + 0.15.3 + 2.1.1-SNAPSHOT + true + 2.98.0 diff --git a/src/main/java/net/imagej/ops/coloc/ShuffledView.java b/src/main/java/net/imagej/ops/coloc/ShuffledView.java index b41f762bd..164fc2868 100644 --- a/src/main/java/net/imagej/ops/coloc/ShuffledView.java +++ b/src/main/java/net/imagej/ops/coloc/ShuffledView.java @@ -134,6 +134,12 @@ public RandomAccess randomAccess(final Interval interval) { return randomAccess(); // FIXME } + @Override + public T getType() + { + return image.getType(); + } + private class ShuffledRandomAccess extends Point implements RandomAccess { private final RandomAccess imageRA; private final long[] blockPos; diff --git a/src/main/java/net/imagej/ops/geom/geom3d/DefaultInertiaTensor3D.java b/src/main/java/net/imagej/ops/geom/geom3d/DefaultInertiaTensor3D.java index 7f5970ee7..ac5da2ede 100644 --- a/src/main/java/net/imagej/ops/geom/geom3d/DefaultInertiaTensor3D.java +++ b/src/main/java/net/imagej/ops/geom/geom3d/DefaultInertiaTensor3D.java @@ -66,7 +66,7 @@ public void initialize() { @Override public RealMatrix calculate(final IterableRegion input) { final BlockRealMatrix output = new BlockRealMatrix(3, 3); - Cursor c = input.localizingCursor(); + Cursor c = input.inside().localizingCursor(); double[] pos = new double[3]; double[] computedCentroid = new double[3]; centroid.calculate(input).localize(computedCentroid); @@ -87,7 +87,7 @@ public RealMatrix calculate(final IterableRegion input) { output.setEntry(2, 1, output.getEntry(1, 2)); } - final double size = input.size(); + final double size = input.inside().size(); output.setEntry(0, 0, output.getEntry(0, 0) / size); output.setEntry(0, 1, output.getEntry(0, 1) / size); output.setEntry(0, 2, output.getEntry(0, 2) / size); diff --git a/src/main/java/net/imagej/ops/image/watershed/Watershed.java b/src/main/java/net/imagej/ops/image/watershed/Watershed.java index 57f66b4aa..4cf558690 100644 --- a/src/main/java/net/imagej/ops/image/watershed/Watershed.java +++ b/src/main/java/net/imagej/ops/image/watershed/Watershed.java @@ -137,7 +137,7 @@ public void compute(final RandomAccessibleInterval in, final ImgLabeling imiList = new ArrayList<>(); if (mask != null) { - final Cursor c = Regions.iterable(mask).localizingCursor(); + final Cursor c = Regions.iterable(mask).inside().localizingCursor(); while (c.hasNext()) { c.next(); imiList.add(IntervalIndexer.positionToIndex(c, in)); From 07c65b9f6c4f2202e29c9bd50bc7c69a78e5f2cf Mon Sep 17 00:00:00 2001 From: tpietzsch Date: Wed, 28 Aug 2024 13:30:42 +0200 Subject: [PATCH 2/5] Fix remaining compile error (related to imglib/imglib2-roi#71) --- src/main/java/net/imagej/ops/labeling/MergeLabeling.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/net/imagej/ops/labeling/MergeLabeling.java b/src/main/java/net/imagej/ops/labeling/MergeLabeling.java index a2d2b1499..27ddf7310 100644 --- a/src/main/java/net/imagej/ops/labeling/MergeLabeling.java +++ b/src/main/java/net/imagej/ops/labeling/MergeLabeling.java @@ -92,7 +92,7 @@ public void compute(final ImgLabeling input1, { if (mask != null) { final IterableRegion iterable = Regions.iterable(mask); - final IterableInterval> sample = Regions.sample(iterable, + final IterableInterval> sample = Regions.sample(iterable.inside(), output); final RandomAccess> randomAccess = input1.randomAccess(); final RandomAccess> randomAccess2 = input2.randomAccess(); From 142aac2f488c00a182d28121fe9a69ed50c058eb Mon Sep 17 00:00:00 2001 From: tpietzsch Date: Wed, 28 Aug 2024 13:31:34 +0200 Subject: [PATCH 3/5] POM: Bump parent to pom-scijava-38.0.1 --- pom.xml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index d4924bc44..185e97329 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.scijava pom-scijava - 37.0.0 + 38.0.1 @@ -262,8 +262,6 @@ 0.15.3 2.1.1-SNAPSHOT true - - 2.98.0 From 9fc76dcf56d51f2ff4121dfcc18ce279269e05d9 Mon Sep 17 00:00:00 2001 From: tpietzsch Date: Wed, 28 Aug 2024 13:31:52 +0200 Subject: [PATCH 4/5] POM: Bump dependency versions: imglib2 -> 7.1.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 185e97329..beb4953b5 100644 --- a/pom.xml +++ b/pom.xml @@ -256,7 +256,7 @@ sign,deploy-to-scijava - 7.0.3 + 7.1.0 4.0.3 0.15.0 0.15.3 From bd43d4f91d869cd2a25b6ba06dbee5c446bc1340 Mon Sep 17 00:00:00 2001 From: Curtis Rueden Date: Wed, 28 Aug 2024 17:16:18 -0500 Subject: [PATCH 5/5] POM: update imagej-common to 2.1.1 --- pom.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index beb4953b5..08f733f3b 100644 --- a/pom.xml +++ b/pom.xml @@ -260,8 +260,7 @@ 4.0.3 0.15.0 0.15.3 - 2.1.1-SNAPSHOT - true + 2.1.1