EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
<== Date ==> <== Thread ==>

Subject: Re: Is there a maximum threshold plugin for areaDetector?
From: Matt Newville via Tech-talk <tech-talk at aps.anl.gov>
To: "Marco A. Barra Montevechi Filho" <marco.filho at lnls.br>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 15 Aug 2023 13:11:07 -0700
We see this sort of issue for Eiger area detectors, which encode bad pixels with a value of 2**Nbits - mask, where the mask describes the nature of the bad pixel.  If that is what you are seeing, I'm not sure that setting a maximum value (say, 65000 or 4,290,000) is really the best option.  Instead, one could consider setting a negative value (say 16 or 1024) and subtracting that from the maximum unsigned value to identify pixels marked as bad.  That negative masking value would likely be more independent of changing from 16- to 32-bit images.

As a workaround, we typically convert the output type from unsigned to signed, and then a threshold of zero does set bad pixels to zero. That is useful for live viewing (and independent of bit level), even if it lowers the full dynamic range for live display.  We typically include this thresholding in the plugin chain for displays. 

We still have the file-saving plugin save the full unsigned integer data,  preserving the bad pixel encoding and dynamic range and allowing masks for bad pixels to be both determined and applied.


On Tue, Aug 15, 2023 at 9:38 AM Marco A. Barra Montevechi Filho via Tech-talk <tech-talk at aps.anl.gov> wrote:
Specifically for Sirius applications, it would be useful to set all values above upper threshold to zero. If i understand the current plugin, it only replaces the values above upper threshold with the upper threshold value itself, right?

Im thinking about a threshold that determine which plugins will be replaced and the actual replacement value

Thanks for your time,

Marco

From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: 15 August 2023 12:40
To: Wang Xiaoqiang <xiaoqiang.wang at psi.ch>; Marco A. Barra Montevechi Filho <marco.filho at lnls.br>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: RE: Is there a maximum threshold plugin for areaDetector?
 
I agree that the clipping should be made more flexible.  I think it would be good to make this more general that replacing with 0 or the clip value.  Users might want to replace the clip values with non-zero user-specified values, for example -1, -2, etc.

I will work on this soon.

Mark


-----Original Message-----
From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Wang Xiaoqiang via Tech-talk
Sent: Tuesday, August 15, 2023 1:18 AM
To: Marco A. Barra Montevechi Filho <marco.filho at lnls.br>; tech-talk at aps.anl.gov
Subject: Re: Is there a maximum threshold plugin for areaDetector?


Hi Marco,

In the NDPluginProcess, there is a clipping option. It clamps the pixel values within a given range.

If by masking you mean zero the pixel value, there is no plugins I know of. I had such a need and wrote a request here,
https://github.com/areaDetector/ADCore/issues/492

Best
Xiaoqiang

On 8/14/23 21:11, Marco A. Barra Montevechi Filho via Tech-talk wrote:
> Hi all!
>
> Im using BadPixel plugin to mask some bad pixels in our detectors. The thing is some pixels only show broken values from time to time...
>
> Is there any plugin that would mask any pixel with a value above a certain configurable threshold value?
>
> In a similar line of thought, I noticed the statistics plugin allows the user to configure a minimal value (centroidThreshold) below which the pixel value is not going to be considered. Is there something similar for a *maximum* value?
>
> Thanks for any hints,
>
> Marco
>
> Aviso Legal: Esta mensagem e seus anexos podem conter informações confidenciais e/ou de uso restrito. Observe atentamente seu conteúdo e considere eventual consulta ao remetente antes de copiá-la, divulgá-la ou distribuí-la. Se você recebeu esta mensagem por engano, por favor avise o remetente e apague-a imediatamente.
>
> Disclaimer: This email and its attachments may contain confidential and/or privileged information. Observe its content carefully and consider possible querying to the sender before copying, disclosing or distributing it. If you have received this email by mistake, please notify the sender and delete it immediately.
>


References:
Is there a maximum threshold plugin for areaDetector? Marco A. Barra Montevechi Filho via Tech-talk
Re: Is there a maximum threshold plugin for areaDetector? Wang Xiaoqiang via Tech-talk
RE: Is there a maximum threshold plugin for areaDetector? Mark Rivers via Tech-talk
Re: Is there a maximum threshold plugin for areaDetector? Marco A. Barra Montevechi Filho via Tech-talk

Navigate by Date:
Prev: RE: Is there a maximum threshold plugin for areaDetector? Mark Rivers via Tech-talk
Next: asyn makeSupport.pl doesn't respect configure/RELEASE.local Leblanc, Gregory via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
Navigate by Thread:
Prev: Re: Is there a maximum threshold plugin for areaDetector? Marco A. Barra Montevechi Filho via Tech-talk
Next: Storing the output of ticker in the PVXS example into a database record in an IOC Wang, Andrew via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
ANJ, 16 Aug 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·