-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labkit incompatible with batch mode #85
Comments
Hi @SebastienTs , I'm following up this discussion and your email. Can you please provide more details? For example the macro you are trying to run and the corresponding model together with an example image would be great. It is otherwise very hard to reproduce your issue. See also: https://en.wikipedia.org/wiki/Minimal_working_example Thanks! Robert |
Whatever the image and classifier, this macro runs fine:
while this doesn't (no output):
Same behaviour when setting use_gpu=0 Tested on Windows 10 x64 with ImageJ2 2.3.0/1.53f; Java 1.8.0_172 [amd64] |
Actually, the problem seems more generic since other imglib based plugins returning results as virtual stacks suffer from a similar issue, or do not output anything. One example is Process > Filters > Frangi Vesselness. Would it be possible to add an option available from the dialog box to perform the computations not lazily and return a non virtual stack (which would hopefully not interfere with batch mode)? |
Hi @SebastienTs, Sorry I for the late response. I'm on parental leave right now. I will have a look at this next week. Your are right. The problem is probably not in Labkit itself, but caused by the fact that Labkit is base so much on imglib2 and scijava. |
I didn't come across a single line of good source code while debugging this code. There is a method Interpreter.addBatchModeImage(ImagePlus) this method is called correctly to add the output image the Interpreter.imageTable. All the images in the imageTable will be show when setBatchMode("exit & display") is called. The problem now is with LegacyImageMap, it gets an "DisplayUpdateEvent' and calls Harmoizer.reBuildImagePlusData() on the output image which calls LegacyUtils.deleteImagePlus() and the deleteImagePlus calls removeBatchModeImage... |
@SebastienTs The problem is caused by a bug in https://github.com/imagej/imagej-legacy. I created two PRs imagej/imagej-legacy#272, imagej/imagej-legacy#273 that will fix this. You may download and install this imagej-legacy.jar into your Fiji, if you don't want to wait for the PRs to be merged and released. |
@maarzt Thanks for looking into it. I have tried the new .jar. It works with a small glitch: in batch mode the image "output" generated by the plugin is not active by default after execution (when it is without batch mode). |
Hi @SebastienTs, that's an interesting glitch. Maybe I can a fix for that as well. How do you see which image is active in batch mode? |
I see it by running another plugin right after exiting batch mode. Good
practice is to select the image to process first, I agree, but this type of
inconstitencies between normal and batch mode can quickly degenerate in
bugs for non defensive programming...
…On Tue, Mar 8, 2022, 14:33 Matthias Arzt ***@***.***> wrote:
glitch: in batch mode the image "output" generated by the plugin is not
active by default after execution (when it is without batch mode).
Hi @SebastienTs <https://github.com/SebastienTs>, that's an interesting
glitch. Maybe I can a fix for that as well. How do you see which image is
active in batch mode?
—
Reply to this email directly, view it on GitHub
<#85 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTFCUHF77FICA7NIZWQFRDU65JMDANCNFSM5OJXFF6A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
I could reproduce the problem. This script scales the segmented image:
But when I enable batch mode, the input image (leaf.jpg) is scaled instead.
|
Labkit seems incompatible with batch mode when calling it from a macro. I hint that it comes from the fact that the results is a virtual stack. Would it be possible to add a flag so that the results is not a virtual stack (when predicting a stack of modest size).
The text was updated successfully, but these errors were encountered: