## 4 Experiments
### Data Generation and Data Aquisition
The CSV file is structured as outlined in Table 2, and contains following information:  
* Date and time;
* Package width (based on height measurements);
* Package length (based on height measurements);
* Number of all points (based on height measurements);
* Array of volumetric information acquired through the scanning (x, y, z). Table 3 provides an example of the structure of such a CSV file. The first five lines are dedicated to descriptive data about the file. Starting with the sixth line, the scanned volumetric measurement values are saved in the format given. Figure 3: Display of all part configurations of the components in the four distinguished classes ‘solid’, ‘infill’, ‘wire good’ and ‘wire bad’ (visualization based on scanned, unprocessed data). In adverse cases, strong scattering reflections of the laser beam from the measuring scanner can occur. This is not uncommon given the glazed surface of the FFF-manufactured components. At these points, no data are stored. At such a measuring point, the X, Y and Z values remain empty. This results in a lack of information at the respective point; however, the dimension of the measurement remains unaffected. The CSV format in its original form is not suitable for further processing. The main problem is the dimensional disparity between the first five lines and the subsequent measured values. It is therefore necessary to adapt the CSV file in order to convert the data into a useful format. To extract useful information from the raw data, performing the following steps is required:  
* Reading CSV with exception of lines 1 to 5;
* Localization of the component on the printing plate;
* Cropping to the relevant area;
* Data pre-processing;
* Identifying and removing outliers;
* Imputation of missing values;
* Normalization of data;
* Convert data into a usable dimension;
* Save processed CSV data as PNG. For cropping the relevant areas of the images, a semi-automated procedure is developed (see Figure 4). This involves localizing the component using a graphical user interface (GUI) and saving it separately. Although this process is time-consuming, it ensures a minimum of the required data quality. The top left corner of the component is targeted via the input windows and a fixed size of 600 \(\times\) 600 pixels is defined in the source code, assuring that the data generated are always the same size. The output CSV is cropped using the row and column values specified and the fixed dimension. The storage path is specified in the source code and can be changed. After this processing, the output data are available in a reduced format of 600 \(\times\) 600 pixels. In addition, the GUI saves only the Z values and replaces all missing values with zeros. As a result, self-written scripts for data processing can be used effectively and the required memory space is reduced. The scan program assigns unique names to the scans, consisting of date, time and scan number (layer number), which are subsequently saved unaltered. For further processing of the data, a script is used that performs the following steps:  
* Importing a CSV as Pandas Dataframe;
* Replace all zero values with the mean value of the non-zero values minus 0.7 (layer height of the print);
* Calculate the 99 the percentile and cut off all values above it;