## 2 Materials and Methods
### Scheme for Extraction and 3D Visualization of Positron Emitting Radioisotopes
\begin{table}
\begin{tabular}{l l} \hline
1. & Data acquisition from the PEMGRAPH system (in ascii format in a DAT file). \\
2. & Record the true coincidences as dynamic data from the raw data. \\
3. & Subtract the background data. \\
4. & Sort the data into 77 frames for 40 min. \\
5. & Image reconstruction using the Maximum-Likelihood Expectation-Maximization (MLEM) \\  & method (in DICOM format). \\
6. & Convert DICOM data to HDR and IMG format using PYBLD package (using the dicom2 ana.py script). \\  & a. & Extract the 1D profile data in ascii CSV format (using image.py script). \\  & b. & Plot the extracted 1D profile saved into a CSV file. \\
7. & Merge four decay image frames (15, 20, 30 and 55 min after irradiation) for visualization of radioisotope distribution with time (using the join\_image.py script). \\  & a. & Crop the merged images in step 7 (using the crop\_img.py script). \\  & b. & Visualize the cropped 2D images using the AMIDE software. \\
8. & Generate the 3D scatter plots (using the scatter\_3d.py script). \\  & a. & The 3D scatter script uses the mplot3d toolkit and the ax.scatter3D() function of the matplotlib library. \\
9. & Perform spectral analysis on the obtained images (using the spectral\_analysis.py script). \\  & a. & The total of 77 frames of 40 min image were merged by the join\_image.py script and \\  & saved as img\_77.img. \\
2. & Crop the merged images in step ’9(a)’ using the crop\_img.py script and saved as \\  & simg\_77.crop.img. \\
3. & The frame images were prepared in step ’9(b)’ by frame.py script and saved as \\  & simg\_77.crop\_f.img. \\
4. & The mask images were prepared in step ’9(c)’ by mk\_mask.py and saved as \\  & simg\_77.crop\_fmask.img. \\
5. & Genegate the time information for 77 frames of 40 min dynamic data as \\  & time\_inf.frame file. \\ f. & Extract the data for positron emitting radioisotopes using python terminal \\  & command as: \\  & for \({}^{11}\)C radioisotope: \\  & python3 spectral\_analysis.py –input = simg\_77.img –time = time\_inf.frame –output = \\  & analysis\_c\_11 –mask = simg\_77-crop\_mfsimg.img –betacut = 0.0005 –athresh = 0.0006 \\  & for \({}^{15}\)O radioisotope: \\  & python3 spectral\_analysis.py –input = simg\_77.img –time = time\_inf.frame –output = \\  & analysis\_o\_15 –mask.img 77-crop\_mfsimg.img –betacut = 0.005 –athresh = 0.006 \\  & for \({}^{15}\)N radioisotope: \\  & python3 spectral\_analysis.py –input = simg\_77.img –time = time\_inf.frame –output = \\  & analysis\_n\_13 –mask = simg\_77-crop\_mfsimg.img –betacut = 0.001 –athresh = 0.002 \\ g. & Extract the 1D profile data of analysis output in ascii CSV format \\  & (using image.py script). \\ h. & Plot the extracted 1D profile saved into a CSV file. \\
10. & For 1D spectrum the time activity were calculated as tac.dat from 40 frames with 1 min interval for four ROIs (1) whole, (2) edge, (3) plateau, and (4) Bragg-peak region (using image\_roi.py script). \\  & a. & Generate one voxel images of each ROI’s time activity in step ’10’ for example as \\  & a. & \(\text{over\_whole.img}\) (using onev\_image.py script). \\  & b. & Generate the spectrum of radioisotopes using the python terminal command for a \\  & python3 spectral\_analysis.py –input = onev\_whole.img –time = time\_inf\_roi.frame –output = analysis\_out\_whole –debug = 1 \\
11. & Plot the concentration (a) versus half-live (\(\beta\)) from the terminal output of step ’10(b)’. \\
12. & Generate the 3D dynamic visualization and movie clips for \({}^{11}\)C, \({}^{15}\)O, and \({}^{13}\)N from step ’9’ (using scatter\_3d.py script). \\ \hline \end{tabular}
\end{table} 
Table 3: The step-by-step algorithm of the analysis scheme for the extraction and 3D visualization of positron emitting radioisotopes using positron emission mammography.