Skip to content

Commit

Permalink
BREAKING: bump to bigdataviewer-vistools-1.0.0-beta-34 (#269)
Browse files Browse the repository at this point in the history
* remove VolatileSource in favor of the upstream VolatileSource
  • Loading branch information
axtimwalde authored Feb 8, 2024
1 parent a436880 commit 8bdf6df
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
3 changes: 2 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<groupId>sc.fiji</groupId>
<artifactId>bigdataviewer-playground</artifactId>
<version>0.8.2-SNAPSHOT</version>
<version>0.9.0-SNAPSHOT</version>

<name>bigdataviewer-playground</name>
<description>BigDataViewer Actions and GUI</description>
Expand Down Expand Up @@ -125,6 +125,7 @@
<reflections.version>0.10.2</reflections.version> <!-- for test only -->

<!-- package version below are determined by the parent pom but need to be upgraded or temporarily fixed for bugs -->
<bigdataviewer-vistools.version>1.0.0-beta-34</bigdataviewer-vistools.version>

<n5.version>3.1.1</n5.version>
<n5-hdf5.version>2.1.0</n5-hdf5.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,17 +29,19 @@

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;
import net.imglib2.type.NativeType;
import net.imglib2.type.numeric.NumericType;
import sc.fiji.bdvpg.sourceandconverter.SourceAndConverterHelper;

import java.util.function.Function;

public class SourceResampler<T extends NumericType<T> & NativeType<T>>
implements Runnable, Function<SourceAndConverter<T>, SourceAndConverter<T>>
{
Expand All @@ -58,9 +60,9 @@ public class SourceResampler<T extends NumericType<T> & NativeType<T>>

private final String name;

public SourceResampler(SourceAndConverter<T> sac_in,
SourceAndConverter<?> model, String name, boolean reuseMipmaps,
boolean cache, boolean interpolate, int defaultMipMapLevel)
public SourceResampler(final SourceAndConverter<T> 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;
Expand All @@ -81,8 +83,8 @@ public SourceAndConverter<T> get() {
}

@Override
public SourceAndConverter<T> apply(SourceAndConverter<T> src) {
Source<T> srcRsampled = new ResampledSource<>(src.getSpimSource(), model
public SourceAndConverter<T> apply(final SourceAndConverter<T> src) {
final Source<T> srcRsampled = new ResampledSource<>(src.getSpimSource(), model
.getSpimSource(), name, reuseMipMaps, cache, interpolate,
defaultMipMapLevel);

Expand All @@ -91,7 +93,10 @@ public SourceAndConverter<T> apply(SourceAndConverter<T> src) {
SourceAndConverter<? extends Volatile<T>> vsac;
Source<? extends Volatile<T>> 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(),
Expand Down

0 comments on commit 8bdf6df

Please sign in to comment.