Hi David,
I have created a new issue for this in ADCore.
https://github.com/areaDetector/ADCore/issues/471
Mark
From: Mark Rivers
Sent: Wednesday, April 21, 2021 7:34 AM
To: David Vine <dvine at sigray.com>
Cc: tech-talk at aps.anl.gov
Subject: Re: AreaDetector Defective Pixel Correction Plugin
Hi David,
A bad pixel correction plugin would be very useful and is something I have been thinking about for a while. It seems like using a median filter around each bad pixel would be a good approach.
Here are some cases that should be handled:
-
- The neighboring pixels in the median filter happen to include other bad pixels. They need to be excluded.
-
- Only a portion of the detector is being read out.
-
- The detector is binned when being read out.
-
- The detector readout is reversed in X or Y
The NDArray NDDimension structures contain all of the information required to handle cases 2-4:
/** Structure defining a dimension of an NDArray */
typedef struct NDDimension {
size_t size; /**< The number of elements in this dimension of the array */
size_t offset; /**< The offset relative to the origin of the original data source (detector, for example).
* If a selected region of the detector is being read, then this value may be > 0.
* The offset value is cumulative, so if a plugin such as NDPluginROI further selects
* a subregion, the offset is relative to the first element in the detector, and not
* to the first element of the region passed to NDPluginROI. */
int binning; /**< The binning (pixel summation, 1=no binning) relative to original data source (detector, for example)
* The offset value is cumulative, so if a plugin such as NDPluginROI performs binning,
* the binning is expressed relative to the pixels in the detector and not to the possibly
* binned pixels passed to NDPluginROI.*/
int reverse; /**< The orientation (0=normal, 1=reversed) relative to the original data source (detector, for example)
* This value is cumulative, so if a plugin such as NDPluginROI reverses the data, the value must
* reflect the orientation relative to the original detector, and not to the possibly
* reversed data passed to NDPluginROI. */
Some drivers probably don’t set those NDDimension fields as they should, so they will need to be fixed to handle those cases.
I think the plugin should handle:
-
All NDArray data types
-
2-D NDArrays and 3-D NDArrays with ColorMode=RGB1
Hi all,
Both the Andor Ikon and Teledyne Shadobox detectors I use have defective pixel maps that need to be corrected. Currently these maps are specified in a text file listing bad pixels, rows or columns. They would typically
be corrected with an appropriate median filter.
I was thinking about implementing the correction as a plugin. Has anyone done that already?
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed.
If you have received this email in error, please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee, you should not disseminate, distribute or copy this
email. Please notify the sender immediately by email if you have received this email by mistake and delete this email from your system. If you are not the intended recipient, you are notified that disclosing, copying, distributing or taking any action in reliance
on the contents of this information is strictly prohibited