Skip to content

Commit

Permalink
WIP: Update to ImgLib2 v7
Browse files Browse the repository at this point in the history
Depends on upgrade of imagej-common.

* Add missing getType() implementations
* Follow API changes from imglib/imglib2-roi#71

Signed-off-by: Curtis Rueden <[email protected]>
  • Loading branch information
tpietzsch authored and ctrueden committed Jun 11, 2024
1 parent d9d1528 commit ccb600e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
7 changes: 7 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,13 @@
<!-- NB: Deploy releases to the SciJava Maven repository. -->
<releaseProfiles>sign,deploy-to-scijava</releaseProfiles>

<imglib2.version>7.0.3</imglib2.version>
<imglib2-realtransform.version>4.0.3</imglib2-realtransform.version>
<imglib2-roi.version>0.15.0</imglib2-roi.version>
<imglib2-algorithm.version>0.15.3</imglib2-algorithm.version>
<imagej-common.version>2.1.1-SNAPSHOT</imagej-common.version>
<enforcer.skip>true</enforcer.skip>

<scijava-common.version>2.98.0</scijava-common.version>
</properties>

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/net/imagej/ops/coloc/ShuffledView.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ public RandomAccess<T> randomAccess(final Interval interval) {
return randomAccess(); // FIXME
}

@Override
public T getType()
{
return image.getType();
}

private class ShuffledRandomAccess extends Point implements RandomAccess<T> {
private final RandomAccess<T> imageRA;
private final long[] blockPos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public void initialize() {
@Override
public RealMatrix calculate(final IterableRegion<B> input) {
final BlockRealMatrix output = new BlockRealMatrix(3, 3);
Cursor<Void> c = input.localizingCursor();
Cursor<Void> c = input.inside().localizingCursor();
double[] pos = new double[3];
double[] computedCentroid = new double[3];
centroid.calculate(input).localize(computedCentroid);
Expand All @@ -87,7 +87,7 @@ public RealMatrix calculate(final IterableRegion<B> 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void compute(final RandomAccessibleInterval<T> in, final ImgLabeling<Inte
final List<Long> imiList = new ArrayList<>();

if (mask != null) {
final Cursor<Void> c = Regions.iterable(mask).localizingCursor();
final Cursor<Void> c = Regions.iterable(mask).inside().localizingCursor();
while (c.hasNext()) {
c.next();
imiList.add(IntervalIndexer.positionToIndex(c, in));
Expand Down

0 comments on commit ccb600e

Please sign in to comment.