## 2 Methods
### Image Preprocessing
In the first step, every pixel is divided by a number that is the average of these images that belong to a subject. In the next step, the pixel that passes the threshold value was taken out to calculate the number of rows and columns that contain these pixels. Suppose there are two matrixes--C and R. \(C_{jk}\) is the \(j\)-th column stored values and \(R_{ik}\) is the \(i\)-th row stored value in \(k\)-th image are used in Equations (3) and (4). The \(C_{jk}\) or \(R_{ik}\) will be set as one when there is at least one pixel that pass threshold value in this row or column. The threshold value is set as 3 by tuning in this paper. In the final step, we will multiply the number of rows and columns that pass the threshold to obtains the multiple values that are named \"threshold area\" for each image. The maximum of these threshold areas will be treated as heart sequence center image \(m_{2}\) by this method in Equation (5). The two methods take out their respective heart images, which are numbered \(m_{1}\) and \(m_{2}\). The average value of \(m_{1}\) and \(m_{2}\) is taken as the final central image of the sequence. From near the central image of the sequence, select 15 images that will be placed in the final model. In the experimental chapter, we will verify that 15 images are the best choice. \[C_{jk}= \begin{cases}0,&\underset{i}{\text{max}}([\text{Image}]_{ijk})<3\\ 1,&\underset{i}{\text{max}}([\text{Image}]_{ijk})\geq 3\end{cases}  \tag{3}\]  
\[R_{ik}= \begin{cases}0,&\underset{j}{\text{max}}([\text{Image}]_{ijk})<3\\ 1,&\underset{j}{\text{max}}([\text{Image}]_{ijk})\geq 3\end{cases}  \tag{4}\]  
\[\text{Center Image }m_{2}=\underset{k}{\text{argmax}}\sum_{j}C_{jk}\ \times\ \sum_{i}R_{jk} \tag{5}\]  
The myocardium is not in the middle in most of the images, even if images are processed by initial image cropping and image selection. Due to the subjects' heart positions are slightly different. So, these images need to be cropped again to solve this problem. Cropping process needs to be performed separately for rows and columns. Currently every image has 41 \(\times\) 36 pixels. The first step, suppose there are two vectors A and B in Equations (6) and (7). A\({}_{p}\) is equal to the sum of bright forward some row pixels as this \(p\)-th row's representative brightness sum value. B\({}_{q}\) is equal to the sum of bright forward some column pixels as this q-th column's representative brightness sum value. Add 19 rows or 16 columns by tuning in this paper. The purpose is to find out the initial of cropping. These rows contain the entire myocardium coverage by observing. In Equations (8) and (9),choose the row that has maximum value in A as the first cropping row. Choose the column that has maximum value in B as the first cropping column. The first cropping row and column will be at the top left border of the cropping. The second step, select forward several rows and columns from the first cropping row and column by experiment. In Figure 5, the image which is complete cropping that the myocardium will show in the middle. For every image, we will do pixel normalization, which reduces the stuck during training in neural network model. \[\text{A}_{p}=\sum_{i=p}^{p+18}\sum_{j}[\text{Image}]_{ij} \tag{6}\]  
\[\text{B}_{q}=\sum_{j=q}^{q+15}\sum_{i}[\text{Image}]_{ij} \tag{7}\]  
\[\text{First cropping row }y=\underset{y}{\text{argmax}(\text{A})} \tag{8}\]  
\[\text{First cropping column }x=\underset{x}{\text{argmax}(\text{B})} \tag{9}\]