## 2 Materials and Methods
### Modified Image Reconstruction Algorithm
Therefore, each ray has the opportunity to be segmented and optimized. Figure 3: Illustration of the key steps in RSEN and SISE: (**a**) Strategy for estimating the value of the segmented ray; (**b**) strategy for selection of affected regions according to the segmented rays. Figure 2: Illustration of the proposed method. RSEN (ray segmentation by elliptical neighborhood), SISE (spatial interpolation by segmented ellipse). When the RSEN algorithm is finished, a modified graph of rays which is different from conventional rays graph is generated. In order to fit the segmented rays, a modified spatial interpolation algorithm is proposed. An ellipse is used again to define the affected zone, and the shape of the ellipse can be expressed as,  
\[c_{2}={b_{2}}/{a_{2}} \tag{5}\]  
where \(a_{2}\) is the long axis of the ellipse, and \(b_{2}\) is the short axis of the ellipse. Therefore, \(c_{2}\) is the control coefficient of the second ellipse for interpolation. \[h(x,y)=\left\{ \begin{array}{l}1{D^{2}}{x_{b2}}/{a_{2}}^{2}+{D^{2}}{y_{w2}}/ {b_{2}}^{2}\leq 1\\ 0{D^{2}}{x_{b2}}/{a_{2}}^{2}+{D^{2}}{y_{w2}}/{b_{2}}^{2}>1\end{array} \right. \tag{6}\]  
The strategy for selection of affected regions according to the segmented rays is shown in Figure 3b. After recording all grid cells in the elliptical region by Equation (6) that is similar to Equation (2), whether a certain grid cell is in a segmented area of the ellipse can be identified as follows,  
\[g(x,y)=\left\{ \begin{array}{l}1\theta\leq\pi/2\\ 0\theta>\pi/2\end{array} \right. \tag{7}\]  
where \(\theta\) is the angle between \(L_{SE}\) (point start to point end) and \(L_{PE}\) (a certain point in ellipse to point end). If \(g(x,y)=1\), it means that the grid cell is within a segmented area of the ellipse. Then, the grid cells in one ellipse can be can be divided into different affected zones. When all ellipses are segmented, if a grid cell is in several affected zones at the same time, the value of the grid cell is determined as follows,  
\[v^{\prime}{}_{xy}=\sum\limits_{k=1}^{N}{v^{\prime}{}_{k}}/N \tag{8}\]  
where \(v^{\prime}{}_{xy}\) is the estimated velocity value of a certain grid cell, \(v^{\prime}{}_{k}\) is the value of a certain zone that affects the specific grid cell, and \(N\) is the total number of zones that affect the specific grid cell, simultaneously. In summary, the steps of image reconstruction method using segmented propagation rays of stress wave are as follows:  
1. Normalizing all collected values of velocity rays with respect to the range of velocity values, visualizing them, and generating the grid graph. 2. Segmenting a certain ray repeatedly, constructing elliptical neighborhood of segmented rays with Equation (2), and estimating the values of segmented rays with Equation (3), until the termination condition (Equation (4)) is reached. 3. Repeating Step 2 until every original ray has been processed, and generating the modified rays graph. 4. Constructing all of the elliptical affected zones with Equations (6), and estimating the values of a certain grid cell with Equations (7) and (8). 5. Repeating Step 4 until every grid cell has been processed. 6. Reconstructing the image of internal defects in wood using the estimated values of grid cells with a certain color scale.