|
| Hamburg University - Chemistry - TMC - Stribeck - 2D Preprocessing | Search |
| POLYMER PHYSICS | Preprocessing of 2D Scattering Images |
Image preprocessing of 2D scattering patternsNorbert Stribeck
IntroductionModern 2D X-ray detectors record high resolution scattering patterns with a low signal-to-noise ratio. Apart from the scattering data such images show several kinds of artifacts, which must be detected and marked as blind regions. Before starting to analyse the data it is desirable to calibrate and correct the scattering pattern as well as to fill the blind regions. While in the case of 1D data such apparative corrections are well-established and comparatively simple, the preprocessing of 2D patterns is more complex and conveniently performed by special image processing methods, which are not yet common knowledge in the field of scattering analysis. For this purpose of image processing commercial programming environments for the scientist (e. g. pv-wave, IDL) provide those special library functions, which are adapted to the needs of a fast and reliable image processing. In this documentation a feasible procedure for the preprocessing of small-angle X-ray scattering (SAXS) patterns recorded on image plate shall be demonstrated. In the language of image processing, artifacts are addressed as morphological features[Examples: ``All the pixels with intensities less than 50 counts are shaded from the metal of the vacuum tube or by the metal of the primary beam stop'' -- ``All the pixels close to a sudden intensity drop are partly shaded from the electrical wires connected to the pin diode'' -- ``But all those shades do not form small islands'']. Similarly they can be isolated and processed by application of morphological operators. FocusEach data processing procedure relies on some general constraints of the site (Local processing devices, data formats, software) and the experimental setup (detector type, auxiliary devices, geometry). Thus the following documentation of processing steps is adapted to the special needs of a special setup (Image plate detector and SAXS setup with vacuum tube) at the synchrotron radiation beamline A2 at HASYLAB, Hamburg, Germany. Nevertheless, I consider many of the ideas to be of general interest. Fog Level SubtractionEvery image plate shows an almost constant background, which increases with increasing period between its erasure and its exposure. Thus the experimental setup should ensure that part of the image plate area is not exposed to radiation. This area can be used for the purpose of fog level subtraction by a simple pv-wave procedure. Moreover, using the position of this test area on the plate one can easily detect and correct for the varying position of the image plate in its holders (during exposure and during readout). A second corrective step will be the subtraction of the apparative background scattering. And sometimes images are geometrically distorted and need unwarping. Calibration for Constant Primary Beam IntensityDuring a luminosity run of the synchrotron the beam intensity is decreasing. Thus the primary beam intensity is generally measured by means of an ionization chamber. Absorption of the X-ray beam by the sample may be measured by a second device mounted in the primary beam stop. This device may be a second ionization chamber or a pin diode. Although the correction procedures arising from this setup are straightforward, apparently many users have problems and create a wealth of correction equations, which reflect different levels of understanding. Some wrong equations even find their way into published papers. In order to be simple and efficient, I recommend to divide every pattern by the reading of the primary beam intensity monitor (``first ionization chamber''). The readings of the absorption monitor (``second ionization chamber'' or ``pin diode'') should be divided in the same way at this very step of data evaluation in order to avoid confusion. Now one can proceed as if one had measured ``at home in the lab'', using well-understood methods. Another calibration step will finally consider variations of the irradiated volume. Viewport PositioningIf image plates are used as a detector, the absolute position of the detector changes from recording to recording. This means that sample pattern and background pattern must be positioned to the same position with respect to the setup before the background can be subtracted. The viewport can be positioned using any fixed morphological feature in the image, which comes from the experimental setup (e. g. the position of the illuminated area). If no such feature is available, one can easily introduce it by covering part of the illuminated area, detecting the corresponding shade, computing its center of gravity and moving each image respectively. Masking of Artifact RegionsOverviewSlit scattering can be detected in the background pattern by application of a level mask. Similarly totally shaded areas can be isolated in the sample pattern. Partly shaded areas should be detectable by a gradient mask. Both kind of operators may erroneously mark small spots as artifacts, which must be removed. In general, every mask needs some adapted postprocessing before it can be applied to the image. Mask ProcessingAdapted processing of a mask means the application of morphological operators (closing, erosion) or user-written procedures. Sometimes it is even necessary to erase or fill regions of a mask manually. Spots can be removed by ``closing'' holes. ``Erode'' clips a thin border from all islands. Thus after erosion the areas assessed as carrying valid scattering data are smaller than before. Outlook: X-Ray pattern related processing.The complement of ``erode'' is the ``dilate'' operator. It may be useful for feature extraction (peaks, equatorial scattering): Here our first-guess mask will only pick the central part of the corresponding island(s), but we know that there is a overlap region which may be considered by application of the dilate-operator. Level MasksThe level mask is generated by a statement like ``all pixels with intensities higher than 500 are not shaded''. It can easily be used in order to extract the region in the image, which is not shaded by the vacuum tube and the beam stop. Such a mask may become grainy close to the edge of the true shade because of intensity fluctuations. Thus one may have to perform a closing before application. Even after closing the small holes the mask may be too generous. Eroding the mask may be necessary as well. Gradient MasksSome artifacts only cause half shades in the image. A gradient mask would be generated by a statement like ``all pixels which are close to a sudden intensity decrease shall be marked''. Such edges can be detected by the ``Sobel operator'', which is a library function of pv-wave. Thus we obtain the circumference of the area, which is attenuated. Post-processing of a gradient mask may become cumbersome, since the gradient fence stands in an alpine landscape with hills and mountains. After subtracting the background landscape a level mask can be applied to the fence which should show the course of the fence. Still the fence may not be a closed circumference of the half-shaded area. We can overcome this problem by practical reasoning: Since half-shades in an X-ray pattern are normally caused from thin ``objects'' we only need to ``draw along the edge using a broad brush'' (procedure sf_life). Both brushed lines will overlap in the middle, span across gaps and mark the whole area containing bad data. Background SubtractionFrom every image the apparative background scattering (multiplied by the absorption factor) must be subtracted. If the detector is not mounted in a fixed position (CCD camera, gas filled detector), but removed for readout after exposure (Image plate, photographical film) this subtraction is not as simple. Image AlignmentOnly after proper alignment of the image one may use symmetry to fill blind regions. The steps of image alignment: Filling of Blind AreasSymmetry FillingAny scattering pattern has a point symmetry, frequently samples with fibre symmetry (i.e. cylindrical symmetry) are studied. Thus after image alignment one can check if (one of) the opposite pixel(s) contains valid data and fill in data from these pixels. Performing this task ``point by point'' would take an enormous time. Using the special calculus built into pv-wave, one can operate on whole matrices and obtain the result very fast. Extrapolation FillingEven after taking into account symmetry, some regions will remain blind. Such regions can be filled using the 2D-extrapolation procedures built into pv-wave. Unwarping Image DistortionsSome CCD detectors distort the image considerably. This distortion can be documented using the recorded image of a metal screen with holes mounted in front of the camera. pv-wave offers a set of special procedures, which enable a quick ``unwarping'' of images, if such calibration images are at hand. It uses ``warp lists'' made from couples of points (true position, recorded position) to generate polynomial approximations of the warping distortion (procedure POLYWARP). These polynomial approximations can be fed into the POLY_2D procedure, which recovers the undistorted image. Thus one only has to write a user friendly procedure for the generation of the warp list (sf_prewarp) from the calibration image. Calibration for Constant Irradiated VolumeIn some experiments (straining, heating) the irradiated volume of the sample is not constant and must be corrected. After the correction relative changes of pattern intensities can be discussed in terms of structural changes. Calibration to constant irradiated volume is a geometrical problem. If the thickness (diameter) of the sample is known, it can easily be solved for ``wide polymer films'' or ``thin polymer fibres'', which are irradiated by a (wider) beam of rectangular cross section. Determination of the thickness may be carried out in a separate experiment or between the recording of two images. Although somewhat inaccurate, the absorption of the primary beam (measured by a ``second ionization chamber'' or a pin diode) may as well be used for the determination of the irradiated volume. About this document ...Image Preprocessing of 2D scattering patterns using pv-wave This document was generated using the LaTeX2HTML translator Version 96.1 (Feb 5, 1996) Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds. The command line arguments were: The translation was initiated by Norbert Stribeck on Thu Dec 18 18:07:40
MET 1997 |
| Hamburg University - Chemistry - TMC - Stribeck - 2D Preprocessing | Search |