Re: Problems running Versatile Wand in batch mode

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Problems running Versatile Wand in batch mode

Curtis Rueden
Hi Michael,

[Added the imagej-devel mailing list to CC, since this discussion may interest other ImageJ plugin developers.]

> A quick search for PlugInFilterRunner in the ij1-patcher seems to
> indicate that the PlugInFilterRunner is not patched.

There is another project on top of ij1-patcher that does the bulk of the actual patching for ImageJ2:


And it does have logic that affects PlugInFilters:


But at first glance, this is only used for the Script Editor's Run command in case the Java code being run is a PlugInFilter:


I apologize that I will not have time to dig into this issue more over the summer -- but I'm insanely busy with work on the ImageJ Common data model and ImageJ OPS and SCIFIO APIs, ImageJ-OMERO integration, IT infrastructure resources and Fiji plugin maintenance, upcoming Madison ImageJ conference planning, paper writing, etc.

Backwards compatibility with ImageJ1 is extremely challenging, especially as things continue to evolve -- e.g., the major changes to how Java works on OS X, and the breaking changes of Java 8. The best we can do right now is to prioritize work that critically affects a large number of ImageJ users, where no easy workaround is possible. In the case of compiling Java plugins, there are several ways of doing it that do not require "Compile and Run" and similar, so for now that's what I'll recommend. I hope that plugin developers will make installation easy for their users by creating ImageJ update sites, rather than shipping bare .java files.

Regards,
Curtis

P.S. When searching for code, you might try http://search.imagej.net/ and click the GitHub button.


On Thu, May 21, 2015 at 3:01 PM, Michael Schmid <[hidden email]> wrote:
Hi Curtis,

thank you!
My fault was looking at the fiji, not the imagej repository.

A quick search for PlugInFilterRunner in the ij1-patcher seems to indicate that the PlugInFilterRunner is not patched.
I agree that the ij1-patcher is not easy too understand, and I did not find anything that looks like it could cause the problem of Avital.

Michael
________________________________________________________________
Michael Schmid                    email: [hidden email]
Institut für Angewandte Physik, Technische Universität Wien
Wiedner Hauptstr. 8-10/E134, A 1040 Wien, Austria
Tel. <a href="tel:%2B43%201%2058801-13452" value="+4315880113452">+43 1 58801-13452 or -13453, Fax <a href="tel:%2B43%201%2058801%2013499" value="+4315880113499">+43 1 58801 13499
________________________________________________________________

On May 21, 2015, at 21:23, Curtis Rueden wrote:

