Skip to content

Commit

Permalink
Adapts to changes related to https://forum.image.sc/t/updated-ngff-su…
Browse files Browse the repository at this point in the history
…pport-in-fiji-hdf5-n5-zarr-ome-ngff/91705

SNAPSHOT parent pom - build will fail
  • Loading branch information
NicoKiaru committed Feb 7, 2024
1 parent 05c48ee commit 96b8010
Show file tree
Hide file tree
Showing 8 changed files with 387 additions and 323 deletions.
13 changes: 7 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.scijava</groupId>
<artifactId>pom-scijava</artifactId>
<version>37.0.0</version>
<version>37.1.0-SNAPSHOT</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -162,11 +162,6 @@
<version>${bigvolumeviewer.version}</version>
</dependency>

<dependency>
<groupId>sc.fiji</groupId>
<artifactId>bigwarp_fiji</artifactId>
</dependency>

<dependency>
<groupId>net.imglib2</groupId>
<artifactId>imglib2</artifactId>
Expand All @@ -186,6 +181,12 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>sc.fiji</groupId>
<artifactId>bigwarp_fiji</artifactId>
<version>9.1.0</version>
</dependency>

<dependency>
<groupId>net.imagej</groupId>
<artifactId>imagej</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
import java.util.concurrent.ConcurrentHashMap;

/**
* A {@link VolatileSource} simply wraps and cache volatileviews of a
* A {@link WrapVolatileSource} simply wraps and cache volatileviews of a
* {@link Source} which can be made Volatile thanks to
* {@link VolatileViews#wrapAsVolatile} That's not always possible! A
* {@link SharedQueue} can be passed as an argument in the constructor to
Expand All @@ -66,7 +66,7 @@
* @param <V> {@link Volatile} type
*/

public class VolatileSource<T extends NumericType<T>, V extends Volatile<T> & NumericType<V>>
public class WrapVolatileSource<T extends NumericType<T>, V extends Volatile<T> & NumericType<V>>
implements Source<V>
{

Expand All @@ -80,12 +80,12 @@ public class VolatileSource<T extends NumericType<T>, V extends Volatile<T> & Nu
final ConcurrentHashMap<Integer, ConcurrentHashMap<Integer, RandomAccessibleInterval<V>>> cachedRAIs =
new ConcurrentHashMap<>();

public VolatileSource(final Source<T> source) {
public WrapVolatileSource(final Source<T> source) {
this.originSource = source;
queue = new SharedQueue(2);
}

public VolatileSource(final Source<T> originSource, final SharedQueue queue) {
public WrapVolatileSource(final Source<T> originSource, final SharedQueue queue) {
this.originSource = originSource;
this.queue = queue;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*-
* #%L
* BigDataViewer-Playground
* %%
* Copyright (C) 2019 - 2023 Nicolas Chiaruttini, EPFL - Robert Haase, MPI CBG - Christian Tischer, EMBL
* %%
* 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
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/

package net.imglib2.realtransform;

import org.scijava.plugin.Plugin;
import sc.fiji.persist.IClassRuntimeAdapter;

/**
* Adapter of an 2D transformed wrapped as 3D
*/

@Plugin(type = IClassRuntimeAdapter.class)
public class InvertibleWrapped2DTransformAs3DRealTransformRunTimeAdapter implements
IClassRuntimeAdapter<RealTransform, InvertibleWrapped2DTransformAs3D>
{
@Override
public Class<? extends RealTransform> getBaseClass() {
return RealTransform.class;
}

@Override
public Class<? extends InvertibleWrapped2DTransformAs3D> getRunTimeClass() {
return InvertibleWrapped2DTransformAs3D.class;
}

@Override
public boolean useCustomAdapter() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,11 @@ public Wrapped2DTransformAs3D deserialize(JsonElement jsonElement, Type type,
"wrappedTransform"), RealTransform.class);

if (!(rt instanceof InvertibleRealTransform)) {
logger.error(
"Wrapped transform not invertible -> deserialization impossible...");
return null;

return new Wrapped2DTransformAs3D(rt);
}

return new Wrapped2DTransformAs3D((InvertibleRealTransform) rt);
return new InvertibleWrapped2DTransformAs3D((InvertibleRealTransform) rt);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import bdv.util.ViewerPanelHandle;
import bdv.viewer.SourceAndConverter;
import bigwarp.BigWarp;
import bigwarp.BigWarpData;
import mpicbg.spim.data.SpimDataException;

import java.util.ArrayList;
Expand All @@ -50,7 +51,7 @@

public class BigWarpLauncher implements Runnable {

final BigWarp.BigWarpData<?> bwData;
final BigWarpData<?> bwData;

BigWarp<?> bigWarp;

Expand Down Expand Up @@ -116,7 +117,7 @@ public BigWarpLauncher(List<SourceAndConverter<?>> movingSources,
allConverterSetups.forEach(setup -> displaysettings.put(setup,
new double[] { setup.getDisplayRangeMin(), setup.getDisplayRangeMax() }));

bwData = new BigWarp.BigWarpData(allSources, allConverterSetups, null,
bwData = new BigWarpData(allSources, allConverterSetups, null,
mvSrcIndices, fxSrcIndices);

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
package sc.fiji.bdvpg.sourceandconverter.transform;

import bdv.util.ResampledSource;
import bdv.util.VolatileSource;
import bdv.util.WrapVolatileSource;
import bdv.viewer.Source;
import bdv.viewer.SourceAndConverter;
import net.imglib2.Volatile;
Expand Down Expand Up @@ -91,7 +91,7 @@ public SourceAndConverter<T> apply(SourceAndConverter<T> src) {
SourceAndConverter<? extends Volatile<T>> vsac;
Source<? extends Volatile<T>> vsrcResampled;
if (cache) {
vsrcResampled = new VolatileSource<>(srcRsampled);
vsrcResampled = new WrapVolatileSource<>(srcRsampled);
}
else {
vsrcResampled = new ResampledSource(src.asVolatile().getSpimSource(),
Expand Down
Loading

0 comments on commit 96b8010

Please sign in to comment.