mobie / mobie-viewer-fiji

BSD 2-Clause "Simplified" License
33 stars 13 forks source link

manual transformation triggered with [T] no longer saved in views #1165

Open martinschorb opened 4 months ago

martinschorb commented 4 months ago

Hi, --- current release version --- when I apply a manual transformation and then right-click-> save view it no longer is applied in that view.

The generated view only contains an empty: "sourceTransforms": [],

This used to work when I last tried it end of April.

To reproduce:

tischi commented 4 months ago

Yes, this is in fact currently not supposed to work anymore.

You have to Right click => Choose Registration - Manual Transform.

I can look into whether one could make it work again but I am not sure...

tischi commented 4 months ago

The point is that the old behaviour tended to created a mess because it was very difficult to save a transformed version of an individual image. Now it forces you save another version (view) of the transformed image(s) (you can select multiple by grouping them in BDV).

But I agree, it would be nice to make it work with the [ T ]...probably I should hijack the [ T ] in MoBiE.

tischi commented 4 months ago

To clarify, I think:

Old logic: If you clicked [T] and then transformed one or more image(s), and the saved the current view, a view with all visible images, including the transformed ones would be saved. Like this it would be impossible to re-use the transformed image in another view.

New logic: The images that you transform are saved as individual transformed image views, such that they can be used to recompose more complex views, including those newly transformed images.

I guess both have pros and cons....

And I guess we would probably need to meet in person on a white-board to really figure this out :-)

tischi commented 4 months ago

ImgLib2 news and tutorials - User-configurable Keymaps

tischi commented 4 months ago

issue branch: issue-1165

tischi commented 4 months ago

@schorb this is how the manual transform command should look like:

image

TODO

martinschorb commented 4 months ago

that would be great!

martinschorb commented 4 months ago

However, I think as it is currently implemented the list would only contain visible sources. Usually you want to register multiple channels while only using one of them for the registration. Would it be possible to list all active/loaded sources independent of being shown or not?

tischi commented 4 months ago

Would it be possible to list all active/loaded sources independent of being shown or not?

Yes, I will change that.

martinschorb commented 4 months ago

btw: https://mobie.github.io/tutorials/volume_registration.html

martinschorb commented 4 months ago

When you open another view but leave the manual registration window open, it crashes, even though the sources it lists are shown. (I guess the BDV IDs change). Would it make sense to auto-close the registration window when accepting a registration?

[ERROR] org.scijava.module.MethodCallException: Error executing method: org.embl.mobie.command.context.ManualTransformationCommand#setMovingImages
    at org.scijava.module.MethodRef.execute(MethodRef.java:71)
    at org.scijava.module.AbstractModuleItem.callback(AbstractModuleItem.java:227)
    at org.scijava.widget.DefaultWidgetModel.callback(DefaultWidgetModel.java:179)
    at org.scijava.widget.DefaultWidgetModel.lambda$setValue$0(DefaultWidgetModel.java:169)
    at org.scijava.thread.DefaultThreadService.lambda$wrap$1(DefaultThreadService.java:233)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.scijava.module.MethodRef.execute(MethodRef.java:67)
    ... 18 more
Caused by: java.lang.NullPointerException
    at org.embl.mobie.command.context.AbstractTransformationCommand.lambda$setMovingImages$5(AbstractTransformationCommand.java:201)
    at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
    at java.util.Collections$2.tryAdvance(Collections.java:4719)
    at java.util.Collections$2.forEachRemaining(Collections.java:4727)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
    at org.embl.mobie.command.context.AbstractTransformationCommand.setMovingImages(AbstractTransformationCommand.java:202)
    ... 23 more
tischi commented 4 months ago

Tutorial

great! let's continue discussion here: https://github.com/mobie/mobie.github.io/issues/111

Auto closing the registration window

Yes that would be good, but I have not yet figured out how to do this... let's continue here: https://github.com/mobie/mobie-viewer-fiji/issues/1166

martinschorb commented 4 months ago

Also, could the GUI in the view selection window be changed such that both the Save To and the selection group text box are hidden if the dropdown selectors do not point to "External JSON file" or "new selectiongroup" image

tischi commented 4 months ago

This would be great, but unfortunately I don't know how to achieve this (using the IJ Dialog that we currently use, we would need a proper Swing Implementation). But this would be great, could you please open a separate issue for this?