Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit dec9888

Browse files
committed
Fix compile errors caused by the version updates
1 parent 167a5f7 commit dec9888

File tree

2 files changed

+12
-22
lines changed

2 files changed

+12
-22
lines changed

pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,17 @@
164164
<groupId>net.imagej</groupId>
165165
<artifactId>imagej</artifactId>
166166
</dependency>
167-
168167
<dependency>
169168
<groupId>net.imagej</groupId>
170169
<artifactId>imagej-ops</artifactId>
171170
</dependency>
172171

172+
<!-- ImageJ packages used in the converters -->
173+
<dependency>
174+
<groupId>net.imagej</groupId>
175+
<artifactId>ij</artifactId>
176+
</dependency>
177+
173178
<!-- Supported languages -->
174179
<dependency>
175180
<groupId>org.scijava</groupId>

src/main/java/net/imagej/notebook/DefaultImageJNotebookService.java

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
import net.imglib2.util.Pair;
4444
import net.imglib2.util.Util;
4545
import net.imglib2.view.IntervalView;
46-
import net.imglib2.view.MixedTransformView;
4746

4847
import org.scijava.log.LogService;
4948
import org.scijava.notebook.converter.NotebookConverters;
@@ -73,7 +72,7 @@ public <T extends RealType<T>> Object RAIToPNG(
7372
final int xAxis, final int yAxis, final int cAxis, //
7473
final ValueScaling scaling, final long... pos) {
7574

76-
final IntervalView<T> image = ops.transform().zeroMin(source);
75+
final IntervalView<T> image = ops.transform().zeroMinView(source);
7776

7877
final int w = xAxis >= 0 ? (int) image.dimension(xAxis) : 1;
7978
final int h = yAxis >= 0 ? (int) image.dimension(yAxis) : 1;
@@ -92,7 +91,7 @@ public <T extends RealType<T>> Object RAIToPNG(
9291
max = image.firstElement().getMaxValue();
9392
} else {
9493
// scale the intensities based on the sample values
95-
final IterableInterval<T> ii = ops.transform().flatIterable(source);
94+
final IterableInterval<T> ii = ops.transform().flatIterableView(source);
9695
final Pair<T, T> minMax = ops.stats().minMax(ii);
9796
min = minMax.getA().getRealDouble();
9897
max = minMax.getB().getRealDouble();
@@ -194,32 +193,18 @@ public <T extends RealType<T>> Object RAIToPNG(
194193
for (int d = 0; d < numDims; d++) {
195194
offset[d] = offsets[d][pos[d]];
196195
}
197-
final MixedTransformView<T> translated
198-
= //
199-
ops.transform().translate(ops.transform().zeroMin(images[i]), offset);
200-
201-
// Unfortunately, this operation loses the "Interval" from the RAI:
202-
// translated objects are RAs, not RAIs.
203-
// So, we readd the bounds to match the newly translated coordinates.
204-
// NB: The max bound is _inclusive_, so we must subtract 1.
205-
final long[] max = new long[numDims];
206-
for (int d = 0; d < numDims; d++) {
207-
max[d] = offset[d] + images[i].dimension(d) - 1;
208-
}
209-
final FinalInterval bounds = new FinalInterval(offset, max);
210-
final RandomAccessibleInterval<T> bounded
211-
= //
212-
ops.transform().interval(translated, bounds);
196+
final IntervalView<T> translated = //
197+
ops.transform().translateView(ops.transform().zeroMinView(images[i]), offset);
213198

214199
// Declare that all values outside the interval proper will be 0.
215200
// If we do not perform this step, we will get an error when querying
216201
// out-of-bounds coordinates.
217-
final RandomAccessible<T> extended = ops.transform().extendZero(bounded);
202+
final RandomAccessible<T> extended = ops.transform().extendZeroView(translated);
218203

219204
// Define the interval of the image to match the size of the mosaic.
220205
final RandomAccessibleInterval<T> expanded
221206
= //
222-
ops.transform().interval(extended, mosaicBox);
207+
ops.transform().intervalView(extended, mosaicBox);
223208

224209
// Add the full-size zero-padded translated image into the mosaic.
225210
Inplaces.binary1(ops, Ops.Math.Add.class, result, expanded).mutate1(

0 commit comments

Comments
 (0)