saalfeldlab / paintera

GNU General Public License v2.0
99 stars 17 forks source link

Cannot open project with label sources in deprecated format #407

Closed igorpisarev closed 4 years ago

igorpisarev commented 4 years ago

I have a project that references a label multiset data source in another location. I can only read from that location, so I can't convert this source to the new ConnectomicsLabelState format because it needs to modify the attributes of the actual dataset.

When I load this project in Paintera and choose Skip conversion, the loading fails with the following exception:

java.lang.NullPointerException
    at org.janelia.saalfeldlab.paintera.serialization.sourcestate.LabelSourceStateDeserializer.makeState(LabelSourceStateDeserializer.java:160)
    at org.janelia.saalfeldlab.paintera.serialization.sourcestate.LabelSourceStateDeserializer.makeState(LabelSourceStateDeserializer.java:44)
    at org.janelia.saalfeldlab.paintera.serialization.sourcestate.SourceStateSerialization$AbstractSourceStateDeserializer.deserialize(SourceStateSerialization.java:163)
    at org.janelia.saalfeldlab.paintera.serialization.sourcestate.SourceStateSerialization$SourceStateDeserializerWithoutDependencies.deserialize(SourceStateSerialization.java:186)
    at org.janelia.saalfeldlab.paintera.state.label.LabelSourceStateFallbackDeserializer.deserialize(LabelSourceStateFallbackDeserializer.kt:98)
    at org.janelia.saalfeldlab.paintera.state.label.LabelSourceStateFallbackDeserializer.deserialize(LabelSourceStateFallbackDeserializer.kt:37)
    at com.google.gson.internal.bind.TreeTypeAdapter.read(TreeTypeAdapter.java:69)
    at com.google.gson.Gson.fromJson(Gson.java:927)
    at com.google.gson.Gson.fromJson(Gson.java:994)
    at org.janelia.saalfeldlab.paintera.serialization.SourceInfoSerializer.makeStates(SourceInfoSerializer.java:176)
    at org.janelia.saalfeldlab.paintera.serialization.SourceInfoSerializer.populate(SourceInfoSerializer.java:115)
    at org.janelia.saalfeldlab.paintera.PainteraMainWindow.deserialize(PainteraMainWindow.kt:287)
    at org.janelia.saalfeldlab.paintera.PainteraMainWindow.deserialize(PainteraMainWindow.kt:175)
    at org.janelia.saalfeldlab.paintera.Paintera.start(Paintera.kt:43)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$419(LauncherImpl.java:863)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$399(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl.lambda$null$397(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$398(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run$$$capture(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java)
    at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
    at com.sun.glass.ui.gtk.GtkApplication.lambda$null$203(GtkApplication.java:139)
    at java.lang.Thread.run(Thread.java:748)
igorpisarev commented 4 years ago

It seems that the deserializer wants to set the parsed mesh settings here: https://github.com/saalfeldlab/paintera/blob/master/src/main/java/org/janelia/saalfeldlab/paintera/serialization/sourcestate/LabelSourceStateDeserializer.java#L160

but this fails because managedMeshSettings is null which is returned from here: https://github.com/saalfeldlab/paintera/blob/master/src/main/java/org/janelia/saalfeldlab/paintera/state/LabelSourceState.java#L193