Skip to content

Commit

Permalink
Merge pull request #654 from imagej/feature-rai-getType
Browse files Browse the repository at this point in the history
Addition of getType() API
  • Loading branch information
ctrueden authored Aug 29, 2024
2 parents d9d1528 + bd43d4f commit 1ffa597
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 6 deletions.
8 changes: 6 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>37.0.0</version>
<version>38.0.1</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -256,7 +256,11 @@
<!-- NB: Deploy releases to the SciJava Maven repository. -->
<releaseProfiles>sign,deploy-to-scijava</releaseProfiles>

<scijava-common.version>2.98.0</scijava-common.version>
<imglib2.version>7.1.0</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</imagej-common.version>
</properties>

<repositories>
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
2 changes: 1 addition & 1 deletion src/main/java/net/imagej/ops/labeling/MergeLabeling.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void compute(final ImgLabeling<L, I> input1,
{
if (mask != null) {
final IterableRegion iterable = Regions.iterable(mask);
final IterableInterval<LabelingType<L>> sample = Regions.sample(iterable,
final IterableInterval<LabelingType<L>> sample = Regions.sample(iterable.inside(),
output);
final RandomAccess<LabelingType<L>> randomAccess = input1.randomAccess();
final RandomAccess<LabelingType<L>> randomAccess2 = input2.randomAccess();
Expand Down

0 comments on commit 1ffa597

Please sign in to comment.