WANG Peng(王鹏),ZHANG Ruan-Yu(张软玉),YUAN Xue-Dong(袁学东),XU Zu-Run(许祖润),and AN Zhu(安竹)
1Institute of Nuclear Science and Technology of Sichuan University, Key Laboratory of Radiation Physics and Technology,Ministry of Education,Chengdu 610064,China
2The College of Physics Science and Technology of Sichuan University,Chengdu 610064,China
Applying image processing method to treat digital signals∗
WANG Peng(王鹏),1ZHANG Ruan-Yu(张软玉),2,†YUAN Xue-Dong(袁学东),2XU Zu-Run(许祖润),2and AN Zhu(安竹)1
1Institute of Nuclear Science and Technology of Sichuan University, Key Laboratory of Radiation Physics and Technology,Ministry of Education,Chengdu 610064,China
2The College of Physics Science and Technology of Sichuan University,Chengdu 610064,China
In this paper,we present a novel method for digital nuclear signal processing based on image processing and recognition,which can improve signal-to-noise ratio of digital nuclear signal effectively without changing the signal shape.The digital nuclear signal with a“time-amplitude”series is converted into a grayscale image with adjustable pixel size.Template of the converted image is extracted by means of modern image processing methods,such as spatial digital low-pass filtering,image binary and the skeleton extracting of images.The needed parameters are extracted from the template image.The method of template extracting presented in this paper can be used flexibly to extract template of nuclear signals,whether the whole or even part of that,and got multi templates corresponding to the whole or partial characters of the signals.The results of image processing, along with γ-ray energy spectrum of241Am acquired by this method,show that the new method provides a way todevelopfuturedigitalnuclearinstrumentsofhighefficiencyandflexibility,highdensityandmultiparameters. Keywords:Image of digital nuclear signal,Skeleton extracting,Waveform information extracting
Digitalized nuclear instrument has been widely used in high-energy physics,nuclear physics and applied nuclear physics.Time domain analysis is a conventional method in digital nuclear signal processing,such as filtering or shaping,for those signals described as amplitude-sampled series with equal time interval.For example,nuclear signals are normally shaped to trapezoid or triangle signals in energy spectrum measurement[1,2]and shaped to bipolar signals for accurate timing in time measurement[3,4].Different configurations of hardware and software should be made according to different measurement requirements.Complexity of the system appearing in real-time and multi-task measurements costs huge resources and degrades real-time performance of the system.
To solve these problems,we propose a method for digital nuclear signal processing to acquire nuclear information. In applying the method of image processing,the following points are taken into account:(1)the shape of output signal from a nuclear detector is determined after parameters of the system are set;(2)different information of nuclear radiation is carried by the whole signal like the rising edge,flat top and shape of the nuclear pulse;(3)valuable achievements,theoretical or experimental,of digital image processing can be adopted[5,6].In this paper,we focus on converting a digitized nuclear signal waveform into a digital image,templateextracting from the converted image,and reconstructing the waveform from the templates.Compared with the original digital signal,the overshooting of reconstructed signalis effectively eliminated and the signal-noise ratio is apparently improved,without changing its shape.γ-ray spectrum of241Am was collected to validate our algorithm of the image processing method.The results show that resolution of the energy spectrum achieved by our algorithm is better than that from the MCA of ORTEC Inc.
Assuming that an output signal of nuclear detector ofν(t), with time duration ofTand amplitude ofA,is discretized into digital signalν(n)by ADC ofN-bit precision and 1/Tssampling frequency.In another word,ν(n)consists of a series of amplitude values of equal time interval 1/Ts.Next,we try to convert it into an image ofw×hpixels with gray scales of 2M(Mis a positive integer).Here,we may deduce that the maximum horizontal and vertical resolutions of the image areW=[T/Ts]andH=[A/VOM·2M],respectively.VOMis the maximum output value of ADC,Nis the bit number of ADC,and whenA=VOM,we haveH=2N.The symbol“[]”denotes thatWandHcan just be integers.The conversion procedure is described as follows.Firstly,assuming the widthandheightofeachpixelbeingΔwandΔhrespectively, the waveformν(n)is divided intow×hgrids of rectangle Δw×Δh.So we havew=[W/Δw]andh=[H/Δh],and each grid denotes a pixel of the converted image,as shown by thick-border rectangle in Fig.1(a).Normally,Δw≥1 and Δh≥1,i.e.,several sampling points of different sampling time may be“drawn”into the same grid if their amplitude and time resolutions belong to the same pixel(x,y).Secondly,count the number of each pixel,as shown in Fig.1(b),
Fig.1.(Color online)Illustration of image conversion of a digital signal:(a)divide the waveform into grids ofwrows andhcolumns, (b)calculatethegrayscalevalueofeachgrid,(c)convertedgrayscale image.
A.Principle and methodand calculate the grayscale(ψ)of each pixel according to its count number by Eq.(1):
whereZ(x,y)is count number of the pixel(x,y)andZMAXis maximum count of all pixels.
Finally,by drawing each pixel with corresponding grayscale value,the waveform of“amplitude-sampled”series with equal time interval is converted into“x–y”series twodimensional grayscale image(Fig.1(c)).
Fig.2.(Color online)Comparison of original waveform(a)and image conversion results with pixel sizes of 20×25(b),10×25(c) and 20×23(d).
B.Parameter confirmation of image conversion
The data amount of the converted image is determined by the size of Δwand Δh.The possible maximum data amount of image pixels of the waveform isW×H,and actually the mount of pixels of an converted image depends on the size of Δwand Δh.In Fig.2,a digitized nuclear waveform is converted into grayscale image with different values of Δwand Δh.It can be seen that the largest Δw×Δh,i.e.the least data amount,is of the most distinct image profile.This is fit for image conversion of the waveform sampled from lowfrequency ADC.On the contrary,the smallest Δw×Δh,i.e. the largest data amount,presents the most detailed waveform. This is suitable for image conversion of the waveform sampled from high-frequency ADC.
The converted image includes also noise and interference superposed on the nuclear signals.They can be reduced bythe image processing procedure of image enhancement of digital nuclear signals(IES).The nature of IES is to weaken scrambled noise imposed on the waveform by the spatial smooth filtering of the image,which improves of the image profile by analysis and recognition of the waveform as follows.
A.The spatial digital low-pass filtering
Assuming an image sizef(x+s,y+t)isw×h,the spatial average filtering of the grayscale image of waveform is completed through 2-D convolution with a filter maskωofm×nsize,we have the filtering result using Eq.(2)[7]:
wheres=1,2,...,mandt=1,2,...,nare independent variables of mask function;andf(x+s,y+t)denotes grayscale value of the pixel(x+s,y+t)in the image,x=0,1,2,···,w−1,y=0,1,2,···,h−1.The filtering result is shown in Fig.3.Fig.3(a)is the image of nuclear signal before filtering and Fig.3(b)–3(d)are images after filtering with Eq.(2)using different filter masks.The filtering effectis related withthe filter mask size.Generally,a smaller filter mask is of worse performance of spatial smooth filtering,but a lager filter mask causes bigger statistical error in acquiring signal amplitude.So,in choosing the filter mask size,the actual property of noise imposed on the signal shall be taken into account.Considering the mean square value of the noise,and statistical error of the acquired signal amplitude,the filter mask of 15×15 is an optimal choice under our experimental noise circumstance.
B.Image skeletonization and template extracting
A key factor of constructing an optimal signal processing system in digital nuclear measurement and analysis is to recognize parameters of the detector system accurately.A methodcalled“templateextracting”isintroducedtocomplete the task based on image skeletonization,developed from the theories of mathematical morphology.
The skeletonS(f)of specific imagef(x,y)can be expressed as the union of a series of erosion and opening operations of morphological image processing,which can be described as follows[8]:
where,Bis the structuring element,“◦”denotes the opening operation,and(fΘkB)denotesktimes continuous erosions off.
Fig.3.Comparison of spatial average filtering without(a)and with filter mask in sizes of 10×10(b),15×15(c)and 20×20(d).
where,kis the time of the last iteration of erosions before (fΘkB)becomes empty set,described as Eq.(6):
For practical application,Kcan be set to a fixed value as a tradeoff between calculation speed and the effect of skeleton extracting.According to theories of digital image processing, the waveform image after spatial low-pass filtering is converted into binary image,where the gray scale value of any pixel above 1 is forced“on”and below 1 is forced“off”.The template of image is then extracted by skeletonizing of the binary image with corresponding structuring element[9,10].
In this work,we use the function“bwmorph(BW,’skel’,K)”of MATLAB to perform skeleton extracting of the binary image.The function“bwmorph”can perform all sorts of morphological operations on binary images depending on its parameters.There are three parameters of“bwmorph”:“BW”denotes the image to be processed,“skel”implies thatthe operation is used to extract skeleton of the image by removing pixels on the boundaries of objects but not allowing objects to break apart,and“K”means the operation is applied forKtimes.Here we used a structuring element of 3×3 size(Eq.(7)),being used to implement fast erosion algorithm based on look-up table[11].
Fig.4.The waveform of241Am γ-ray at 100 MSPS sampling rate (a),and the skeleton of waveform(b).
Fig.5.Thetemplatesofdifferentpartofonesignal.(a)Thetemplate of the top of signal;(b)The template of the rising edge of signal.
Fig.6.The block diagram of the experimental apparatus.
Figure 4 shows the template of nuclear signal waveform after skeletonizing.Fig.4(a),is the time-amplitude waveform of241Am γ-ray detected by CZT detector,sampled by Lecroy WaveRunner 104Xi-A oscilliscope at the sampling rate of 100 MSPS,and Fig.4(b)demostrates the skeleton of waveform through image conversion,image enhancement and image skeletonizing.Moreover,we could get multi-style templates from one system by extracting skeletons of different parts of the same waveform through handling different parts of the waveform image.Fig.5 shows the extracted templates of the part of rising edge and the part of flat top according to Fig.4(b).The image skeletonizing of digital nuclear signals from different radiation sources,detectors and sampling rates can all be completed by this method,with some adjustment of values of corresponding parameters.The method we presented lays the fundation of high-precision parameter recogition of the waveform.
It can be seen from Fig.4 and that compared with the original image,the noises imposed on the skeleton are reduced obviously,with the skeleton shape being almost unchanged for both the rising and falling edges.The skeleton has the features of the whole or the key parts of nuclear signal waveform acquired from the detection system under certain working conditions,which can be used as template of nuclear signal waveforms.
A.Acquisition of amplitude of template image
We try to describe the basic features of template image in the form of parameters after setting up the template image. The amplitude of signal denoted by template image is defined as Eqs.(8)and(9),
whereνNis the amplitude value represented by rowNof template image,N0is row number of template image which denotes the amplitude of zero,Δνis the amplitude value represented by a row,νrangeis the input range of the digitizer,andHis the maximum vertical resolution of the image defined in Sec.II(A).
Fig.7.The flowchart of acquisition of energy spectrum by algorithm based on digital image processing.
Fig.8.Comparison of spectra from(a)a conventional MCA and(b)the image processing algorithm.
B.Acquisition of spectrum
In order to demonstrate effectiveness of the proposed method,a system is established to acquire the nuclear energy spectra with this method and the conventional MCA,and to compare their results.
Figure 6 is a block diagram of the system.The241Am γray signals from the CZT detector are fed simultaneously into the digital spectrometer and the MCA composed mainly of the ORTEC-527 amplifier and ORTEC-926 ADC.The digital spectrometer constitutes of FA-001 front-end controller and PCI-9820 digitizer(AD-LINK).Sampling rate of the ADC is 66 MSPS,with conversion accuracy of 14-bit and input range of±1V.The digital nuclear signals acquired by waveform digitized system are transferred to the workstation for data process and result analysis[12].The data are processed by an algorithm based on image processing discussed above.Fig.7 shows the flow steps to collect the energy spectrum from digitizer by the algorithms.Parameters for the steps are given in Table 1.
Figure 8 compares the two spectra acquired by the conventional MCA(Fig.8(a))and the algorithm based on image processing(Fig.8(b)).From Fig.8,one sees that our image processing algorithm has the good ability to acquire nuclear information,such as acquisition of amplitude information of the waveform.The resolutions of peak at 59.5keV are 9.7%and 9.1%in Figs.8(a)an 8(b),respectively,an obvious improvement of the energy resolution by our digital image processing method.Successive efforts are being made for further improvement of the new method.
TABLE 1.Parameters used in the algorithm
According to the experimental results above,the following conclusions can be made:(1)it is feasible to adopt digital image processing methods into the digital nuclear signal processing for nuclear information acquiring;(2)digital nuclear signal can be successfully converted into grayscale image with adjustable gray scale and size through our method;(3) the skeleton of nuclear signal image can be extracted through the combination method of the spatial linear filtering and mathematical morphology,and has the potential advantagesfor further use in setting-up template library for nuclear signals recognition;and(4)the method we presented will make many potential applications simple and effective,such as signal accumulation discrimination,weak signal finding and the compression and transferring of digital nuclear signal data, which will be studied later.
[1]Valentin T J and GlennF K.Nucl Instrum Meth A,1994,345: 337–345.
[2]Radeka V.Nucl Instrum Methods,1972,99:525–539.
[3]Martinez J D and Monzo J M.N18-3:Digital delay line shaping-zero crossing algorithm for timestamp extraction in PET.IEEE Nucl Sci Conf R,Dresden,Germany,Oct.19–25, 2008.
[4]Pedro G,Juan E O,George K,et al.M06-145:Digital timing in positron emission tomography,IEEE Nucl Sci Conf R,San Diego,USA,Oct.29–Nov.1,2006.
[5]Ballard D H and Brown C M.Computer Vision,New Jersey (USA):Prentice-Hall,1982,65–83.
[6]Illingworth J and Kittler J.Comput Vision Graph,1998,44: 87–116.
[7]Gonzalez R C and Woods R E.Digital Image Processing,Beijing(CHN):Publishing House of Electronics Industry,2010, 93–97.
[8]Gonzalez R C and Woods R E.Digital Image Processing,Beijing(CHN):Publishing House of Electronics Industry,2010, 440–442.
[9]Svalbe I D.IEEE T Pattern Anal,1991,13:1214–1224.
[10]Svalbe I and Jones R.Pattern Recogn Lett,1992,13:123–129, 175–181.
[11]Jones R and Svalbe I.IEEE T Pattern Anal,199416:438–443.
[12]Wang P,Zhang R Y,Yan Y Y,et al.Nucl Sci Tech,2013,24: 060408.
10.13538/j.1001-8042/nst.25.050403
(Received November 14,2013;accepted in revised form May 12,2014;published online September 29,2014)
∗Supported by National Natural Science Foundation of China(No. 11075111)
†Corresponding author,softyv@vip.sina.com
Nuclear Science and Techniques2014年5期