Skip to content

Commit ce975ce

Browse files
committed
Update imglib2 dependency to 4.6.0 so we can use Views.expand
1 parent bbd9383 commit ce975ce

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ Jean-Yves Tinevez and Michael Zinsmaier.</license.copyrightOwners>
206206
<dependency>
207207
<groupId>net.imglib2</groupId>
208208
<artifactId>imglib2</artifactId>
209+
<version>4.6.0</version>
209210
</dependency>
210211
<dependency>
211212
<groupId>net.imglib2</groupId>

src/main/java/net/imglib2/algorithm/localextrema/LocalExtrema.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,7 @@ public static < T > IntervalView< T > shrink( final RandomAccessibleInterval< T
533533
assert Arrays.stream( margin ).min().getAsLong() >= 0: "Margin cannot be negative";
534534
assert IntStream.range( 0, margin.length ).mapToLong( d -> source.dimension( d ) - 2 * margin[ d ] ).min().getAsLong() >= 0: "Margin bigger than input";
535535

536-
final long[] min = IntStream.range( 0, margin.length ).mapToLong( d -> source.min( d ) + margin[ d ] ).toArray();
537-
final long[] max = IntStream.range( 0, margin.length ).mapToLong( d -> source.max( d ) - margin[ d ] ).toArray();
538-
539-
return Views.interval( source, new FinalInterval( min, max ) );
540-
536+
return Views.expandBorder( source, Arrays.stream(margin).map(m -> -m).toArray());
541537
}
542538

543539
/**

0 commit comments

Comments
 (0)