Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    tpietzsch
    @tpietzsch
    in the op you could pick scale 1.3 etc
    Curtis Rueden
    @ctrueden
    @tpietzsch Thanks, that makes sense. As for what the op is supposed to do: I don't think it is thoroughly formalized (yet). My weak preference is to keep it simple here and not do any translation. But we ought to document what will happen to the min/offset of the input image.
    tpietzsch
    @tpietzsch
    The way to improve the quality of the results would be implementing a better InterpolatorFactory
    Curtis Rueden
    @ctrueden
    *nod*
    Christian "Tischi" Tischer
    @tischi
    @ctrueden Regarding the single instance listeners: should it work after updating Fiji? I have an up-to-date Fiji and it throws: [WARNING] Ignoring invalid argument: --force-single-instance
    Curtis Rueden
    @ctrueden
    @tischi Did you put it to the right of a -- separator argument, as I described?
    The launcher is unfortunately a bit stupid about which arguments belong to the JVM itself vs. main methods.
    Christian "Tischi" Tischer
    @tischi

    ...just to make sure I have the latest Fiji:
    /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx --update update
    ...and I just copy and pasted your code:
    /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx -Dscijava.log.level:net.imagej.legacy=debug --force-single-instance -port2 --ij2 --open /Users/tischer/Desktop/blobs.tif

    [WARNING] Ignoring invalid argument: -Dscijava.log.level:net.imagej.legacy=debug [WARNING] Ignoring invalid argument: --force-single-instance [ERROR] Skipping unsupported option -port2

    btw: what does the port* do?
    Curtis Rueden
    @ctrueden
    Agh, did I leave it off? Shoot.
    Contents/Home/ImageJ-macosx -Dscijava.log.level:net.imagej.legacy=debug -- --force-single-instance -port2 --ij2 --open ~/Desktop/General_EduRes_Heart_BloodVessels_0.jpg
    Note the -- standalone argument after the debug arg.
    Your line above does not have that -- standalone argument, which is what causes your trouble.
    The -- says "everything before this is for the JVM, and everything after it is for the Java main method."
    Think of the "port" as a channel... my understanding is that if you launch ImageJ with, say, port2, then launch another ImageJ also with port2, it will find the running ImageJ on that same "port" and hand off the args.
    Christian "Tischi" Tischer
    @tischi

    /Applications/Fiji.app/Contents/MacOS/ImageJ-macosx -Dscijava.log.level:net.imagej.legacy=debug -- --force-single-instance -port2 --ij2 --open /Users/tischer/Desktop/blobs.tif

    [DEBUG] Found 952 legacy plugins. [WARNING] Ignoring invalid argument: --force-single-instance [ERROR] Skipping unsupported option -port2

    Curtis Rueden
    @ctrueden
    In this way, you can have multiple "single instance" ImageJ instances running simultaneously, and hand to whichever you wish, via the correct "port".
    But they cannot literally be web ports, because 2, 3, 4, 5, 6, 7 are not valid.
    Christian "Tischi" Tischer
    @tischi
    ok. I did not spot the first -- but it still does not seem to work. I also can't see the options when I do ImageJ-macosx --help
    Do I maybe have to download a new Fiji rather than update it?
    Curtis Rueden
    @ctrueden
    OK, you need imagej-legacy-0.32.0.jar
    I released that on Friday, June 15, and did not yet upload it to the core update site.
    It will be uploaded later this week. In the meantime, you can download it directly.
    Curtis Rueden
    @ctrueden
    Sorry for the confusion about the port, BTW—I recommend just leaving it off. The default is 7.
    I was including it for testing, just to verify it works as expected.
    The fact that --help does not show the options is a limitation of the ImageJ launcher. There are a whole lot of options it does not show, because that screen is hardcoded into the native launcher. It has no knowledge of the Java-side options other than what is hardcoded.
    I want to change this to make --help a Java-side option, which spins up an ImageJ and displays the help based on all ConsoleArgument plugins. But this is not yet done.
    Christian "Tischi" Tischer
    @tischi
    Ok! It finds the command now! On my Mac, I started Fiji from 3 terminals and only a single UI appears. However, (i) there are 3 Fiji Icons in my dock, and (ii) it only opened the blobs.tif image once. I will send you a screenshot by e-mail.
    Curtis Rueden
    @ctrueden
    A second Fiji icon will appear in the dock temporarily, until the arguments are handed over. But it should disappear again after a few seconds.
    Christian "Tischi" Tischer
    @tischi
    They are still there (macOS 10.13)...Unfortunately, I have to stop testing now, because I have to go to sleep; teaching ImageJ tomorrow and the day after at: http://www.scopem.ethz.ch/education/schools/ZIDAS1.html
    Curtis Rueden
    @ctrueden
    No worries. Thanks for testing.
    Christian "Tischi" Tischer
    @tischi
    ok! I will test more end of the week, also on our linux cluster!
    Curtis Rueden
    @ctrueden
    Thanks.
    Christian "Tischi" Tischer
    @tischi
    One more note about the downscaling: I had a discussion with Preibisch about it and the idea seems to be that one should blur the full resolution image appropriately and then sample from the blurred image to obtain an image with less pixels.
    The idea is implemented in: [Plugins > Example > downsample].
    I tried making an imglib2 version of it: https://github.com/tischi/imglib2-drosophila-registration/blob/master/src/main/java/de/embl/cba/drosophila/Algorithms.java#L28
    Christian "Tischi" Tischer
    @tischi
    @xulman Thanks for the advise!
    Andrew Valente
    @ScienceToolkit

    I have a question about running a set of IJ1 macro commands from a script. I am preparing a Jython script for someone and I need to leave some room for them to add in IJ1 macro stuff if they need it. To accomplish this my plan was to have a text area and feed that into an ij.macro.MacroRunner and run() it. What confuses me is that some commands seem to get run twice, while others do not. Below is a minimal example which on my machine prints "Hello World" twice. I don't understand why this happens, while running something such as run("Invert") with an image open acts as I would expect and runs once.

    #@ String(label="Macro code: ",  style="text area",  value="print(\"Hello World\");",  persist=False) theMacro
    
    from ij.macro import MacroRunner
    
    MacroRunner(theMacro).run()

    For me, running this produces:

    Hello World
    Hello World

    Any ideas?

    Curtis Rueden
    @ctrueden
    @ScienceToolkit Have you tried running the macro via scriptService.run instead?
    Jan Eglinger
    @imagejan
    @ScienceToolkit calling the constructor MacroRunner(String macro) will already start a thread and run the macro (see https://github.com/imagej/imagej1/blob/master/ij/macro/MacroRunner.java)
    Calling its run() method will then call it twice.
    I'd second @ctrueden's advice to use ScriptService and stay in IJ2 land ;-)
    Christian "Tischi" Tischer
    @tischi
    @ctrueden is imagej-legacy-0.32.0.jar already part of the official release?
    Christian "Tischi" Tischer
    @tischi
    @Jan Thanks!
    Christian "Tischi" Tischer
    @tischi
    @ctrueden I tested on Linux like this: ImageJ-linux64 -- --force-single-instance. I did it in a terminal window, where I started already another ImageJ, then I did Ctrl+Z, and then I started it with the --force-single-instance, but it opened a new Fiji...Maybe I am doing something wrong?
    Andrew Valente
    @ScienceToolkit
    Thank you @ctrueden and @imagejan! I added ScriptService to the SciJava Services wiki to make it easier to find without a nice IDE.
    Curtis Rueden
    @ctrueden
    :+1:
    Andrew Valente
    @ScienceToolkit
    Hi! I posted a Python programming question over on the ImageJ forum regarding wrapping instances of a base class. If anyone has some insights on this it would be greatly appreciated. Currently, I have the impression that I need to just copy all of the base class instance information over to the new object, but perhaps there is a sleek and proper way of doing this. Just thought I would point you all to it as I recall a few people were Python folks! :snake:
    Curtis Rueden
    @ctrueden
    @ScienceToolkit I responded briefly.
    Andrew Valente
    @ScienceToolkit
    Thanks @ctrueden. Composition and __getattr__() seems to be what I have been looking for.
    Curtis Rueden
    @ctrueden
    @ScienceToolkit Glad that works!