MM 2.0 on the fly plug-in, Error consuming images.

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

MM 2.0 on the fly plug-in, Error consuming images.

Vincent
Hello

I've realize a 2.0 plug-in for processing image data "on the fly".
Everything worked fine during the test with the MM live demo.
but when doing it in real condition, it only process the 1st image on stop deplqying qny other images until I remove my plugin from the pipeline.

The Log shows a problem with the ContrastCalculator :

[IFO,App] Error consuming images
          [       ] java.lang.ArrayIndexOutOfBoundsException: 14491 in Thread[AWT-EventQueue-0,6,main]
          [       ]   at org.micromanager.display.internal.ContrastCalculator$InternalCalculator.calculate16BitSingleComponent(ContrastCalculator.java:344)
          [       ]   at org.micromanager.display.internal.ContrastCalculator$InternalCalculator.calculate(ContrastCalculator.java:175)
          [       ]   at org.micromanager.display.internal.ContrastCalculator.calculateHistogram(ContrastCalculator.java:483)
          [       ]   at org.micromanager.display.internal.ContrastCalculator.calculateHistogramWithSettings(ContrastCalculator.java:505)
          [       ]   at org.micromanager.display.internal.CanvasUpdateQueue.updateHistogram(CanvasUpdateQueue.java:410)
          [       ]   at org.micromanager.display.internal.CanvasUpdateQueue.scheduleHistogramUpdate(CanvasUpdateQueue.java:377)
          [       ]   at org.micromanager.display.internal.CanvasUpdateQueue.showImage(CanvasUpdateQueue.java:305)
          [       ]   at org.micromanager.display.internal.CanvasUpdateQueue.consumeImages(CanvasUpdateQueue.java:232)
          [       ]   at org.micromanager.display.internal.CanvasUpdateQueue.access$000(CanvasUpdateQueue.java:81)
          [       ]   at org.micromanager.display.internal.CanvasUpdateQueue$1.run(CanvasUpdateQueue.java:147)
          [       ]   at java.awt.event.InvocationEvent.dispatch(Unknown Source)
          [       ]   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
          [       ]   at java.awt.EventQueue.access$000(Unknown Source)
          [       ]   at java.awt.EventQueue$1.run(Unknown Source)
          [       ]   at java.awt.EventQueue$1.run(Unknown Source)
          [       ]   at java.security.AccessController.doPrivileged(Native Method)
          [       ]   at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
          [       ]   at java.awt.EventQueue.dispatchEvent(Unknown Source)
          [       ]   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
          [       ]   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
          [       ]   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
          [       ]   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
          [       ]   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
          [       ]   at java.awt.EventDispatchThread.run(Unknown Source)

Someone knows how to fix that ? where does the error come from ?
Any help would be appreciated

Vincent
Reply | Threaded
Open this post in threaded view
|

Re: MM 2.0 on the fly plug-in, Error consuming images.

Peterbauer Thomas

On 2016-06-22 04:02, Vincent wrote:
> The Log shows a problem with the ContrastCalculator :
>
> [IFO,App] Error consuming images
>            [       ] java.lang.ArrayIndexOutOfBoundsException: 14491 in
> Thread[AWT-EventQueue-0,6,main]
>            [       ]   at
> org.micromanager.display.internal.ContrastCalculator$InternalCalculator.calculate16BitSingleComponent(ContrastCalculator.java:344)
>            [       ]

I don't know if it's exactly the same problem, but I faced similar
exceptions with one of my on-the-fly processors. In my case, it was
caused the method defined by MM's abstract processor class:

     public void processImage(Image image, ProcessorContext context)

It occasionally did not pass an image as argument, but null. As a
workaround, I included a null check for both the image and the
processorContext, and let the plugin return without doing anything if
one of them is indeed null (of course, it would be better to find the
source of the null argument upstream in the pipeline; it seems that
something goes wrong there occasionally).

Best,
Thomas
------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MM 2.0 on the fly plug-in, Error consuming images.

Chris Weisiger
In reply to this post by Vincent
Hi Vincent,

On Tue, Jun 21, 2016 at 7:02 PM, Vincent <[hidden email]> wrote:
Hello

