<div dir="ltr">Hi Adrian,<div><br></div><div><div>> 1) How does one prevent a @Parameter from showing up in the harvesting</div><div>> GUI dialog, in the manner of a '@Parameter LogService log'? (more</div><div>> below)</div></div><div><br></div><div>Parameters which are resolved before the input harvester dialog pops up will not show up.</div><div><br></div><div>They get resolved by the various preprocessors in the preprocessing chain, which is applied before the module is actually run. The InputHarvester -- which is what pops the dialog box -- is (IIRC) the final preprocessing step before run happens.</div><div class="gmail_extra"><br></div><div class="gmail_extra">We could add a way to mark parameters which are not desired to be shown in the dialog box. What is your use case for a parameter you want to have in the script, but never shown to the user in cases where it is still null?</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">> 2) A net.imagej.overlay.RectangleOverlay parameter, although properly</div><div class="gmail_extra">> populated, provoques an Exception after the execution of the command.</div><div class="gmail_extra">> (more details and stacktraces below)</div><div><br></div><div>As I mentioned in the other thread: try with Overlay instead? We could certainly make it autofill parameters with specific Overlay subclasses too—just need to confirm first that that is indeed your problem.</div><div><br></div><div><div>> 3) When a new preview is triggered, and that preview modifies numeric</div><div>> parameters, then the numeric values visible in the gui dialog are</div><div>> updated except for the NumericField on which input has triggered the</div><div>> call to preview().</div></div><div><br></div><div>It is a programming error for the preview() function to modify parameter values. Use callbacks instead, which occur before preview() is called [1].</div><div><br></div><div><div>> 4) It would be nice if a parameter could have a label even if</div><div>> ItemVisibility is MESSAGE</div><div><br></div><div>Fixed [2].</div></div><div><br></div><div>Regards,</div><div>Curtis</div><div><br></div><div>[1] <a href="https://github.com/scijava/scijava-common/blob/scijava-common-2.44.2/src/main/java/org/scijava/widget/DefaultWidgetModel.java#L167-L169">https://github.com/scijava/scijava-common/blob/scijava-common-2.44.2/src/main/java/org/scijava/widget/DefaultWidgetModel.java#L167-L169</a></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">[2] <a href="https://github.com/scijava/scijava-ui-swing/commit/84c30c045bf3327a424f499f1f2fe867b0d9375e">https://github.com/scijava/scijava-ui-swing/commit/84c30c045bf3327a424f499f1f2fe867b0d9375e</a></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 23, 2015 at 6:44 AM, Adrian Daerr <span dir="ltr"><<a href="mailto:adrian.daerr@univ-paris-diderot.fr" target="_blank">adrian.daerr@univ-paris-diderot.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Dear ImageJ developers,<br>
<br>
As I slowly learn more about IJ2 @Plugins, I have one question and three minor comments that I would like to submit to you.<br>
<br>
1) How does one prevent a @Parameter from showing up in the harvesting<br>
GUI dialog, in the manner of a '@Parameter LogService log'? (more below)<br>
<br>
2) A net.imagej.overlay.RectangleOverlay parameter, although properly<br>
populated, provoques an Exception after the execution of the command.<br>
(more details and stacktraces below)<br>
<br>
3) When a new preview is triggered, and that preview modifies numeric<br>
parameters, then the numeric values visible in the gui dialog are<br>
updated except for the NumericField on which input has triggered the<br>
call to preview().<br>
<br>
4) It would be nice if a parameter could have a label even if<br>
ItemVisibility is MESSAGE:<br>
@Parameter(persist = false,<br>
visibility = org.scijava.ItemVisibility.MESSAGE,<br>
label = "Current foo value")<br>
private double foo = 0;<br>
(currently, at least on my box, the label is not shown in this case)<br>
Obviously a workaround is to build a String with label+foo instead.<br>
<br>
cheers,<br>
Adrian<br>
<br>
<br>
<br>
ad 1)<br>
How to prevent a @Parameter from showing up in the harvesting GUI<br>
dialog? Some seem to be masked by default (ImagePlus, LogService), but<br>
I did not find the appropriate annotation to make the parameter roi in<br>
the following not show up, although it is already properly populated<br>
by the rectangular selection of the active image ? There is no<br>
meaningful thing I can do with the associated selector in the dialog.<br>
<br>
@Parameter private ImagePlus imp;<br>
@Parameter private RectangleOverlay roi;<br>
@Parameter private double a;<br>
<br>
<br>
ad 2)<br>
A net.imagej.overlay.RectangleOverlay parameter<br>
<br>
@Parameter private RectangleOverlay roi;<br>
<br>
is properly populated when the Command is invoqued on an active image<br>
containing a rectangular selection. However it provoques an Exception<br>
after the execution of the command, when either the<br>
DefaultPrefService, or the Recorder if a persist=false attribute is<br>
added, apparently tries to record a 'null' value for an option. The<br>
two stacktraces are<br>
<br>
[ERROR] Module threw exception<br>
java.lang.NullPointerException<br>
at java.util.prefs.AbstractPreferences.put(AbstractPreferences.java:224)<br>
at org.scijava.prefs.DefaultPrefService.put(DefaultPrefService.java:183)<br>
at org.scijava.module.DefaultModuleService.save(DefaultModuleService.java:278)<br>
at org.scijava.module.process.SaveInputsPreprocessor.saveValue(SaveInputsPreprocessor.java:74)<br>
at org.scijava.module.process.SaveInputsPreprocessor.process(SaveInputsPreprocessor.java:65)<br>
at org.scijava.module.ModuleRunner.preProcess(ModuleRunner.java:104)<br>
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:156)<br>
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)<br>
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)<br>
at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:191)<br>
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)<br>
at java.util.concurrent.FutureTask.run(FutureTask.java:138)<br>
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)<br>
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)<br>
at java.lang.Thread.run(Thread.java:662)<br>
<br>
[ERROR] Module threw exception<br>
java.lang.NullPointerException<br>
at ij.plugin.frame.Recorder.addQuotes(Recorder.java:612)<br>
at ij.plugin.frame.Recorder.recordOption(Recorder.java:362)<br>
at net.imagej.legacy.IJ1Helper.recordOption(IJ1Helper.java:467)<br>
at net.imagej.legacy.plugin.MacroRecorderPostprocessor.process(MacroRecorderPostprocessor.java:70)<br>
at org.scijava.module.ModuleRunner.postProcess(ModuleRunner.java:116)<br>
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:176)<br>
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)<br>
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)<br>
at org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:191)<br>
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)<br>
at java.util.concurrent.FutureTask.run(FutureTask.java:138)<br>
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)<br>
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)<br>
at java.lang.Thread.run(Thread.java:662)<br>
<br>
_______________________________________________<br>
ImageJ-devel mailing list<br>
<a href="mailto:ImageJ-devel@imagej.net" target="_blank">ImageJ-devel@imagej.net</a><br>
<a href="http://imagej.net/mailman/listinfo/imagej-devel" rel="noreferrer" target="_blank">http://imagej.net/mailman/listinfo/imagej-devel</a><br>
</blockquote></div><br></div></div>