> I'm having some trouble with the background subtraction in the NDPluginProcess and UInt16 data type.
> Whenever the values would turn negative due to the background subtraction, the UInt16 wraps around and produces values close to 65536.
> What is the best way to avoid this this?
That depends on what you want to get from the output.
If you want to preserve the negative values then you could set the output data type to Int32. That will make the output arrays larger, but it will preserve UInt16 values up to 65535 as well as handle negative numbers.
If you are OK with clipping negative numbers to 0 then you could do what Hugo suggested and clip the low value to 0. Then the output arrays can be left as UInt16 data type.
Mark
-----Original Message-----
From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Laurenz Rettig via Tech-talk
Sent: Tuesday, March 16, 2021 5:19 PM
To: tech-talk at aps.anl.gov
Subject: NDPluginProcess Background subtraction UInt wrap around
Hi,
I'm having some trouble with the background subtraction in the NDPluginProcess and UInt16 data type. Whenever the values would turn negative due to the background subtraction, the UInt16 wraps around and produces values close to 65536. What is the best way to avoid this this?
Thanks, Laurenz
--
Dr. Laurenz Rettig
Fritz Haber Institute of the Max Planck Society Department of Physical Chemistry Dynamics of Correlated Materials Faradayweg 4-6
14195 Berlin, Germany
phone: +49-(0)30-8413 5225
email: rettig at fhi-berlin.mpg.de
- Replies:
- RE: NDPluginProcess Background subtraction UInt wrap around Mark Rivers via Tech-talk
- References:
- NDPluginProcess Background subtraction UInt wrap around Laurenz Rettig via Tech-talk
- Navigate by Date:
- Prev:
Re: NDPluginProcess Background subtraction UInt wrap around Hugo Slepicka via Tech-talk
- Next:
RE: NDPluginProcess Background subtraction UInt wrap around Mark Rivers 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
2023
2024
- Navigate by Thread:
- Prev:
Re: NDPluginProcess Background subtraction UInt wrap around Hugo Slepicka via Tech-talk
- Next:
RE: NDPluginProcess Background subtraction UInt wrap around Mark Rivers 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
2023
2024
|