Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Dec 08 22:51
    NicolasCristini commented #126
  • Dec 08 22:06

    ctrueden on master

    Require jpype >= 1.3.0 and jgo … (compare)

  • Dec 08 22:03

    ctrueden on master

    Require jpype 1.3.0 or later T… (compare)

  • Dec 08 20:07
    ctrueden commented #23
  • Dec 08 20:06
    ctrueden commented #23
  • Dec 08 20:04
    ctrueden closed #23
  • Dec 08 20:04

    ctrueden on master

    Refer to ImageJ2 things as "Ima… Stop using new-lenna Refactor _create_jvm a little … and 1 more (compare)

  • Dec 08 19:05
    elevans commented #155
  • Dec 08 18:51
    elevans commented #23
  • Dec 08 18:49
    elevans commented #23
  • Dec 08 18:43
    ctrueden commented #23
  • Dec 08 18:11
    ctrueden commented #155
  • Dec 08 18:08
    ctrueden commented #155
  • Dec 08 18:04
    ctrueden commented #155
  • Dec 08 08:42
    imagejan commented #155
  • Dec 07 22:57
    ctrueden commented #23
  • Dec 07 22:55
    ctrueden commented #23
  • Dec 07 22:41

    ctrueden on master

    Fix docstring typo Split imagej.init into two part… On macOS with headless=False, s… (compare)

  • Dec 07 21:46
    ctrueden commented #153
  • Dec 07 19:05

    elevans on master

    Fix run_script docstring Automatically dispose imagej on… Fix regex python back slash not… (compare)

