Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor display options #219

Merged
merged 26 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f6b9380
major : refactors move and rename scijava serialization mechanism. Ad…
NicoKiaru Apr 29, 2021
4dbde90
adds seme serialization test"
NicoKiaru Apr 30, 2021
38f2a98
adds deserialization of default bdv supplier
NicoKiaru Apr 30, 2021
dae9958
major refactoring of serialization classes / adapters
NicoKiaru Apr 30, 2021
76b2df9
adds command to set viewer preferences
NicoKiaru Apr 30, 2021
21300a5
improves active bdv preprocessor and simplify logic of setting a defa…
NicoKiaru May 1, 2021
7d0c21f
removes projector logic
NicoKiaru May 1, 2021
9801cae
bumps to new major version
NicoKiaru May 1, 2021
d6160c8
minor
NicoKiaru May 1, 2021
a8c0678
moves location of adapters - more convenient when next to class (or …
NicoKiaru May 1, 2021
cca00dc
sync serializer plugin with current version of sscijava-persist
NicoKiaru May 1, 2021
5eb37b9
verbose serializer and change key of Prefs to include a . character
NicoKiaru May 1, 2021
4376fa7
fix serialization issues
NicoKiaru May 3, 2021
797f602
removes DnD as well as editor behaviour
NicoKiaru May 4, 2021
f4f4fbe
Adds ICloneableConverter interface to allow for proper transfer of co…
NicoKiaru May 4, 2021
12f38bc
minor
NicoKiaru May 4, 2021
90f4557
provides a way to clone converters in repo that depends on bdv-playgr…
NicoKiaru May 4, 2021
fbcd666
fixes issue with _00 names in bigdataviewers + adds demo for adding c…
NicoKiaru May 4, 2021
d94ac48
removes spimdata extras dependency
NicoKiaru May 4, 2021
04abc25
little cleaning and refactoring
NicoKiaru May 4, 2021
9c30ccf
adds extension mechanism for proper handling of setup attributes when…
NicoKiaru May 5, 2021
c61bf16
adds scijava extensibility mechanism to deal with custom entities in …
NicoKiaru May 5, 2021
3cfe6d1
fix affinetransform serialization
NicoKiaru May 6, 2021
1cc8e87
fix temp version name
NicoKiaru May 7, 2021
fcf6a68
fix merge conflicts and remove some SOP statements
NicoKiaru May 7, 2021
0cee843
fixes #180
NicoKiaru May 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions bigdataviewer.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#
#Fri Feb 05 10:33:13 CET 2021
#Fri Apr 30 16:10:12 CEST 2021
scale-bar-bg-color=-16724788
show-text-overlay=true
show-multibox-overlay=true
show-multibox-overlay=false
show-scale-bar-in-movie=true
show-scale-bar=true
scale-bar-color=-1
23 changes: 23 additions & 0 deletions plugins/bdvpgsettings/bdvpg.editor.actions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[
"BDV - Set Number Of Timepoints",
"BDV - Show Sources (new Bdv window)",
"BDV - Screenshot",
"PopupLine",
"BDV - Remove Sources From BDV",
"Set Sources Color",
"Set Sources Brightness",
"Make Sources Invisible",
"Set Sources Projection Mode",
"PopupLine",
"Create New Source (Set LUT)",
"PopupLine",
"Manual Sources Transformation",
"Basic Transformation",
"Make Global Source Group",
"PopupLine",
"Inspect Sources",
"PopupLine",
"Add Metadata To Sources",
"PopupLine",
"Export Sources to XML/HDF5 Spimdataset"
]
1 change: 0 additions & 1 deletion plugins/bdvpgsettings/bdvpg.editor.actions.txt.default.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"BDV - Set Number Of Timepoints",
"BDV - Show Sources (new Bdv window)",
"BDV - Screenshot",
"PopupLine",
"BDV - Remove Sources From BDV",
"Set Sources Color",
Expand Down
37 changes: 37 additions & 0 deletions plugins/bdvpgsettings/bdvpg.tree.actions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[
"BDV - Show Sources",
"BDV - Show Sources (new Bdv window)",
"BDV - Zoom to source",
"BDV - Show Sources In Multiple BDV Windows",
"BDV - Set Number Of Timepoints",
"BDV - Create empty BDV window",
"BDV - Create Orthogonal Views",
"BDV - Screenshot",
"BDV - Synchronize Views",
"BDV - Remove Sources From BDV",
"PopupLine",
"Create Empty BVV Frame",
"Show Sources in BVV",
"PopupLine",
"Set Sources Color",
"Set Sources Brightness",
"Make Sources Invisible",
"Make Sources Visible",
"Set Sources Projection Mode",
"Create New Source (Set LUT)",
"Create New Source (Set Color)",
"PopupLine",
"Manual Sources Transformation",
"Basic Transformation",
"Make Global Source Group",
"PopupLine",
"Save BDVDataset",
"Inspect Sources",
"PopupLine",
"Add Metadata To Sources",
"Make Metadata Filter Node",
"PopupLine",
"Export Sources to XML/HDF5 Spimdataset",
"Delete Sources",
"PopupLine"
]
1 change: 0 additions & 1 deletion plugins/bdvpgsettings/bdvpg.tree.actions.txt.default.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"BDV - Set Number Of Timepoints",
"BDV - Create empty BDV window",
"BDV - Create Orthogonal Views",
"BDV - Screenshot",
"BDV - Synchronize Views",
"BDV - Remove Sources From BDV",
"PopupLine",
Expand Down
15 changes: 4 additions & 11 deletions 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.2.15-SNAPSHOT</version>
<version>0.3.0-SNAPSHOT</version>

<name>bigdataviewer-playground</name>
<description>BigDataViewer Actions and GUI</description>
Expand Down Expand Up @@ -92,7 +92,6 @@
<connection>scm:git:git://github.com/bigdataviewer/bigdataviewer-playground</connection>
<developerConnection>scm:git:[email protected]:bigdataviewer/bigdataviewer-playground</developerConnection>
<url>https://github.com/bigdataviewer/bigdataviewer-playground/</url>
<tag>bigdataviewer-playground-0.2.7</tag>
</scm>

<issueManagement>
Expand All @@ -118,12 +117,12 @@
<releaseProfiles>deploy-to-scijava</releaseProfiles>

<scijava.deleteOtherVersions>true</scijava.deleteOtherVersions>
<scijava.app.directory>C:/Users/nicol/Desktop/fiji-win64-bdv-playground/Fiji.app/</scijava.app.directory>
<!-- <scijava.app.directory>C:/Users/nicol/Desktop/fiji-win64-bdv-playground/Fiji.app/</scijava.app.directory> -->

<bigdataviewer-selector.version>0.1.8</bigdataviewer-selector.version>
<bigvolumeviewer.version>0.2.0</bigvolumeviewer.version>
<mastodon.version>1.0.0-beta-16</mastodon.version>
<bigdataviewer-spimdata-extras.version>0.1.0</bigdataviewer-spimdata-extras.version>
<mastodon.version>1.0.0-beta-17</mastodon.version>
<bigdataviewer-spimdata-extras.version>0.1.1</bigdataviewer-spimdata-extras.version>
<reflections.version>0.9.11</reflections.version>

<!-- package version below are determined by the parent pom but need to be upgraded -->
Expand Down Expand Up @@ -195,12 +194,6 @@
<artifactId>imglib2</artifactId>
</dependency>

<dependency>
<groupId>ch.epfl.biop</groupId>
<artifactId>bigdataviewer-spimdata-extras</artifactId>
<version>${bigdataviewer-spimdata-extras.version}</version>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
Expand Down
123 changes: 0 additions & 123 deletions src/main/java/bdv/util/ARGBColorConverterSetup.java

This file was deleted.

3 changes: 2 additions & 1 deletion src/main/java/bdv/util/EmptySource.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import net.imglib2.type.numeric.integer.UnsignedShortType;
import net.imglib2.view.ExtendedRandomAccessibleInterval;
import net.imglib2.view.Views;
import sc.fiji.bdvpg.scijava.adapter.source.EmptySourceAdapter;

import java.io.Serializable;
import java.util.function.BiConsumer;
Expand All @@ -48,7 +49,7 @@
* This source can be thus used to define a template in order to Resample another source
* with new bounds and voxel size, for instance as a model in {@link ResampledSource}
*
* Also this source can be serialized with the gson adapter {@link sc.fiji.bdvpg.services.serializers.plugins.EmptySourceAdapter}
* Also this source can be serialized with the gson adapter {@link EmptySourceAdapter}
* which is helpful to save such source easily.
*
*/
Expand Down
1 change: 1 addition & 0 deletions src/main/java/bdv/util/RAIHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import net.imglib2.util.Util;
import net.imglib2.view.Views;
import org.janelia.saalfeldlab.n5.imglib2.RandomAccessibleLoader;
//import org.janelia.saalfeldlab.n5.imglib2.RandomAccessibleLoader;

import static net.imglib2.img.basictypeaccess.AccessFlags.VOLATILE;
import static net.imglib2.type.PrimitiveType.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
package sc.fiji.bdvpg.services.serializers;
package net.imglib2.realtransform;

import com.google.gson.*;
import net.imglib2.realtransform.AffineTransform3D;
import org.scijava.plugin.Plugin;
import sc.fiji.bdvpg.services.serializers.plugins.IClassAdapter;

import sc.fiji.persist.IClassAdapter;
import java.lang.reflect.Type;

/**
* Affine transform 3D adapter
*/
@Plugin(type = IClassAdapter.class)
public class AffineTransform3DAdapter implements IClassAdapter<AffineTransform3D> {

Expand All @@ -58,4 +59,5 @@ public JsonElement serialize(AffineTransform3D affineTransform3D, Type type, Jso
public Class<? extends AffineTransform3D> getAdapterClass() {
return AffineTransform3D.class;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,30 @@
* POSSIBILITY OF SUCH DAMAGE.
* #L%
*/
package sc.fiji.bdvpg.services.serializers.plugins;
package net.imglib2.realtransform;

import org.scijava.plugin.PTService;
import org.scijava.plugin.PluginInfo;
import org.scijava.service.SciJavaService;
import org.scijava.plugin.Plugin;
import sc.fiji.persist.IClassRuntimeAdapter;

import java.util.List;
/**
* Runtime adapter for RealTransform
*/
@Plugin(type = IClassRuntimeAdapter.class)
public class AffineTransform3DRunTimeAdapter implements IClassRuntimeAdapter<RealTransform, AffineTransform3D> {

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

public interface BdvPlaygroundObjectAdapterService extends PTService<IBdvPlaygroundObjectAdapter>, SciJavaService {
@Override
public Class<? extends AffineTransform3D> getRunTimeClass() {
return AffineTransform3D.class;
}

//List<PluginInfo<IBdvPlaygroundObjectAdapter>> getAdapters(Class<? extends IBdvPlaygroundObjectAdapter> adapterClass);
@Override
public boolean useCustomAdapter() {
return false;
}

<PT extends IBdvPlaygroundObjectAdapter> List<PluginInfo<PT>> getAdapters(Class<PT> adapterClass);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

import com.google.gson.*;
import org.scijava.plugin.Plugin;
import sc.fiji.bdvpg.services.serializers.plugins.IClassRuntimeAdapter;
import sc.fiji.persist.IClassRuntimeAdapter;

import java.lang.reflect.Type;

Expand All @@ -57,6 +57,11 @@ public Class<? extends InvertibleRealTransformSequence> getRunTimeClass() {
return InvertibleRealTransformSequence.class;
}

@Override
public boolean useCustomAdapter() {
return true;
}

@Override
public InvertibleRealTransformSequence deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {
JsonObject obj = jsonElement.getAsJsonObject();
Expand All @@ -77,7 +82,7 @@ public InvertibleRealTransformSequence deserialize(JsonElement jsonElement, Type
if (transform instanceof InvertibleRealTransform) {
irts.add((InvertibleRealTransform) transform);
} else {
System.err.println("Deserialization eroor: "+transform+" of class "+transform.getClass().getSimpleName()+" is not invertible!");
System.err.println("Deserialization error: "+transform+" of class "+transform.getClass().getSimpleName()+" is not invertible!");
return null;
}
}
Expand All @@ -89,15 +94,10 @@ public InvertibleRealTransformSequence deserialize(JsonElement jsonElement, Type
@Override
public JsonElement serialize(InvertibleRealTransformSequence irts, Type type, JsonSerializationContext jsonSerializationContext) {
JsonObject obj = new JsonObject();

obj.addProperty("type", InvertibleRealTransformSequence.class.getSimpleName());

obj.addProperty("size", irts.transforms.size());

for (int iTransform = 0; iTransform<irts.transforms.size(); iTransform++) {
obj.add("realTransform_"+iTransform, jsonSerializationContext.serialize(irts.transforms.get(iTransform)));
obj.add("realTransform_"+iTransform, jsonSerializationContext.serialize(irts.transforms.get(iTransform), RealTransform.class));
}

return obj;
}
}
Loading