ref: ( K. M. Hanson In Medical Imaging: Image Processing, M.H. Loew, ed. ... In the Scilab code (see below) an attempt has been made to simulate the problem .
A simple radiation location problem using probability ref: ( K. M. Hanson In Medical Imaging: Image Processing, M.H. Lo ew,
ed. Proc. S PI E 1898, pp. 716-731 (1993) " Introdu ction to B ay e si an imag e an aly si s
Would welcome comments/ suggestions/corrections on the report below. 1. A very nice simple probem on image using probability is given in the reference above. The problem : There is a radiation emitter located at (x0,y0). The emitter radiates uniformly on the plane [0 to -pi ] . A detector is placed on the xaxis . From the image captured by the detector estimate x0 using Physics(geometry) to convert the polar uniform probability to probabilty on the x axis using Bayesian Theorem. 2. The theory and procedure is well explained in the ref. The question that arises is if only the image data can be used to estimate x0. The ref makes it clear that we must know something about the source ie that itis a single point source and with a futher assumption that probability of detection on xaxis is proportional to distance then we can improve on the simple averaging method . 3. In the Scilab code (see below) an attempt has been made to simulate the problem . It is possible that there are errors would welcome corrections/ improvements. The connection to the question posed in the discussion can now be made mor concrete. Is it possible to say only from detection that there is only one source? Likely answer ..No! Does the answer change if we conduct multiple simulations.? The simulations made with Scilab code does not seem very satisfactory , possibly due to numerical errors...as some scaling has been done . Hopefully ther are no erors in my understanding of the method and in coding. 4. Below are some results for inspection : The simulation has been done for n=2 and 5 . It may be noted that we do not get same result for every simulation as might be expected.. Surprisingly n=2 gives better results .. This might be due to errors ? But the MAP does seem marginally better in its estimate..
Actual location is x0 = 3 ; y0= 2 ;// y0 location assumed (given) For n=2 the computed xvalues are maxliklihood = 2.1212121 simple average = 3.2915758 maxaposteriori = 3.1931194 deteced xrp = 0.9775191 5.6056325
The deteted x values are the inner 2 arrows within the cone of radiation
Aposteriori probabilty (we get similar shape as in ref )
for n=5 maxliklihood = 3.5353535 simple average = 3.8131539 maxaposteriori = 3.4143933 deteced xrp = 1.8605782 1.147441
7.8084924
3.9935369
4.2557211
The deteted x values are the inner 5 arrows within the cone of radiation
Aposteriori probabilty (we get similar shape as in ref )
// A simple radiation location problem using probability // ref: ( K. M. Hanson In Medical Imaging: Image Processing, M.H. L o ew,
ed.
//Proc. S PI E 1898, pp. 716-731 (1993) " Introdu ction to B ay e si an imag e an aly si s " ) clear all ; gen ="mt" grand('setgen',gen) // sets the current base generator to be gen a string among 'mt', 'kiss', 'clcg2', 'clcg4', 'urand', 'fsultra' cone= .9// cone of xcapture ..to avoid pi clear all ; ni=5// number of captured image points y0= 2 ;// location y0 assumed (given) x0 = 3 ; // location x0 assumed (given) uni = ones(1,ni) ; //vector ones y0v =y0*uni ; //vector of y0 x0v= x0*uni ;// vector of x0 thet =grand(1,ni, 'unf',-%pi*cone, -%pi*(1-cone )); // thet is one instance of the uniform random emission xrp = x0v +y0v./tan(thet) ; // received locations on x axis nrp=length(xrp) // gives received number of emissions xbeg =-10 // start of range of x xend =10 // end of range of x npts =100 // dicretization of x xi =linspace(xbeg , xend ,npts ); // x vector with npts points nxi = length(xi) // posteriori probability proportional to y/ (π [y^2 + (x − xi)^2] , xm= xrp ; pz2= ones (1,nxi) ; // coding convenience yv=y0*pz2 ; ob =pz2 ; // coding convenience // compute function proportional to probability density for i=1 :nrp pz1 = (yv^2 +(xi- xm(i) )^2)./yv ; pz1 = ob./pz1 ; pz2= pz2 .*pz1 ; end ; figure(0) ;
clf(0); title (' prop probababilty density vs x ') plot(xi,pz2) ; // plot the result clf(3); figure(3) ; // scale pz2 pz2sc=pz2/sum(pz2) ; plot(xi,pz2sc); // plotting emission function vectordraw (nxx,nyy, ca , fg) figure(fg); // figure in which to plot // arrow tail cords is [ nxx(1),nxx(2) ] and arrow head is [ nyy(1) nyy(2) ] // this function draws an arrow from [ nxx(1),nxx(2) ] to [ nyy(1) nyy(2) ] nx= [ nxx(1) nyy(1) ] ; // vector from ny= [ nxx(2) nyy(2) ] ; // vector to (1,1) plot2d( [ ca(1,1), ca(1,2) ] , [ca(2,1) ,ca(2,2) ],[-1,-1],"022") ; // sets the axis range of plot xarrows(nx,ny, 10 ,5 ) // actually plots the vector with arrow size 20 , color 5 =red endfunction orig =[x0 y0]; // set origin xmn= -10 ;xmx =10 ;ymn=-10 ; ymx=10; ca= [ xmn xmx ; ymn ymx ]; // 2x2 matrix of plot area [xmn xmx ; ymn ymx ] con1 = [ y0/tan(cone*%pi) 0] con2 = [ y0/tan( (1-cone)*%pi) 0 ] fg =1;// figure number clf (1); vectordraw (orig ,con1 , ca,fg ) ; vectordraw (orig ,con2 , ca, fg ) ; for i=1 :nrp aplot = [xrp(i) 0 ] ;// vectordraw (orig ,aplot , ca,1 ); //orig vector a , plotscale , fig number 1, a is row vector end pmax= max(pz2) // max pdf [i1,i2 ] =find((pz2 ==pmax)) ;// locating max pdf xi(i2) // maxliklihood 2.9292929 location of source expect = x0 xav = sum( xrp)/nrp // simple average for comparing 2.8787676 pzm=pz2/sum(pz2) ; xmap =pzm*xi' //2.8738224
Actual location is x0 = 3 ; y0= 2 ;// y0 location assumed (given) For n=2 the computed xvalues are maxliklihood = 2.1212121 simple average = 3.2915758
maxaposteriori = 3.1931194 deteced xrp = 0.9775191 5.6056325
for n=5 maxliklihood = 3.5353535 simple average = 3.8131539 maxaposteriori = 3.4143933 deteced xrp = 1.8605782 1.147441
7.8084924
3.9935369
4.2557211
The deteted x values are the inner 5 arrows within the cone of radiation
Aposteriori probabilty (we get similar shape as in ref )