I've realize a 2.0 plug-in for processing image data "on the fly".
Everything worked fine during the test with the MM live demo.
but when doing it in real condition, it only process the 1st image on stop
deplqying qny other images until I remove my plugin from the pipeline.

The Log shows a problem with the ContrastCalculator :

Hm, that shouldn't be happening! The most obvious potential cause I can think of is that the dimensions of the pixel data buffer for the image do not match the dimensions the image thinks it has. For example, if this image was created by calling DataManager.createImage(buffer, width, height, bytesPerPixel, numComponents, coords, metadata). If the buffer's length is less than width * height then there will be problems.

I went ahead and pushed a commit that will throw an IllegalArgumentException if you attempt to create an Image with an inadequate pixel buffer. This commit will be live in tonight's nightly (dated 20160622). Of course, it won't fix the problem you're encountering, but it should at least make the error more apparent, if in fact I've correctly guessed what is going wrong. If you examine your code and determine that the image dimensions are in fact correct for the pixel buffer you're providing, then something else must be going wrong, and I'd appreciate a repro case (if possible, with sample data).

-Chris

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MM 2.0 on the fly plug-in, Error consuming images.

Chris Weisiger
In reply to this post by Peterbauer Thomas
Hi Thomas,

On Wed, Jun 22, 2016 at 12:39 AM, Peterbauer Thomas <[hidden email]> wrote:

     public void processImage(Image image, ProcessorContext context)

It occasionally did not pass an image as argument, but null. As a
workaround, I included a null check for both the image and the
processorContext, and let the plugin return without doing anything if
one of them is indeed null (of course, it would be better to find the
source of the null argument upstream in the pipeline; it seems that
something goes wrong there occasionally).

I agree wholeheartedly, to the extent that the pipeline code that sends images to processors already has checks to make certain that it doesn't send null images to processors! So clearly something is going wrong there. Can you describe what circumstances your plugin is running in when you receive null arguments? Is it a null ProcessorContext, or a null Image, or both? Thanks!

-Chris


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MM 2.0 on the fly plug-in, Error consuming images.

Peterbauer Thomas


On 2016-06-22 18:44, Chris Weisiger wrote:
Hi Thomas,

On Wed, Jun 22, 2016 at 12:39 AM, Peterbauer Thomas <<mailto:[hidden email]>[hidden email]<mailto:[hidden email]>> wrote:

     public void processImage(Image image, ProcessorContext context)

It occasionally did not pass an image as argument, but null. As a
workaround, I included a null check for both the image and the
processorContext, and let the plugin return without doing anything if
one of them is indeed null (of course, it would be better to find the
source of the null argument upstream in the pipeline; it seems that
something goes wrong there occasionally).

I agree wholeheartedly, to the extent that the pipeline code that sends images to processors already has checks to make certain that it doesn't send null images to processors! So clearly something is going wrong there. Can you describe what circumstances your plugin is running in when you receive null arguments? Is it a null ProcessorContext, or a null Image, or both? Thanks!

It happened in multidimensional acquisitions with an Orca ER camera (I never faced it while writing and debugging the plugin with the demo camera adapter) and as far as I remember it was always the image which was null, not the processorContext. I tried it right now with a fairly new MM2.0 build (20160616) and did not encouter it any more, so this issue may be fixed.

A minor and low-priority point, though somewhat annoying: if I have some plugin in the processor pipeline and exit MM, the pipeline and configurator GUI is always popping up on the next startup. It seems that the configurator's "showGUI()" method is invoked on each startup. Is this intended? (It happens not only with my home-brewn processor plugins, but also with the preinstalled ones, both on Windows with a full setup or on Linux/Ubuntu with demo camera).

Best,
Thomas

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MM 2.0 on the fly plug-in, Error consuming images.

Chris Weisiger
Hi Thomas,

On Thu, Jun 23, 2016 at 4:15 AM, Peterbauer Thomas <[hidden email]> wrote:

A minor and low-priority point, though somewhat annoying: if I have some plugin in the processor pipeline and exit MM, the pipeline and configurator GUI is always popping up on the next startup. It seems that the configurator's "showGUI()" method is invoked on each startup. Is this intended? (It happens not only with my home-brewn processor plugins, but also with the preinstalled ones, both on Windows with a full setup or on Linux/Ubuntu with demo camera).