> Hi Michael,
>
> > [I must admit, I know nothing about how Fiji modifies ImageJ; in a
> > quick search I did not find anything on fiji.sc or the github]
>
> The relevant project is:
> https://github.com/imagej/ij1-patcher/
>
> But digging into it is a substantial endeavor.
>
> Regards,
> Curtis
>
> On Thu, May 21, 2015 at 1:35 PM, Michael Schmid <[hidden email]> wrote:
> Hi Wayne,
>
> thank you for finding this out!
>
> It must be a strange Fiji bug! When called like this, the Versatile Wand behaves like an ordinary ExtendedPlugInFilter. It uses the ImagePlus passed to the showDialog method, which comes directly from WindowManager.getCurrentImage() executed by the PlugInFilterRunner.
>
> [I must admit, I know nothing about how Fiji modifies ImageJ; in a quick search I did not find anything on fiji.sc or the github]
>
> Best regards,
>
> Michael
> ________________________________________________________________
> Michael Schmid                    email: [hidden email]
> Institut für Angewandte Physik, Technische Universität Wien
> Wiedner Hauptstr. 8-10/E134, A 1040 Wien, Austria
> Tel. <a href="tel:%2B43%201%2058801-13452" value="+4315880113452">+43 1 58801-13452 or -13453, Fax <a href="tel:%2B43%201%2058801%2013499" value="+4315880113499">+43 1 58801 13499
> ________________________________________________________________
>
> On May 21, 2015, at 18:54, Rasband, Wayne (NIH/NIMH) [E] wrote:
>
> > Dear Avital,
> >
> > This is a Fiji issue. You should be able to work around it by deleting the file “Versatile_Wand.java" (location is shown in Console error messages), copying Versatile_Wand.class into the Fiji.app/plugins folder, and restarting Fiji. I have attached a copy of Versatile_Wand.class or you can download it from the Versatile Wand webpage.
> >
> > Best regards,
> >
> > -wayne
> >
> >
> >> On May 21, 2015, at 3:03 AM, Avital Steinberg <[hidden email]> wrote:
> >>
> >> Hi Wayne,
> >> When I run your code (in which you create 2 images), I get an error message - ROI manager, "the active image does not have a selection". Also, it didn't form an ROI - the ROI manager is empty.
> >>
> >> There is also a console window that shows red warnings - I've had it for a long time, ever since I upgraded imageJ. This console shows up both on my mac and also on my Linux machine. I don't remember when it first showed up. It didn't bother me, since everything was working then.
> >>
> >> Are the attached warning messages related to the problem?
> >>
> >> Thanks,
> >> Avital
> >>
> >> On Wed, May 20, 2015 at 6:42 PM, Rasband, Wayne (NIH/NIMH) [E] <[hidden email]> wrote:
> >> Dear Avital,
> >>
> >> The following version of your test macro creates a selection in the saved image.
> >>
> >> Best regards,
> >>
> >> -wayne
> >>
> >>   setBatchMode(true);
> >>   newImage("Untitled", "8-bit ramp", 500, 500, 1);
> >>   image1ID = getImageID();
> >>   newImage("Untitled", "8-bit ramp", 500, 500, 1);
> >>   image2ID = getImageID();
> >>   selectImage(image1ID);
> >>   if(isActive(image1ID))
> >>      print("The first image is active");
> >>   else
> >>      print("The first image isn't active");
> >>   if (isActive(image2ID))
> >>      print("The second image is active");
> >>   else
> >>      print("The second image isn't active");
> >>   run("Gaussian Blur...", "sigma=2");
> >>   run("Set Scale...", "distance=0");
> >>   run("Versatile Wand", "value=60 color=-100 gradient=10 connectedness=8-connected x=2 y=2 do");
> >>   run("ROI Manager...");
> >>   roiManager("Add");
> >>   saveAs("tiff", getDirectory("home")+"test.tif”)
> >>
> >>
> >>> On May 20, 2015, at 5:35 AM, Avital Steinberg <[hidden email]> wrote:
> >>>
> >>> Thanks, but the problem isn't solved. Can anyone else check if they're
> >>> having similar problems running this code? Does this code create a
> >>> selection in the saved image also for you?
> >>>
> >>> setBatchMode(true);
> >>> open();
> >>> image1ID = getImageID();
> >>> open();
> >>> image2ID = getImageID();
> >>> selectImage(image1ID);
> >>> if(isActive(image1ID)){
> >>>   print("The first image is active");
> >>> }
> >>> else {
> >>>   print("The first image isn't active");
> >>> }
> >>>
> >>> if(isActive(image2ID)){
> >>>   print("The second image is active");
> >>> }
> >>> else {
> >>>   print("The second image isn't active");
> >>> }
> >>> makePoint(1854, 726);
> >>> run("Gaussian Blur...", "sigma=2");
> >>> run("Set Scale...", "distance=0");
> >>> run("Versatile Wand", "value=60 color=-100 gradient=10
> >>> connectedness=8-connected x=2 y=2 do");
> >>> run("ROI Manager...");
> >>> roiManager("Add");
> >>> saveAs("Tiff");
> >>>
> >>>
> >>> I am using ImageJ 1.49t7, which came with Java 1.6.0_065 (64 bit). I am
> >>> running it on a mac, but I had the same problems also on a Linux machine
> >>> with ImageJ 1.49s and java 1.6.0_24.
> >>>
> >>> MakePoint isn't needed, but it's besides the point, since the bug has
> >>> nothing to do with it and exists also without it.
> >>>
> >>> Thanks,
> >>> Avital
> >>>
> >>> On Tue, May 19, 2015 at 6:25 PM, Michael Schmid <[hidden email]>
> >>> wrote:
> >>>
> >>>> Hi Avital,
> >>>>
> >>>> sorry, I can't reproduce the problem. Your macro works; it blurs the first
> >>>> image and does the wand selection on it. I also get the selection in the
> >>>> ROI Manager.
> >>>> I tried with both 8-bit grayscale as well as RGB images.
> >>>>
> >>>> What I don't understand is the "makePoint(1854, 726)" command; Gaussian
> >>>> Blur does not care about point selections. So it blurs the whole image.
> >>>>
> >>>> I am using ImageJ 1.49u4, Java 1.6.0_45.
> >>>>
> >>>> Michael
> >>>> ________________________________________________________________
> >>>> On May 19, 2015, at 17:01, Avital Steinberg wrote:
> >>>>
> >>>>> Hi,
> >>>>> I'm trying to use Versatile Wand in batch mode. The following macro works
> >>>>> well in batch mode:
> >>>>>
> >>>>> setBatchMode(true);
> >>>>> open();
> >>>>> makePoint(1854, 726);
> >>>>> run("Gaussian Blur...", "sigma=2");
> >>>>> run("Set Scale...", "distance=0");
> >>>>> run("Versatile Wand", "value=60 color=-100 gradient=10
> >>>>> connectedness=8-connected x=2 y=2 do");
> >>>>> run("ROI Manager...");
> >>>>> roiManager("Add");
> >>>>> saveAs("Tiff");
> >>>>>
> >>>>> However - when I try to work with multiple images, select the active
> >>>> image
> >>>>> and then use the Versatile Wand, no selection is created:
> >>>>>
> >>>>> setBatchMode(true);
> >>>>> open();
> >>>>> image1ID = getImageID();
> >>>>> open();
> >>>>> image2ID = getImageID();
> >>>>> selectImage(image1ID);
> >>>>> if(isActive(image1ID)){
> >>>>>  print("The first image is active");
> >>>>> }
> >>>>> else {
> >>>>>  print("The first image isn't active");
> >>>>> }
> >>>>>
> >>>>> if(isActive(image2ID)){
> >>>>>  print("The second image is active");
> >>>>> }
> >>>>> else {
> >>>>>  print("The second image isn't active");
> >>>>> }
> >>>>> makePoint(1854, 726);
> >>>>> run("Gaussian Blur...", "sigma=2");
> >>>>> run("Set Scale...", "distance=0");
> >>>>> run("Versatile Wand", "value=60 color=-100 gradient=10
> >>>> connectedness=8-connected x=2 y=2 do");
> >>>>> run("ROI Manager...");
> >>>>> roiManager("Add");
> >>>>> saveAs("Tiff");
> >>>>>
> >>>>> Why wouldn't this script work? Only one image is active.
> >>>>>
> >>>>> Thank you,
> >>>>> Avital
> >>>>
> >>>> --
> >>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >>>>
> >>>
> >>> --
> >>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >>
> >>
> >> <OutputWindowsWaynesCode.jpg><ConsoleWindowRedWarnings.jpg>
> >
> > <Versatile_Wand.class>
>
>



_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problems running Versatile Wand in batch mode

Michael Schmid
Hi Curtis,

Thank you for the additional information.

It seems that Avital's problem was related to compiling, not to the patches of the IJ1 code in Fiji.

Concerning the 'Compile&Run' command, this is EXTREMELY handy and it would be a major step backwards if this is not supported any more!
If I get the java sources of a plugin, and it does not work exactly as I want, I can quickly try any changes that come into my mind or insert debugging code, try/catch statements, etc., and with a single click on Compile&Run (and the RETURN key to accept the same filename as before) I am already testing it on an image.  This is independent of any programming environment, I can do it on any computer anywhere in a lab, or on the laptop of a colleague of mine who has a problem and asks me for help.  And there won't be any automatic update reverting it to the published version.

Also, for publishing a plugin, it's simpler to provide the java code on a web page with the description than preparing an ImageJ update site in addition.  I can also send experimental plugin code to others by email, carry it around on a USB stick, etc.
All this would be gone without Compile&Run!

Best regards,

Michael
________________________________________________________________
On May 28, 2015, at 20:42, Curtis Rueden wrote:

> Hi Michael,
>
> [Added the imagej-devel mailing list to CC, since this discussion may interest other ImageJ plugin developers.]
>
> > A quick search for PlugInFilterRunner in the ij1-patcher seems to
> > indicate that the PlugInFilterRunner is not patched.
>
> There is another project on top of ij1-patcher that does the bulk of the actual patching for ImageJ2:
>
>     https://github.com/imagej/imagej-legacy
>
> And it does have logic that affects PlugInFilters:
>
>     https://github.com/imagej/imagej-legacy/blob/imagej-legacy-0.15.0/src/main/java/net/imagej/legacy/IJ1Helper.java#L591-L621
>
> But at first glance, this is only used for the Script Editor's Run command in case the Java code being run is a PlugInFilter:
>
>     https://github.com/imagej/imagej-legacy/blob/imagej-legacy-0.15.0/src/main/java/net/imagej/legacy/LegacyJavaRunner.java#L54
>
> I apologize that I will not have time to dig into this issue more over the summer -- but I'm insanely busy with work on the ImageJ Common data model and ImageJ OPS and SCIFIO APIs, ImageJ-OMERO integration, IT infrastructure resources and Fiji plugin maintenance, upcoming Madison ImageJ conference planning, paper writing, etc.
>
> Backwards compatibility with ImageJ1 is extremely challenging, especially as things continue to evolve -- e.g., the major changes to how Java works on OS X, and the breaking changes of Java 8. The best we can do right now is to prioritize work that critically affects a large number of ImageJ users, where no easy workaround is possible. In the case of compiling Java plugins, there are several ways of doing it that do not require "Compile and Run" and similar, so for now that's what I'll recommend. I hope that plugin developers will make installation easy for their users by creating ImageJ update sites, rather than shipping bare .java files.
>
> Regards,
> Curtis
>
> P.S. When searching for code, you might try http://search.imagej.net/ and click the GitHub button.
>
>
> On Thu, May 21, 2015 at 3:01 PM, Michael Schmid <[hidden email]> wrote:
> Hi Curtis,
>
> thank you!
> My fault was looking at the fiji, not the imagej repository.
>
> A quick search for PlugInFilterRunner in the ij1-patcher seems to indicate that the PlugInFilterRunner is not patched.
> I agree that the ij1-patcher is not easy too understand, and I did not find anything that looks like it could cause the problem of Avital.
>
> Michael
> ________________________________________________________________
> Michael Schmid                    email: [hidden email]
> Institut für Angewandte Physik, Technische Universität Wien
> Wiedner Hauptstr. 8-10/E134, A 1040 Wien, Austria
> Tel. +43 1 58801-13452 or -13453, Fax +43 1 58801 13499
> ________________________________________________________________
>
> On May 21, 2015, at 21:23, Curtis Rueden wrote:
>
> > Hi Michael,
> >
> > > [I must admit, I know nothing about how Fiji modifies ImageJ; in a
> > > quick search I did not find anything on fiji.sc or the github]
> >
> > The relevant project is:
> > https://github.com/imagej/ij1-patcher/
> >
> > But digging into it is a substantial endeavor.
> >
> > Regards,
> > Curtis
> >
> > On Thu, May 21, 2015 at 1:35 PM, Michael Schmid <[hidden email]> wrote:
> > Hi Wayne,
> >
> > thank you for finding this out!
> >
> > It must be a strange Fiji bug! When called like this, the Versatile Wand behaves like an ordinary ExtendedPlugInFilter. It uses the ImagePlus passed to the showDialog method, which comes directly from WindowManager.getCurrentImage() executed by the PlugInFilterRunner.
> >
> > [I must admit, I know nothing about how Fiji modifies ImageJ; in a quick search I did not find anything on fiji.sc or the github]
> >
> > Best regards,
> >
> > Michael
> > ________________________________________________________________
> > Michael Schmid                    email: [hidden email]
> > Institut für Angewandte Physik, Technische Universität Wien
> > Wiedner Hauptstr. 8-10/E134, A 1040 Wien, Austria
> > Tel. +43 1 58801-13452 or -13453, Fax +43 1 58801 13499
> > ________________________________________________________________
> >
> > On May 21, 2015, at 18:54, Rasband, Wayne (NIH/NIMH) [E] wrote:
> >
> > > Dear Avital,
> > >
> > > This is a Fiji issue. You should be able to work around it by deleting the file “Versatile_Wand.java" (location is shown in Console error messages), copying Versatile_Wand.class into the Fiji.app/plugins folder, and restarting Fiji. I have attached a copy of Versatile_Wand.class or you can download it from the Versatile Wand webpage.
> > >
> > > Best regards,
> > >
> > > -wayne
> > >
> > >
> > >> On May 21, 2015, at 3:03 AM, Avital Steinberg <[hidden email]> wrote:
> > >>
> > >> Hi Wayne,
> > >> When I run your code (in which you create 2 images), I get an error message - ROI manager, "the active image does not have a selection". Also, it didn't form an ROI - the ROI manager is empty.
> > >>
> > >> There is also a console window that shows red warnings - I've had it for a long time, ever since I upgraded imageJ. This console shows up both on my mac and also on my Linux machine. I don't remember when it first showed up. It didn't bother me, since everything was working then.
> > >>
> > >> Are the attached warning messages related to the problem?
> > >>
> > >> Thanks,
> > >> Avital
> > >>
> > >> On Wed, May 20, 2015 at 6:42 PM, Rasband, Wayne (NIH/NIMH) [E] <[hidden email]> wrote:
> > >> Dear Avital,
> > >>
> > >> The following version of your test macro creates a selection in the saved image.
> > >>
> > >> Best regards,
> > >>
> > >> -wayne
> > >>
> > >>   setBatchMode(true);
> > >>   newImage("Untitled", "8-bit ramp", 500, 500, 1);
> > >>   image1ID = getImageID();
> > >>   newImage("Untitled", "8-bit ramp", 500, 500, 1);
> > >>   image2ID = getImageID();
> > >>   selectImage(image1ID);
> > >>   if(isActive(image1ID))
> > >>      print("The first image is active");
> > >>   else
> > >>      print("The first image isn't active");
> > >>   if (isActive(image2ID))
> > >>      print("The second image is active");
> > >>   else
> > >>      print("The second image isn't active");
> > >>   run("Gaussian Blur...", "sigma=2");
> > >>   run("Set Scale...", "distance=0");
> > >>   run("Versatile Wand", "value=60 color=-100 gradient=10 connectedness=8-connected x=2 y=2 do");
> > >>   run("ROI Manager...");
> > >>   roiManager("Add");
> > >>   saveAs("tiff", getDirectory("home")+"test.tif”)
> > >>
> > >>
> > >>> On May 20, 2015, at 5:35 AM, Avital Steinberg <[hidden email]> wrote:
> > >>>
> > >>> Thanks, but the problem isn't solved. Can anyone else check if they're
> > >>> having similar problems running this code? Does this code create a
> > >>> selection in the saved image also for you?
> > >>>
> > >>> setBatchMode(true);
> > >>> open();
> > >>> image1ID = getImageID();
> > >>> open();
> > >>> image2ID = getImageID();
> > >>> selectImage(image1ID);
> > >>> if(isActive(image1ID)){
> > >>>   print("The first image is active");
> > >>> }
> > >>> else {
> > >>>   print("The first image isn't active");
> > >>> }
> > >>>
> > >>> if(isActive(image2ID)){
> > >>>   print("The second image is active");
> > >>> }
> > >>> else {
> > >>>   print("The second image isn't active");
> > >>> }
> > >>> makePoint(1854, 726);
> > >>> run("Gaussian Blur...", "sigma=2");
> > >>> run("Set Scale...", "distance=0");
> > >>> run("Versatile Wand", "value=60 color=-100 gradient=10
> > >>> connectedness=8-connected x=2 y=2 do");
> > >>> run("ROI Manager...");
> > >>> roiManager("Add");
> > >>> saveAs("Tiff");
> > >>>
> > >>>
> > >>> I am using ImageJ 1.49t7, which came with Java 1.6.0_065 (64 bit). I am
> > >>> running it on a mac, but I had the same problems also on a Linux machine
> > >>> with ImageJ 1.49s and java 1.6.0_24.
> > >>>
> > >>> MakePoint isn't needed, but it's besides the point, since the bug has
> > >>> nothing to do with it and exists also without it.
> > >>>
> > >>> Thanks,
> > >>> Avital
> > >>>
> > >>> On Tue, May 19, 2015 at 6:25 PM, Michael Schmid <[hidden email]>
> > >>> wrote:
> > >>>
> > >>>> Hi Avital,
> > >>>>
> > >>>> sorry, I can't reproduce the problem. Your macro works; it blurs the first
> > >>>> image and does the wand selection on it. I also get the selection in the
> > >>>> ROI Manager.
> > >>>> I tried with both 8-bit grayscale as well as RGB images.
> > >>>>
> > >>>> What I don't understand is the "makePoint(1854, 726)" command; Gaussian
> > >>>> Blur does not care about point selections. So it blurs the whole image.
> > >>>>
> > >>>> I am using ImageJ 1.49u4, Java 1.6.0_45.
> > >>>>
> > >>>> Michael
> > >>>> ________________________________________________________________
> > >>>> On May 19, 2015, at 17:01, Avital Steinberg wrote:
> > >>>>
> > >>>>> Hi,
> > >>>>> I'm trying to use Versatile Wand in batch mode. The following macro works
> > >>>>> well in batch mode:
> > >>>>>
> > >>>>> setBatchMode(true);
> > >>>>> open();
> > >>>>> makePoint(1854, 726);
> > >>>>> run("Gaussian Blur...", "sigma=2");
> > >>>>> run("Set Scale...", "distance=0");
> > >>>>> run("Versatile Wand", "value=60 color=-100 gradient=10
> > >>>>> connectedness=8-connected x=2 y=2 do");
> > >>>>> run("ROI Manager...");
> > >>>>> roiManager("Add");
> > >>>>> saveAs("Tiff");
> > >>>>>
> > >>>>> However - when I try to work with multiple images, select the active
> > >>>> image
> > >>>>> and then use the Versatile Wand, no selection is created:
> > >>>>>
> > >>>>> setBatchMode(true);
> > >>>>> open();
> > >>>>> image1ID = getImageID();
> > >>>>> open();
> > >>>>> image2ID = getImageID();
> > >>>>> selectImage(image1ID);
> > >>>>> if(isActive(image1ID)){
> > >>>>>  print("The first image is active");
> > >>>>> }
> > >>>>> else {
> > >>>>>  print("The first image isn't active");
> > >>>>> }
> > >>>>>
> > >>>>> if(isActive(image2ID)){
> > >>>>>  print("The second image is active");
> > >>>>> }
> > >>>>> else {
> > >>>>>  print("The second image isn't active");
> > >>>>> }
> > >>>>> makePoint(1854, 726);
> > >>>>> run("Gaussian Blur...", "sigma=2");
> > >>>>> run("Set Scale...", "distance=0");
> > >>>>> run("Versatile Wand", "value=60 color=-100 gradient=10
> > >>>> connectedness=8-connected x=2 y=2 do");
> > >>>>> run("ROI Manager...");
> > >>>>> roiManager("Add");
> > >>>>> saveAs("Tiff");
> > >>>>>
> > >>>>> Why wouldn't this script work? Only one image is active.
> > >>>>>
> > >>>>> Thank you,
> > >>>>> Avital
> > >>>>
> > >>>> --
> > >>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> > >>>>
> > >>>
> > >>> --
> > >>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> > >>
> > >>
> > >> <OutputWindowsWaynesCode.jpg><ConsoleWindowRedWarnings.jpg>
> > >
> > > <Versatile_Wand.class>
> >
> >
>
>


_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel
Reply | Threaded
Open this post in threaded view
|

Re: Problems running Versatile Wand in batch mode

Curtis Rueden
Hi Michael,

Apologies for the long delay in follow up.

> Concerning the 'Compile&Run' command, this is EXTREMELY handy and it
> would be a major step backwards if this is not supported any more!

Just wanted to let you know that we are indeed planning to work on restoring the Compile & Run command in ImageJ2:


We will have to address several related issues surrounding the javac compiler, javax.tools, and the switch to Java 8. (E.g., right now, you cannot develop Java code in the Script Editor when running with Java 7 or Java 8.) The goal is to make (a version of) Compile & Run work again as part of that effort.

Timeline might not be till first half of next year, but it is on the radar.

Regards,
Curtis

On Fri, May 29, 2015 at 4:02 AM, Michael Schmid <[hidden email]> wrote:
Hi Curtis,

Thank you for the additional information.

It seems that Avital's problem was related to compiling, not to the patches of the IJ1 code in Fiji.

Concerning the 'Compile&Run' command, this is EXTREMELY handy and it would be a major step backwards if this is not supported any more!
If I get the java sources of a plugin, and it does not work exactly as I want, I can quickly try any changes that come into my mind or insert debugging code, try/catch statements, etc., and with a single click on Compile&Run (and the RETURN key to accept the same filename as before) I am already testing it on an image.  This is independent of any programming environment, I can do it on any computer anywhere in a lab, or on the laptop of a colleague of mine who has a problem and asks me for help.  And there won't be any automatic update reverting it to the published version.

Also, for publishing a plugin, it's simpler to provide the java code on a web page with the description than preparing an ImageJ update site in addition.  I can also send experimental plugin code to others by email, carry it around on a USB stick, etc.
All this would be gone without Compile&Run!

Best regards,

Michael
________________________________________________________________
On May 28, 2015, at 20:42, Curtis Rueden wrote:

> Hi Michael,
>
> [Added the imagej-devel mailing list to CC, since this discussion may interest other ImageJ plugin developers.]
>
> > A quick search for PlugInFilterRunner in the ij1-patcher seems to
> > indicate that the PlugInFilterRunner is not patched.
>
> There is another project on top of ij1-patcher that does the bulk of the actual patching for ImageJ2:
>
>     https://github.com/imagej/imagej-legacy
>
> And it does have logic that affects PlugInFilters:
>
>     https://github.com/imagej/imagej-legacy/blob/imagej-legacy-0.15.0/src/main/java/net/imagej/legacy/IJ1Helper.java#L591-L621
>
> But at first glance, this is only used for the Script Editor's Run command in case the Java code being run is a PlugInFilter:
>
>     https://github.com/imagej/imagej-legacy/blob/imagej-legacy-0.15.0/src/main/java/net/imagej/legacy/LegacyJavaRunner.java#L54
>
> I apologize that I will not have time to dig into this issue more over the summer -- but I'm insanely busy with work on the ImageJ Common data model and ImageJ OPS and SCIFIO APIs, ImageJ-OMERO integration, IT infrastructure resources and Fiji plugin maintenance, upcoming Madison ImageJ conference planning, paper writing, etc.
>
> Backwards compatibility with ImageJ1 is extremely challenging, especially as things continue to evolve -- e.g., the major changes to how Java works on OS X, and the breaking changes of Java 8. The best we can do right now is to prioritize work that critically affects a large number of ImageJ users, where no easy workaround is possible. In the case of compiling Java plugins, there are several ways of doing it that do not require "Compile and Run" and similar, so for now that's what I'll recommend. I hope that plugin developers will make installation easy for their users by creating ImageJ update sites, rather than shipping bare .java files.
>
> Regards,
> Curtis
>
> P.S. When searching for code, you might try http://search.imagej.net/ and click the GitHub button.
>
>
> On Thu, May 21, 2015 at 3:01 PM, Michael Schmid <[hidden email]> wrote:
> Hi Curtis,
>
> thank you!
> My fault was looking at the fiji, not the imagej repository.
>
> A quick search for PlugInFilterRunner in the ij1-patcher seems to indicate that the PlugInFilterRunner is not patched.
> I agree that the ij1-patcher is not easy too understand, and I did not find anything that looks like it could cause the problem of Avital.
>
> Michael
> ________________________________________________________________
> Michael Schmid                    email: [hidden email]
> Institut für Angewandte Physik, Technische Universität Wien
> Wiedner Hauptstr. 8-10/E134, A 1040 Wien, Austria
> Tel. <a href="tel:%2B43%201%2058801-13452" value="+4315880113452">+43 1 58801-13452 or -13453, Fax <a href="tel:%2B43%201%2058801%2013499" value="+4315880113499">+43 1 58801 13499
> ________________________________________________________________
>
> On May 21, 2015, at 21:23, Curtis Rueden wrote:
>
> > Hi Michael,
> >
> > > [I must admit, I know nothing about how Fiji modifies ImageJ; in a
> > > quick search I did not find anything on fiji.sc or the github]
> >
> > The relevant project is:
> > https://github.com/imagej/ij1-patcher/
> >
> > But digging into it is a substantial endeavor.
> >
> > Regards,
> > Curtis
> >
> > On Thu, May 21, 2015 at 1:35 PM, Michael Schmid <[hidden email]> wrote:
> > Hi Wayne,
> >
> > thank you for finding this out!
> >
> > It must be a strange Fiji bug! When called like this, the Versatile Wand behaves like an ordinary ExtendedPlugInFilter. It uses the ImagePlus passed to the showDialog method, which comes directly from WindowManager.getCurrentImage() executed by the PlugInFilterRunner.
> >
> > [I must admit, I know nothing about how Fiji modifies ImageJ; in a quick search I did not find anything on fiji.sc or the github]
> >
> > Best regards,
> >
> > Michael
> > ________________________________________________________________
> > Michael Schmid                    email: [hidden email]
> > Institut für Angewandte Physik, Technische Universität Wien
> > Wiedner Hauptstr. 8-10/E134, A 1040 Wien, Austria
> > Tel. <a href="tel:%2B43%201%2058801-13452" value="+4315880113452">+43 1 58801-13452 or -13453, Fax <a href="tel:%2B43%201%2058801%2013499" value="+4315880113499">+43 1 58801 13499
> > ________________________________________________________________
> >
> > On May 21, 2015, at 18:54, Rasband, Wayne (NIH/NIMH) [E] wrote:
> >
> > > Dear Avital,
> > >
> > > This is a Fiji issue. You should be able to work around it by deleting the file “Versatile_Wand.java" (location is shown in Console error messages), copying Versatile_Wand.class into the Fiji.app/plugins folder, and restarting Fiji. I have attached a copy of Versatile_Wand.class or you can download it from the Versatile Wand webpage.
> > >
> > > Best regards,
> > >
> > > -wayne
> > >
> > >
> > >> On May 21, 2015, at 3:03 AM, Avital Steinberg <[hidden email]> wrote:
> > >>
> > >> Hi Wayne,
> > >> When I run your code (in which you create 2 images), I get an error message - ROI manager, "the active image does not have a selection". Also, it didn't form an ROI - the ROI manager is empty.
> > >>
> > >> There is also a console window that shows red warnings - I've had it for a long time, ever since I upgraded imageJ. This console shows up both on my mac and also on my Linux machine. I don't remember when it first showed up. It didn't bother me, since everything was working then.
> > >>
> > >> Are the attached warning messages related to the problem?
> > >>
> > >> Thanks,
> > >> Avital
> > >>
> > >> On Wed, May 20, 2015 at 6:42 PM, Rasband, Wayne (NIH/NIMH) [E] <[hidden email]> wrote:
> > >> Dear Avital,
> > >>
> > >> The following version of your test macro creates a selection in the saved image.
> > >>
> > >> Best regards,
> > >>
> > >> -wayne
> > >>
> > >>   setBatchMode(true);
> > >>   newImage("Untitled", "8-bit ramp", 500, 500, 1);
> > >>   image1ID = getImageID();
> > >>   newImage("Untitled", "8-bit ramp", 500, 500, 1);
> > >>   image2ID = getImageID();
> > >>   selectImage(image1ID);
> > >>   if(isActive(image1ID))
> > >>      print("The first image is active");
> > >>   else
> > >>      print("The first image isn't active");
> > >>   if (isActive(image2ID))
> > >>      print("The second image is active");
> > >>   else
> > >>      print("The second image isn't active");
> > >>   run("Gaussian Blur...", "sigma=2");
> > >>   run("Set Scale...", "distance=0");
> > >>   run("Versatile Wand", "value=60 color=-100 gradient=10 connectedness=8-connected x=2 y=2 do");
> > >>   run("ROI Manager...");
> > >>   roiManager("Add");
> > >>   saveAs("tiff", getDirectory("home")+"test.tif”)
> > >>
> > >>
> > >>> On May 20, 2015, at 5:35 AM, Avital Steinberg <[hidden email]> wrote:
> > >>>
> > >>> Thanks, but the problem isn't solved. Can anyone else check if they're
> > >>> having similar problems running this code? Does this code create a
> > >>> selection in the saved image also for you?
> > >>>
> > >>> setBatchMode(true);
> > >>> open();
> > >>> image1ID = getImageID();
> > >>> open();
> > >>> image2ID = getImageID();
> > >>> selectImage(image1ID);
> > >>> if(isActive(image1ID)){
> > >>>   print("The first image is active");
> > >>> }
> > >>> else {
> > >>>   print("The first image isn't active");
> > >>> }
> > >>>
> > >>> if(isActive(image2ID)){
> > >>>   print("The second image is active");
> > >>> }
> > >>> else {
> > >>>   print("The second image isn't active");
> > >>> }
> > >>> makePoint(1854, 726);
> > >>> run("Gaussian Blur...", "sigma=2");
> > >>> run("Set Scale...", "distance=0");
> > >>> run("Versatile Wand", "value=60 color=-100 gradient=10
> > >>> connectedness=8-connected x=2 y=2 do");
> > >>> run("ROI Manager...");
> > >>> roiManager("Add");
> > >>> saveAs("Tiff");
> > >>>
> > >>>
> > >>> I am using ImageJ 1.49t7, which came with Java 1.6.0_065 (64 bit). I am
> > >>> running it on a mac, but I had the same problems also on a Linux machine
> > >>> with ImageJ 1.49s and java 1.6.0_24.
> > >>>
> > >>> MakePoint isn't needed, but it's besides the point, since the bug has
> > >>> nothing to do with it and exists also without it.
> > >>>
> > >>> Thanks,
> > >>> Avital
> > >>>
> > >>> On Tue, May 19, 2015 at 6:25 PM, Michael Schmid <[hidden email]>
> > >>> wrote:
> > >>>
> > >>>> Hi Avital,
> > >>>>
> > >>>> sorry, I can't reproduce the problem. Your macro works; it blurs the first
> > >>>> image and does the wand selection on it. I also get the selection in the
> > >>>> ROI Manager.
> > >>>> I tried with both 8-bit grayscale as well as RGB images.
> > >>>>
> > >>>> What I don't understand is the "makePoint(1854, 726)" command; Gaussian
> > >>>> Blur does not care about point selections. So it blurs the whole image.
> > >>>>
> > >>>> I am using ImageJ 1.49u4, Java 1.6.0_45.
> > >>>>
> > >>>> Michael
> > >>>> ________________________________________________________________
> > >>>> On May 19, 2015, at 17:01, Avital Steinberg wrote:
> > >>>>
> > >>>>> Hi,
> > >>>>> I'm trying to use Versatile Wand in batch mode. The following macro works
> > >>>>> well in batch mode:
> > >>>>>
> > >>>>> setBatchMode(true);
> > >>>>> open();
> > >>>>> makePoint(1854, 726);
> > >>>>> run("Gaussian Blur...", "sigma=2");
> > >>>>> run("Set Scale...", "distance=0");
> > >>>>> run("Versatile Wand", "value=60 color=-100 gradient=10
> > >>>>> connectedness=8-connected x=2 y=2 do");
> > >>>>> run("ROI Manager...");
> > >>>>> roiManager("Add");
> > >>>>> saveAs("Tiff");
> > >>>>>
> > >>>>> However - when I try to work with multiple images, select the active
> > >>>> image
> > >>>>> and then use the Versatile Wand, no selection is created:
> > >>>>>
> > >>>>> setBatchMode(true);
> > >>>>> open();
> > >>>>> image1ID = getImageID();
> > >>>>> open();
> > >>>>> image2ID = getImageID();
> > >>>>> selectImage(image1ID);
> > >>>>> if(isActive(image1ID)){
> > >>>>>  print("The first image is active");
> > >>>>> }
> > >>>>> else {
> > >>>>>  print("The first image isn't active");
> > >>>>> }
> > >>>>>
> > >>>>> if(isActive(image2ID)){
> > >>>>>  print("The second image is active");
> > >>>>> }
> > >>>>> else {
> > >>>>>  print("The second image isn't active");
> > >>>>> }
> > >>>>> makePoint(1854, 726);
> > >>>>> run("Gaussian Blur...", "sigma=2");
> > >>>>> run("Set Scale...", "distance=0");
> > >>>>> run("Versatile Wand", "value=60 color=-100 gradient=10
> > >>>> connectedness=8-connected x=2 y=2 do");
> > >>>>> run("ROI Manager...");
> > >>>>> roiManager("Add");
> > >>>>> saveAs("Tiff");
> > >>>>>
> > >>>>> Why wouldn't this script work? Only one image is active.
> > >>>>>
> > >>>>> Thank you,
> > >>>>> Avital
> > >>>>
> > >>>> --
> > >>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> > >>>>
> > >>>
> > >>> --
> > >>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> > >>
> > >>
> > >> <OutputWindowsWaynesCode.jpg><ConsoleWindowRedWarnings.jpg>
> > >
> > > <Versatile_Wand.class>
> >
> >
>
>



_______________________________________________
ImageJ-devel mailing list
[hidden email]
http://imagej.net/mailman/listinfo/imagej-devel