使用侦听器时查看哪个像素已更改的最快方法 [英] Fastest way to see which pixel has changed when using a listener

查看:68
本文介绍了使用侦听器时查看哪个像素已更改的最快方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用STEM获得每个扫描像素上的EDS光谱.我正在使用 EDSStartAcquisition(2048,10,fexposure * 2,1)命令并我已将以下简单的侦听器对象附加到所示的一维光谱图像中:

 字符串messagemap ="data_value_changed:MyImageAction"类MyListenerClass1{字符串event_desc;MyListenerClass1(对象自身);//Result("\ n");〜MyListenerClass1(对象自身);//Result("\ n");无效MyImageAction(对象自身,编号e_fl,图像Img){ImageGetEventMap().DeconstructEventFlags(e_fl,event_desc)Result(GetTime(1)+":图片消息:"+ event_desc +"0x" + Binary(e_fl)+"\ n")}}ListenerID1 = EDSIm.ImageAddEventListener(Listener1,消息映射) 

由于这里是速度的问题,所以我想尝试一下EDS采集的连续模式.但是然后,我需要收听哪些计数属于每个扫描像素.以下主题(如何全速获取采集的帧?-似乎并非在每个事件之后都执行图像事件监听器)展示了如何收听图像的最后一个像素变化.但是,在每个事件中直接查看一维频谱的哪个部分发生变化的最快方法是什么?无需遍历每一片...

提前谢谢!

解决方案

只要以下情况,就会触发图像的 data_value_changed :发布,或b)在代码中进行特定的更新调用.

这样,当获取累积的EDS频谱时,整个阵列被锁定",然后被修改(在一个或多个位置上),然后被更新".没有关于阵列修改位置的具体信息.

因此,找出频谱在哪里变化的唯一方法是通过比较"before"信号的副本.与现在"-效率不高.

I am trying to get EDS spectra on every scanned pixel using STEM. I am using the EDSStartAcquisition( 2048, 10,fexposure*2, 1) command and I have attached the following simple listener object into the shown 1D spectrum image:

string messagemap = "data_value_changed:MyImageAction"  
    Class MyListenerClass1
    {
    String event_desc;

    MyListenerClass1(Object self); //Result("\n");
    ~MyListenerClass1(Object self);// Result("\n");
    
        
        Void MyImageAction(Object self, Number e_fl, Image Img)
        {   
        ImageGetEventMap().DeconstructEventFlags( e_fl, event_desc )
        Result(GetTime(1)+": Image message : " + event_desc + " 0x" + Binary(e_fl) + "\n" ) 
        }
    }

ListenerID1 = EDSIm.ImageAddEventListener( Listener1, messagemap)

Since speed is the issue here, I figured to try the continuous mode of the EDS acquisition. But then I would need to listen which counts belong to each scanned pixel. The following topic (How to getting acquired frames at full speed ? - Image Event Listener does not seem to be executing after every event) shows how to listen to the last pixel change of an image. But what would be the fastest way to directly see which slice of the 1D spectrum has changed on every event? Without going through every slice...

thanks in advance!

解决方案

An images' data_value_changed is fired whenever a) an image locker (the object that ensures there is single access to the memory) is released, or b) a specific update-call is made in the code.

As such, when a cumulative EDS spectrum is acquired, the whole array gets "locked", then modified (on one or more positions) and then 'updated'. There is no specific information carried on where the array was modified.

Therefore, the only way to find out where the spectrum changed is by comparing a copy of the "before" with the "now" - which is not super efficient.

这篇关于使用侦听器时查看哪个像素已更改的最快方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