Mark Hiner
@hinerm
@ctrueden @elevans it looks like imagej/pyimagej@549b670 broke these tests.
Edward Evans
@elevans
That was me! I made that change to help support RandomAccessInterval slicing. We can revert back if that is easier. the issue is that it was returning the shape of the data backwards.
Mark Hiner
@hinerm
dims() is the root of new_numpy_image so it fundamentally changed how images are created.
My vague understanding that xarray data is supposed to be reversed? sometimes? Or something?
Edward Evans
@elevans
:cry: ugh! sorry! the rai shape is backwards compared to the xarray
so if you call ij.py.dims() on a rai you'll get the wrong order of dimensions to slice.
I will revert it back, is there a proper git way to do that?
@hinerm I reverted it. I'll flip the dims in the imagej/stack module.
Mark Hiner
@hinerm
:+1:
Curtis Rueden
@ctrueden
@hinerm FYI, @elevans and I spent maybe an hour talking about dimensional reordering between Java and Python, and have plans for ways we can improve this. @elevans is continuing to work on it, and will submit issues/comments/code/etc. as it develops.
Edward Evans
@elevans
:thumbsup:
Curtis Rueden
@ctrueden
Please edit to reflect the stuff we talked about. In particular, I couldn't find that scikit-image axis ordering doc you showed me, so please link that in. But also the strategy we were developing, so that we can bring @hinerm and others into the loop.
Curtis Rueden
@ctrueden
@elevans Did you end up committing an auto-dispose/cleanup step for pyimagej, for when Python is shutting down? I couldn't find it in any of the commits on GitHub.
IIRC, we were going to add some extensibility hook registration thing to scyjava.
That is a thing we should get completed before the paper.
Edward Evans
@elevans
@ctrueden No I haven't gotten anyting to work. I'm writting up the issue for it with the relevant links/info and will add it to the project board.
Curtis Rueden
@ctrueden
@elevans If you are OK with it, I would spend our post-meeting time tomorrow hammering through the scyjava disposal hook work with you, so that PyImageJ can shut down more automatically, as per imagej/pyimagej#153.
Edward Evans
@elevans
:thumbsup: sounds good to me!
Curtis Rueden
@ctrueden
@hinerm Talking more with @elevans, we think that the synchronize_ij1_to_ij2 call (which I'd support renaming to just sync or similar) needs to go at the end of run_script and/or run_macro. Putting it only in from_java does not solve the problem of the wrapped numpy array being out of sync after executing Java code on an ImagePlus, because from_java will not even be called afterward in the typical case.
Edward Evans
@elevans

@hinerm: @ctrueden and I sucessfully added clean shutdown to PyImageJ now. We did the following:

  • Release scyjava 1.4.0 with the needed API changes
  • Added the appropriate scyjava call to shutdown the JVM in pyimagej
  • Tested with GUI and in headless mode

There are still some pending tests with Windows that I need to do as well. You should be able to exit very quickly now and also with ^c. One odd quark that on my system is that after exiting I sometimes need to reset my terminal, but thats pretty minor.

Curtis Rueden
@ctrueden
Behavior is also good/same on macOS! Except for the problem with macOS + headless=False where it hangs—still a problem, of course.
Edward Evans
@elevans
:cry:
Curtis Rueden
@ctrueden
I'm trying to find that os wrapper Python script to test with GUI... but I forgot where it lives.
Oh n/m I found it.
Edward Evans
@elevans
Should i leave #153 open?
Curtis Rueden
@ctrueden
imglyb/imglyb/OSXAWTwrapper.py
Curtis Rueden
@ctrueden
@elevans Can you paste me that magic "start the REPL from a Python script" snippet?
4 replies
Curtis Rueden
@ctrueden
Playing around a bit with imagej/pyimagej#23, I think the code linked by Thrameos might accomplish the same thing as the OSXAWTWrapper, but more concisely. At least, I was able to use it to spin up a Java GUI once. But now I'm getting segfaults. There is some confusion regarding whether pyobjc needs to be installed from pip, or if installing it from conda is acceptable (and if so, which package(s) from conda). I will keep playing around, but I am hopeful we can improve the macOS behavior before the next release.
Curtis Rueden
@ctrueden
@elevans I think the reason we had so much trouble with the ^R history is because when you hit ^C and kill the interpreter, the history from that session is lost.
Edward Evans
@elevans
:thumbsup: ahh that makes sense
Curtis Rueden
@ctrueden
@elevans LMK what you think about imagej/pyimagej#23 now. I know you're not on macOS, but ideas for a clean API would be welcome.
Edward Evans
@elevans
I'm reading up on it now
Curtis Rueden
@ctrueden
My current thinking is to add a new mode argument to imagej.init that takes one of three values: imagej.Mode.HEADLESS, imagej.Mode.GUI, or imagej.Mode.INTERACTIVE. The mapping would be:
  • init(headless=True)init(mode=Mode.HEADLESS)
  • init(headless=False)init(mode=Mode.INTERACTIVE) except on macOS where it would throw an exception; and
  • init(mode=Mode.GUI) is a new thing that works on all three platforms, calling ij.ui().showUI() automatically and then blocking.
For Mode.GUI we probably don't want to make any promises about when the blocking ends, if ever...
@elevans Do you see any issues with a design like that?
Edward Evans
@elevans
Hah I was crafting my response on #23.
Curtis Rueden
@ctrueden
Ah, that is better. I will cut and paste.
Edward Evans
@elevans
okay, I'll update my response. But in short, I like this!
Edward Evans
@elevans
I was thinking of edge cases but, just running through off the top of my head this scheme looks pretty good to me
Curtis Rueden
@ctrueden
@/all Please test the latest mainline pyimagej branch if you have time—in particular, I would like feedback on the three modes (headless, gui, interactive), and especially on macOS, how does it work for you.
@elevans Is there some reason you put imagej.stack in imagej/stack/__init__.py rather than imagej/stack.py?
Mark Hiner
@hinerm
@ctrueden with the latest pyimagej and scyjava I get:
>>> import imagej
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\hiner\code\imagej\pyimagej\imagej\__init__.py", line 37, in <module>
    import imglyb
  File "c:\users\hiner\code\imglib\imglyb\imglyb\__init__.py", line 4, in <module>
    import scyjava
  File "c:\users\hiner\code\scijava\scyjava\scyjava\__init__.py", line 8, in <module>
    import jpype.config
ModuleNotFoundError: No module named 'jpype.config'
Curtis Rueden
@ctrueden
Need a newer jpype.
We should update the setup.py and conda feedstock to specify which.
The version is 1.3.0 (I checked the source).
Curtis Rueden
@ctrueden
I just changed scyjava to require >= 1.3.0 of jpype.
The jgo >= 1.0.3 (for MANAGED) is harder, because scyjava itself doesn't need that... but pyimagej needs that... but only indirectly via scyjava.
For now, I just put the jgo dependency into pyimagej.