From 8bdf6df474d1855522323ddc835b8d322439615f Mon Sep 17 00:00:00 2001 From: Stephan Saalfeld Date: Thu, 8 Feb 2024 04:53:21 -0500 Subject: [PATCH] BREAKING: bump to bigdataviewer-vistools-1.0.0-beta-34 (#269) * remove VolatileSource in favor of the upstream VolatileSource --- pom.xml | 3 ++- .../transform/SourceResampler.java | 27 +++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/pom.xml b/pom.xml index 3d9f5298..143466a8 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ sc.fiji bigdataviewer-playground - 0.8.2-SNAPSHOT + 0.9.0-SNAPSHOT bigdataviewer-playground BigDataViewer Actions and GUI @@ -125,6 +125,7 @@ 0.10.2 + 1.0.0-beta-34 3.1.1 2.1.0 diff --git a/src/main/java/sc/fiji/bdvpg/sourceandconverter/transform/SourceResampler.java b/src/main/java/sc/fiji/bdvpg/sourceandconverter/transform/SourceResampler.java index ad0dfd88..13d953d6 100644 --- a/src/main/java/sc/fiji/bdvpg/sourceandconverter/transform/SourceResampler.java +++ b/src/main/java/sc/fiji/bdvpg/sourceandconverter/transform/SourceResampler.java @@ -6,13 +6,13 @@ * %% * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: - * + * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -29,8 +29,12 @@ package sc.fiji.bdvpg.sourceandconverter.transform; +import java.util.function.Function; + +import bdv.cache.SharedQueue; import bdv.util.ResampledSource; -import bdv.util.WrapVolatileSource; +import bdv.util.VolatileSource; +import bdv.util.volatiles.VolatileTypeMatcher; import bdv.viewer.Source; import bdv.viewer.SourceAndConverter; import net.imglib2.Volatile; @@ -38,8 +42,6 @@ import net.imglib2.type.numeric.NumericType; import sc.fiji.bdvpg.sourceandconverter.SourceAndConverterHelper; -import java.util.function.Function; - public class SourceResampler & NativeType> implements Runnable, Function, SourceAndConverter> { @@ -58,9 +60,9 @@ public class SourceResampler & NativeType> private final String name; - public SourceResampler(SourceAndConverter sac_in, - SourceAndConverter model, String name, boolean reuseMipmaps, - boolean cache, boolean interpolate, int defaultMipMapLevel) + public SourceResampler(final SourceAndConverter sac_in, + final SourceAndConverter model, final String name, final boolean reuseMipmaps, + final boolean cache, final boolean interpolate, final int defaultMipMapLevel) { this.name = name; this.reuseMipMaps = reuseMipmaps; @@ -81,8 +83,8 @@ public SourceAndConverter get() { } @Override - public SourceAndConverter apply(SourceAndConverter src) { - Source srcRsampled = new ResampledSource<>(src.getSpimSource(), model + public SourceAndConverter apply(final SourceAndConverter src) { + final Source srcRsampled = new ResampledSource<>(src.getSpimSource(), model .getSpimSource(), name, reuseMipMaps, cache, interpolate, defaultMipMapLevel); @@ -91,7 +93,10 @@ public SourceAndConverter apply(SourceAndConverter src) { SourceAndConverter> vsac; Source> vsrcResampled; if (cache) { - vsrcResampled = new WrapVolatileSource<>(srcRsampled); + vsrcResampled = new VolatileSource( + srcRsampled, + () -> VolatileTypeMatcher.getVolatileTypeForType((NativeType)srcRsampled.getType()), + new SharedQueue(2); } else { vsrcResampled = new ResampledSource(src.asVolatile().getSpimSource(),