Problem description

When X-ray beam with continuous energy spectrum is used for transmission radiography the beam hardening effect arises. A thicker i.e. more attenuating parts of the object attenuate softer parts of the original spectrum more effectively then thinner parts as illustrated in next chart (measured with tungsten X-ray tube at 90kV and Medipix2 detector).

X-ray beam energy spectrum varies from point to point behind an object of non uniform attenuation. If an efficiency of the sensor pixels is energy dependent (and it is) then this effect leads to distortions making tomographic reconstruction almost impossible. Moreover if such efficiency dependence is different for individual pixels then even single images are distorted remarkably (see images below).


 Flat field correction can improve the image distorted by non uniform pixel efficiency but just for certain absorber thickness. In pictures below it can be seen that flat field correction using open beam image will improve thin parts of the object but thick parts seem to be noisy. For flat field correction of the same data using image of 0.16mm thick Aluminum foil the situation is opposite: thin parts are noisy but thick are OK.

 It is obvious that some kind of combination of such flat field corrections is needed. This is done by calibration method. Result is shown in following picture. One can see that all object thicknesses are imaged clearly without noticeable noise.

The efficiency of pixels differs significantly as illustrated in next chart. BH calibration plugin calibrates efficiency of each individual pixel for different spectrum shapes corresponding to different attenuations.

To make proper calibration it is necessary to prepare set of perfectly flat calibrators of different thicknesses covering thickness range of the object to be inspected. A calibrator material should be similar to the material of the object (in fact this demand is not very strict - Aluminum or plastic foils are good in most cases, even for biological samples). Range of calibrator thicknesses (attenuations) should cover attenuation range of the object to be inspected. The transmission measurement of each calibrator has to be done to acquire set of calibration points for each pixel.  X-ray tube settings and tube-detector distance have to remain constant for all measurements.

Dependence of the count rate on the thickness is this way known at least at set of calibration points (thicknesses) for each pixel. Between calibration points the interpolation has to be used. BH calibration plugin uses preferably a "weighted exponential interpolation with offset" inside of each interval.

Using inversion of such calibration curve it is possible to transform measured raw data image (count rates) to equivalent absorber thicknesses.

Just for illustration let us show the used calibration formula (y is count rate, yk is count rate in k-th calibration point, xk is thickness in k-th calibration point, ak is numerically precomputed parameter characterizing exponential base in k-th interval and finally c(y) is estimated object thickness):

As a correct calibration curve is used for each pixel the resulting image is dramatically better. It is necessary to note that image is in linear scale after the transformation. The linearization feature has great impact for methods of tomographic reconstruction. The transformation is superior to standard flat-field correction as it is valid for all range of attenuations not just for one value.

Further details are described in this article.

Operating BH correction plugin for Pixelman

BH correction plugin performs image transformation described sooner. It is even able to estimate error of thickness measurement in each pixel. To do the error estimation it is necessary to perform each measurement several times to allow noise estimation for each pixel. The calibration procedure is following:

  1. Prepare set of calibrators which covers attenuation range of your object. E.g. if your object ranges from 0 to 10 mm (biological) and your calibrators are made of plastic foils or wax (to be similar to tissue) it is good to use thicknesses: 0, 0.1, 0.25, 0.5, 1, 2, 5, 10mm. The measurement of each calibrator should be with good statistics (e.g. 10 times higher then used for object measurement). As the gradient of the curve is the highest at the beginning it is better to have more points for low calibrator thicknesses.
  2. Make several (e.g. 10) images of the first calibrator with good statistics (avoiding overflow of pixel counters). Then open main window of BH correction plugin (using tray menu) and press "Frames" button. BH correction plugin will compute sum of all frames in Pixelman frame buffer and standard deviation for each pixel. If just single frame is measured then the Poisson distribution is expected and appropriate error is used. The total exposure time will be obtained from Pixelman as well. The first item will appear in list named "Loaded masks". It is possible to change each item of the list by clicking on it, changing the item properties in edit boxes below the list and pressing "Set" button.
  3. Repeat previous point for all prepared calibrators. For each of them do not forget to specify its precise thickness! Adding new calibration point can take several seconds as calibration curves are recomputed for all pixels. Remember that X-ray tube settings and geometry has to remain constant during calibration process and even during object measurement. If the beam properties or the detector-source distance is changed calibration has to be repeated. Placement of the object doesn't matter and can be changed freely. When all masks are loaded you can save all settings using "Save" profile button. On pixelman exit the current configuration is saved automatically to default config file for each connected device. The configuration is loaded automatically on next pixelman start.
  4. Now you can make calibration of either just measured data in frame buffer (pressing "Frame(s)" button) or data stored on the disk (using "File" or "Batch" button). Also for object measurement it is better to perform several measurements for more reliable error estimation. If just single frame is measured then the Poisson distribution is expected and appropriate error is used. Results can be saved using "Save current result". You can select which result should be saved. Result are saved to ASCII files containing double values. To see the result you can use "Preview" button. In preview window on click on certain pixel the calibration curve with errors is displayed in chart below. Result can be displayed also in standard Preview window of the Pixelman's Medipix Control UI plugin selecting "BH correction" as frame source.

Remarks and examples

If set of calibrators doesn't cover attenuation range of the object completely the plugin can use an extrapolation (to disable this option use "Make extrapolation" check box which is enabled by default). Extrapolation is not very accurate but it is still better then flat field correction. Error estimation is very rough in this case.

Plugin will discover defective pixels (noisy or dead, their calibration curve is of incorrect shape) and can make interpolation of that pixels using weighted average of neighbouring pixels (using their errors). Algorithm can interpolate even large continuous areas (but it is rather CPU intensive). So bad pixels will disappear (to disable this feature use "Estimate bad pixels" check box which is checked by default).

Effect of BH correction and bad pixel removal is clearly seen in screen shots below (Part of termite head with antenna is imaged with high geometrical magnification - antenna diameter is 70um).

Preview of source data (not corrected):
Preview of corrected Value (thickness):
Preview of Value with zoomed calibration curve for pixel [37,0]: