<div dir="ltr">Hi Michael,<div><br></div><div><div>[Added the imagej-devel mailing list to CC, since this discussion may interest other ImageJ plugin developers.]</div><div><br></div></div><div><div>> A quick search for PlugInFilterRunner in the ij1-patcher seems to</div><div>> indicate that the PlugInFilterRunner is not patched.</div></div><div><br></div><div>There is another project on top of ij1-patcher that does the bulk of the actual patching for ImageJ2:</div><div><br></div><div> <a href="https://github.com/imagej/imagej-legacy">https://github.com/imagej/imagej-legacy</a><br></div><div><br></div><div>And it does have logic that affects PlugInFilters:</div><div><br></div><div> <a href="https://github.com/imagej/imagej-legacy/blob/imagej-legacy-0.15.0/src/main/java/net/imagej/legacy/IJ1Helper.java#L591-L621">https://github.com/imagej/imagej-legacy/blob/imagej-legacy-0.15.0/src/main/java/net/imagej/legacy/IJ1Helper.java#L591-L621</a></div><div><br></div><div>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:</div><div><br></div><div> <a href="https://github.com/imagej/imagej-legacy/blob/imagej-legacy-0.15.0/src/main/java/net/imagej/legacy/LegacyJavaRunner.java#L54">https://github.com/imagej/imagej-legacy/blob/imagej-legacy-0.15.0/src/main/java/net/imagej/legacy/LegacyJavaRunner.java#L54</a><br></div><div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Regards,</div><div>Curtis</div><div><br></div><div>P.S. When searching for code, you might try <a href="http://search.imagej.net/">http://search.imagej.net/</a> and click the GitHub button.</div><div><br></div><div><br></div><div class="gmail_extra"><div class="gmail_quote">On Thu, May 21, 2015 at 3:01 PM, Michael Schmid <span dir="ltr"><<a href="mailto:schmid@iap.tuwien.ac.at" target="_blank">schmid@iap.tuwien.ac.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Curtis,<br>
<br>
thank you!<br>
My fault was looking at the fiji, not the imagej repository.<br>
<br>
A quick search for PlugInFilterRunner in the ij1-patcher seems to indicate that the PlugInFilterRunner is not patched.<br>
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.<br>
<span class="im"><br>
Michael<br>
________________________________________________________________<br>
Michael Schmid email: <a href="mailto:schmid@iap.tuwien.ac.at">schmid@iap.tuwien.ac.at</a><br>
Institut für Angewandte Physik, Technische Universität Wien<br>
Wiedner Hauptstr. 8-10/E134, A 1040 Wien, Austria<br>
Tel. <a href="tel:%2B43%201%2058801-13452" value="+4315880113452">+43 1 58801-13452</a> or -13453, Fax <a href="tel:%2B43%201%2058801%2013499" value="+4315880113499">+43 1 58801 13499</a><br>
________________________________________________________________<br>
<br>
</span><div class=""><div class="h5">On May 21, 2015, at 21:23, Curtis Rueden wrote:<br>
<br>
> Hi Michael,<br>
><br>
> > [I must admit, I know nothing about how Fiji modifies ImageJ; in a<br>
> > quick search I did not find anything on <a href="http://fiji.sc" target="_blank">fiji.sc</a> or the github]<br>
><br>
> The relevant project is:<br>
> <a href="https://github.com/imagej/ij1-patcher/" target="_blank">https://github.com/imagej/ij1-patcher/</a><br>
><br>
> But digging into it is a substantial endeavor.<br>
><br>
> Regards,<br>
> Curtis<br>
><br>
> On Thu, May 21, 2015 at 1:35 PM, Michael Schmid <<a href="mailto:schmid@iap.tuwien.ac.at">schmid@iap.tuwien.ac.at</a>> wrote:<br>
> Hi Wayne,<br>
><br>
> thank you for finding this out!<br>
><br>
> 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.<br>
><br>
> [I must admit, I know nothing about how Fiji modifies ImageJ; in a quick search I did not find anything on <a href="http://fiji.sc" target="_blank">fiji.sc</a> or the github]<br>
><br>
> Best regards,<br>
><br>
> Michael<br>
> ________________________________________________________________<br>
> Michael Schmid email: <a href="mailto:schmid@iap.tuwien.ac.at">schmid@iap.tuwien.ac.at</a><br>
> Institut für Angewandte Physik, Technische Universität Wien<br>
> Wiedner Hauptstr. 8-10/E134, A 1040 Wien, Austria<br>
> Tel. <a href="tel:%2B43%201%2058801-13452" value="+4315880113452">+43 1 58801-13452</a> or -13453, Fax <a href="tel:%2B43%201%2058801%2013499" value="+4315880113499">+43 1 58801 13499</a><br>
> ________________________________________________________________<br>
><br>
> On May 21, 2015, at 18:54, Rasband, Wayne (NIH/NIMH) [E] wrote:<br>
><br>
> > Dear Avital,<br>
> ><br>
> > 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.<br>
> ><br>
> > Best regards,<br>
> ><br>
> > -wayne<br>
> ><br>
> ><br>
> >> On May 21, 2015, at 3:03 AM, Avital Steinberg <<a href="mailto:steinbergavital@GMAIL.COM">steinbergavital@GMAIL.COM</a>> wrote:<br>
> >><br>
> >> Hi Wayne,<br>
> >> 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.<br>
> >><br>
> >> 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.<br>
> >><br>
> >> Are the attached warning messages related to the problem?<br>
> >><br>
> >> Thanks,<br>
> >> Avital<br>
> >><br>
> >> On Wed, May 20, 2015 at 6:42 PM, Rasband, Wayne (NIH/NIMH) [E] <<a href="mailto:rasbandw@mail.nih.gov">rasbandw@mail.nih.gov</a>> wrote:<br>
> >> Dear Avital,<br>
> >><br>
> >> The following version of your test macro creates a selection in the saved image.<br>
> >><br>
> >> Best regards,<br>
> >><br>
> >> -wayne<br>
> >><br>
> >> setBatchMode(true);<br>
> >> newImage("Untitled", "8-bit ramp", 500, 500, 1);<br>
> >> image1ID = getImageID();<br>
> >> newImage("Untitled", "8-bit ramp", 500, 500, 1);<br>
> >> image2ID = getImageID();<br>
> >> selectImage(image1ID);<br>
> >> if(isActive(image1ID))<br>
> >> print("The first image is active");<br>
> >> else<br>
> >> print("The first image isn't active");<br>
> >> if (isActive(image2ID))<br>
> >> print("The second image is active");<br>
> >> else<br>
> >> print("The second image isn't active");<br>
> >> run("Gaussian Blur...", "sigma=2");<br>
> >> run("Set Scale...", "distance=0");<br>
> >> run("Versatile Wand", "value=60 color=-100 gradient=10 connectedness=8-connected x=2 y=2 do");<br>
> >> run("ROI Manager...");<br>
> >> roiManager("Add");<br>
> >> saveAs("tiff", getDirectory("home")+"test.tif”)<br>
> >><br>
> >><br>
> >>> On May 20, 2015, at 5:35 AM, Avital Steinberg <<a href="mailto:steinbergavital@GMAIL.COM">steinbergavital@GMAIL.COM</a>> wrote:<br>
> >>><br>
> >>> Thanks, but the problem isn't solved. Can anyone else check if they're<br>
> >>> having similar problems running this code? Does this code create a<br>
> >>> selection in the saved image also for you?<br>
> >>><br>
> >>> setBatchMode(true);<br>
> >>> open();<br>
> >>> image1ID = getImageID();<br>
> >>> open();<br>
> >>> image2ID = getImageID();<br>
> >>> selectImage(image1ID);<br>
> >>> if(isActive(image1ID)){<br>
> >>> print("The first image is active");<br>
> >>> }<br>
> >>> else {<br>
> >>> print("The first image isn't active");<br>
> >>> }<br>
> >>><br>
> >>> if(isActive(image2ID)){<br>
> >>> print("The second image is active");<br>
> >>> }<br>
> >>> else {<br>
> >>> print("The second image isn't active");<br>
> >>> }<br>
> >>> makePoint(1854, 726);<br>
> >>> run("Gaussian Blur...", "sigma=2");<br>
> >>> run("Set Scale...", "distance=0");<br>
> >>> run("Versatile Wand", "value=60 color=-100 gradient=10<br>
> >>> connectedness=8-connected x=2 y=2 do");<br>
> >>> run("ROI Manager...");<br>
> >>> roiManager("Add");<br>
> >>> saveAs("Tiff");<br>
> >>><br>
> >>><br>
> >>> I am using ImageJ 1.49t7, which came with Java 1.6.0_065 (64 bit). I am<br>
> >>> running it on a mac, but I had the same problems also on a Linux machine<br>
> >>> with ImageJ 1.49s and java 1.6.0_24.<br>
> >>><br>
> >>> MakePoint isn't needed, but it's besides the point, since the bug has<br>
> >>> nothing to do with it and exists also without it.<br>
> >>><br>
> >>> Thanks,<br>
> >>> Avital<br>
> >>><br>
> >>> On Tue, May 19, 2015 at 6:25 PM, Michael Schmid <<a href="mailto:schmid@iap.tuwien.ac.at">schmid@iap.tuwien.ac.at</a>><br>
> >>> wrote:<br>
> >>><br>
> >>>> Hi Avital,<br>
> >>>><br>
> >>>> sorry, I can't reproduce the problem. Your macro works; it blurs the first<br>
> >>>> image and does the wand selection on it. I also get the selection in the<br>
> >>>> ROI Manager.<br>
> >>>> I tried with both 8-bit grayscale as well as RGB images.<br>
> >>>><br>
> >>>> What I don't understand is the "makePoint(1854, 726)" command; Gaussian<br>
> >>>> Blur does not care about point selections. So it blurs the whole image.<br>
> >>>><br>
> >>>> I am using ImageJ 1.49u4, Java 1.6.0_45.<br>
> >>>><br>
> >>>> Michael<br>
> >>>> ________________________________________________________________<br>
> >>>> On May 19, 2015, at 17:01, Avital Steinberg wrote:<br>
> >>>><br>
> >>>>> Hi,<br>
> >>>>> I'm trying to use Versatile Wand in batch mode. The following macro works<br>
> >>>>> well in batch mode:<br>
> >>>>><br>
> >>>>> setBatchMode(true);<br>
> >>>>> open();<br>
> >>>>> makePoint(1854, 726);<br>
> >>>>> run("Gaussian Blur...", "sigma=2");<br>
> >>>>> run("Set Scale...", "distance=0");<br>
> >>>>> run("Versatile Wand", "value=60 color=-100 gradient=10<br>
> >>>>> connectedness=8-connected x=2 y=2 do");<br>
> >>>>> run("ROI Manager...");<br>
> >>>>> roiManager("Add");<br>
> >>>>> saveAs("Tiff");<br>
> >>>>><br>
> >>>>> However - when I try to work with multiple images, select the active<br>
> >>>> image<br>
> >>>>> and then use the Versatile Wand, no selection is created:<br>
> >>>>><br>
> >>>>> setBatchMode(true);<br>
> >>>>> open();<br>
> >>>>> image1ID = getImageID();<br>
> >>>>> open();<br>
> >>>>> image2ID = getImageID();<br>
> >>>>> selectImage(image1ID);<br>
> >>>>> if(isActive(image1ID)){<br>
> >>>>> print("The first image is active");<br>
> >>>>> }<br>
> >>>>> else {<br>
> >>>>> print("The first image isn't active");<br>
> >>>>> }<br>
> >>>>><br>
> >>>>> if(isActive(image2ID)){<br>
> >>>>> print("The second image is active");<br>
> >>>>> }<br>
> >>>>> else {<br>
> >>>>> print("The second image isn't active");<br>
> >>>>> }<br>
> >>>>> makePoint(1854, 726);<br>
> >>>>> run("Gaussian Blur...", "sigma=2");<br>
> >>>>> run("Set Scale...", "distance=0");<br>
> >>>>> run("Versatile Wand", "value=60 color=-100 gradient=10<br>
> >>>> connectedness=8-connected x=2 y=2 do");<br>
> >>>>> run("ROI Manager...");<br>
> >>>>> roiManager("Add");<br>
> >>>>> saveAs("Tiff");<br>
> >>>>><br>
> >>>>> Why wouldn't this script work? Only one image is active.<br>
> >>>>><br>
> >>>>> Thank you,<br>
> >>>>> Avital<br>
> >>>><br>
> >>>> --<br>
> >>>> ImageJ mailing list: <a href="http://imagej.nih.gov/ij/list.html" target="_blank">http://imagej.nih.gov/ij/list.html</a><br>
> >>>><br>
> >>><br>
> >>> --<br>
> >>> ImageJ mailing list: <a href="http://imagej.nih.gov/ij/list.html" target="_blank">http://imagej.nih.gov/ij/list.html</a><br>
> >><br>
> >><br>
> >> <OutputWindowsWaynesCode.jpg><ConsoleWindowRedWarnings.jpg><br>
> ><br>
> > <Versatile_Wand.class><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div></div>