This is intentional, as we want to remind users that they have the same pipeline that they had when they last ran µManager. Our goal was to avoid having to have users manually set up the same processing pipeline every time they ran the program, which could be tedious especially for things like the Image Flipper, which you typically would always want to have turned on (assuming you need it in the first place). However, we also want the user to be aware that they're modifying the image data they're acquiring; it didn't seem like a good idea to "silently" have a data processing pipeline in place. Hence the GUI being displayed when you launch the program.

We're open to suggestions as to how this behavior might be improved. I know all the extra windows can get in the way sometimes.

-Chris


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MM 2.0 on the fly plug-in, Error consuming images.

Peterbauer Thomas
On 2016-06-23 17:28, Chris Weisiger wrote:
Hi Thomas,

On Thu, Jun 23, 2016 at 4:15 AM, Peterbauer Thomas <<mailto:[hidden email]>[hidden email]<mailto:[hidden email]>> wrote:

A minor and low-priority point, though somewhat annoying: if I have some plugin in the processor pipeline and exit MM, the pipeline and configurator GUI is always popping up on the next startup. It seems that the configurator's "showGUI()" method is invoked on each startup. Is this intended? (It happens not only with my home-brewn processor plugins, but also with the preinstalled ones, both on Windows with a full setup or on Linux/Ubuntu with demo camera).

This is intentional, as we want to remind users that they have the same pipeline that they had when they last ran µManager. Our goal was to avoid having to have users manually set up the same processing pipeline every time they ran the program, which could be tedious especially for things like the Image Flipper, which you typically would always want to have turned on (assuming you need it in the first place). However, we also want the user to be aware that they're modifying the image data they're acquiring; it didn't seem like a good idea to "silently" have a data processing pipeline in place. Hence the GUI being displayed when you launch the program.

We're open to suggestions as to how this behavior might be improved. I know all the extra windows can get in the way sometimes.



I think the best compromise would be to open the window with the processor pipeline, but to leave individual configurator GUIs closed. This would remind users that there is something in the pipeline, but would avoid unnecessary mouse clicks or extra windows cluttering the desktop. A special case is the processor I have recently written: there is nothing to configure, the configurator pops up just a dialog stating exactly that (it's a very simple processor converting images to 8 bit, since I have a camera which does not offer this option), so it's really annoying here to see this dialog on each startup...


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MM 2.0 on the fly plug-in, Error consuming images.

Chris Weisiger
Hi Thomas,

On Thu, Jun 23, 2016 at 2:10 PM, Peterbauer Thomas <[hidden email]> wrote:

I think the best compromise would be to open the window with the processor pipeline, but to leave individual configurator GUIs closed. This would remind users that there is something in the pipeline, but would avoid unnecessary mouse clicks or extra windows cluttering the desktop.

Good news: on conferring, we agree with you, so it'll work this way starting with tonight's nightly build. :)

-Chris


------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MM 2.0 on the fly plug-in, Error consuming images.

Peterbauer Thomas
On 2016-06-23 23:24, Chris Weisiger wrote:
Hi Thomas,

On Thu, Jun 23, 2016 at 2:10 PM, Peterbauer Thomas <<mailto:[hidden email]>[hidden email]<mailto:[hidden email]>> wrote:

I think the best compromise would be to open the window with the processor pipeline, but to leave individual configurator GUIs closed. This would remind users that there is something in the pipeline, but would avoid unnecessary mouse clicks or extra windows cluttering the desktop.

Good news: on conferring, we agree with you, so it'll work this way starting with tonight's nightly build. :)


Great! Thank you!

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MM 2.0 on the fly plug-in, Error consuming images.

Vincent
Hello
I Try the nighlybuild , but didn't change the logs, they remain the same.
I've create a repo of this project
https://github.com/Wickywa/Wiener2.0
If you would like to check.
The thing is, the problem isn't present with the demo live 512x512.
and only occurred while using the real camera (2048x2048) in my case.

Sincerely
Vincent