question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ImageDisplay can't retrieve the current position of an Axis

See original GitHub issue

Steps to reproduce :

  1. Open Mitosis sample
  2. Change the position of the different dimensions
  3. Launch this script
# @ImageDisplay img

from net.imagej.axis import Axes

print(img.getLongPosition(Axes.Z))
print(img.getLongPosition(Axes.X))
print(img.getLongPosition(Axes.Y))
print(img.getLongPosition(Axes.TIME))
print(img.getLongPosition(Axes.CHANNEL))

It should print 0 for all the dimensions.

I guess it’s an issue with IJ1 <-> IJ2 synchronization. Should we except such methods to work or it is a limitation of running IJ2 under the IJ1 interface ?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ctruedencommented, May 10, 2017

One year later…

I also found that sync is not enable by default

So, the goal is to make that option completely obsolete. We have lazy syncing now which is always enabled. We never want to perform expensive up-front syncing. And really, we want to always wrap/unwrap data structures back and forth, rather than ever copying pixels. This can be done in the majority of cases thanks to the ImageJ1 VirtualStack class.

I guess the legacy code is not yet stable and fully working

Definitely not, no. It is—to use the common parlance in my part of the world—extremely half-assed. That’s not to say a lot of work didn’t go into it already—it did—but it has gone through some hurried iterations since the initial implementation, by multiple different programmers, and no one has taken the time to thoroughly update and test it since we fully switched to ImageJ Legacy as the active-by-default UI of ImageJ2. I apologize for that, and unfortunately I will probably not be able to work on it much in 2017, either. But we’ll get there some day.

1reaction
hadimcommented, May 11, 2016

After some tests I found that PositionHarmonizer.updateLegacyImage() is only called once when an image is open in IJ1. But then it’s never called so I guess this is why the positions are not synced between ImageDisplay and ImagePlus.

I wasn’t able to find how the whole sync process works. So it’s pretty hard for me to debug it. Here is some stuff that I noticed :

  • LegacyService.syncActiveImage() does not do any harmonization.
  • LegacyCommand seems to be the only class that do harmonization but the code is called only when an IJ1 command is run.

Should not harmonization be run each time something happen on an ImageDisplay or/and ImagePlus ? I guess this way of doing it is very CPU consuming so you may disabled this behaviour.

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to determine what image pixels are currently displayed in ...
I am trying to scale to the side of an image display that will show the height of a displayed image (Y axis)....
Read more >
E-STUDIO: ImageDisplay Object [22704]
Sets the alignment of the y-axis of the defined frame area in relation to the anchor position (X and Y property settings). Stretch...
Read more >
Android: Animation Position Resets After Complete
your View will'not reset to original position, but if you have some buttons or something else in your view , their position will...
Read more >
ImageView - Android Developers
Returns the current ScaleType that is used to scale the bounds of an image to the bounds of the ImageView. boolean, hasOverlappingRendering().
Read more >
How can I get the ptz - zoom current position?
I'm using mobileSDK (2019). From axis vapix I can get the information from /axis-cgi/com/ptz.cgi?query=position. Is there something ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found