From c100e5c8ec7d06e5807a197cbaf4ba39159f6d21 Mon Sep 17 00:00:00 2001 From: tpietzsch Date: Fri, 9 Aug 2024 21:35:47 +0200 Subject: [PATCH] Make PrimitiveBlocks.of(nio_backed_img) work --- src/main/java/net/imglib2/blocks/ViewPrimitiveBlocks.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/imglib2/blocks/ViewPrimitiveBlocks.java b/src/main/java/net/imglib2/blocks/ViewPrimitiveBlocks.java index ea581eaa4..699fed751 100644 --- a/src/main/java/net/imglib2/blocks/ViewPrimitiveBlocks.java +++ b/src/main/java/net/imglib2/blocks/ViewPrimitiveBlocks.java @@ -37,6 +37,7 @@ import java.util.function.Supplier; +import net.imglib2.img.basictypeaccess.nio.BufferAccess; import net.imglib2.transform.integer.MixedTransform; import net.imglib2.type.NativeType; import net.imglib2.type.PrimitiveType; @@ -67,7 +68,7 @@ public ViewPrimitiveBlocks( final ViewProperties< T, R > props ) { this.props = props; final PrimitiveType primitiveType = props.getRootType().getNativeTypeFactory().getPrimitiveType(); - final MemCopy memCopy = MemCopy.forPrimitiveType( primitiveType ); + final MemCopy memCopy = MemCopy.forPrimitiveType( primitiveType, props.getRootAccessType() instanceof BufferAccess, false ); final Extension extension = props.getExtension() != null ? props.getExtension() : Extension.border(); final Object oob = extractOobValue( props.getRootType(), extension ); final Ranges findRanges = Ranges.forExtension( extension );