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

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

Open
martinschorb opened this issue Jun 28, 2024 · 14 comments
Open

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

martinschorb opened this issue Jun 28, 2024 · 14 comments

Comments

@martinschorb
Copy link
Contributor

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:

  • open any two images
  • press t in the viewer to transform
  • move one source
  • press t again to fix transform
  • right click and save view
  • open new view. Transformed source is no longer transformed.
@tischi tischi changed the title manual transformations no longer saved in views manual transformation triggered with [T] no longer saved in views Jun 28, 2024
@tischi
Copy link
Contributor

tischi commented Jun 28, 2024

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
Copy link
Contributor

tischi commented Jun 28, 2024

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
Copy link
Contributor

tischi commented Jun 28, 2024

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
Copy link
Contributor

tischi commented Jun 28, 2024

@tischi
Copy link
Contributor

tischi commented Jun 28, 2024

issue branch: issue-1165

@tischi
Copy link
Contributor

tischi commented Jul 1, 2024

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

image

TODO

  • disable the [ T ] keyboard shortcut of BDV.

@martinschorb
Copy link
Contributor Author

that would be great!

@martinschorb
Copy link
Contributor Author

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
Copy link
Contributor

tischi commented Jul 3, 2024

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

Yes, I will change that.

@martinschorb
Copy link
Contributor Author

@martinschorb
Copy link
Contributor Author

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
Copy link
Contributor

tischi commented Jul 3, 2024

Tutorial

great! let's continue discussion here: mobie/mobie.github.io#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: #1166

@martinschorb
Copy link
Contributor Author

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
Copy link
Contributor

tischi commented Jul 3, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants