From c341197b47984b7972cc7e2dd55989b4d9f47912 Mon Sep 17 00:00:00 2001 From: tpietzsch Date: Thu, 28 Mar 2024 09:48:35 +0100 Subject: [PATCH 1/2] SNAPSHOT --- pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pom.xml b/pom.xml index ecb0be2..6e11b07 100644 --- a/pom.xml +++ b/pom.xml @@ -95,6 +95,12 @@ Aivar Grislis, Jonathan Hale, Grant Harris, Stefan Helfrich, Mark Hiner, Martin Horn, Steffen Jaensch, Lee Kamentsky, Larry Lindsey, Melissa Linkert, Mark Longair, Brian Northan, Nick Perry, Curtis Rueden, Johannes Schindelin, Jean-Yves Tinevez and Michael Zinsmaier. + + 6.3.1-SNAPSHOT + 4.0.3-SNAPSHOT + 1.0.0-beta-18-SNAPSHOT + 2.0.2-SNAPSHOT + true From 559fc6dbeb5f5d691d42d3044115a12ac90e072f Mon Sep 17 00:00:00 2001 From: tpietzsch Date: Thu, 28 Mar 2024 09:48:51 +0100 Subject: [PATCH 2/2] Implement Typed::getType --- .../cache/exampleclassifier/InstanceView.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/imglib2/cache/exampleclassifier/InstanceView.java b/src/main/java/net/imglib2/cache/exampleclassifier/InstanceView.java index d82e1a8..5d6eeb9 100644 --- a/src/main/java/net/imglib2/cache/exampleclassifier/InstanceView.java +++ b/src/main/java/net/imglib2/cache/exampleclassifier/InstanceView.java @@ -14,7 +14,6 @@ public class InstanceView< R extends RealType< R > > extends AbstractConvertedRandomAccessible< RealComposite< R >, Instance > { - final RandomAccessibleInterval< RealComposite< R > > source; private final Attribute[] attributes; @@ -38,14 +37,18 @@ public InstanceAccess< R > randomAccess( final Interval interval ) return randomAccess(); } - public static class InstanceAccess< R extends RealType< R > > extends AbstractConvertedRandomAccess< RealComposite< R >, Instance > + @Override + public Instance getType() { + return randomAccess().getType(); + } + public static class InstanceAccess< R extends RealType< R > > extends AbstractConvertedRandomAccess< RealComposite< R >, Instance > + { private final CompositeInstance< R > instance; private final Attribute[] attributes; - public InstanceAccess( final RandomAccess< RealComposite< R > > source, final Attribute[] attributes ) { super( source ); @@ -60,12 +63,17 @@ public Instance get() return instance; } + @Override + public Instance getType() + { + return instance; + } + @Override public InstanceAccess< R > copy() { return new InstanceAccess<>( source.copy(), attributes ); } - } // length of array is nFeatures + 1 ( for class attribute ) @@ -78,6 +86,4 @@ public static Attribute[] makeDefaultAttributes( final int nFeatures, final int attributes[ nFeatures ] = new Attribute( "class", IntStream.range( 0, nClasses ).mapToObj( i -> "" + i ).collect( Collectors.toList() ) ); return attributes; } - - }