## Materials and Methods
### Wood Property Calibration and Prediction of Wood Properties  
Wood property calibrations, statistical analyses, and associated graphics were developed using the R statistical software [56] with the RStudio interface [57] and the packages gridExtra [58], pls [59], prospectr [60], signal [61], and the tidyverse series of packages [62]. Models were developed between MOE and MOR with SG\({}_{\text{lumber}}\), and MOR with MOE. Linear models were developed between MOR and MOE [52]. Examining the scatterplots between MOE and MOR with SG\({}_{\text{lumber}}\) showed that the relationships were not linear; several model forms were tested, with the best models being quadratic models without the linear term. For these models, the coefficient of determination (R\({}^{2}\)) and the root mean square error (RMSE) were calculated. For both the NIR and the NIR-HSI spectra, the pretreatment used was the second derivative with the left and right gaps of four points using the Savitzky-Golay approach [63]. The samples were split into the calibration set, which contained 75% of the samples (292 samples), and the prediction set which contained the remaining 25% (98 samples) of the sets using the Duplex sample selection technique done on the NIR spectra data [60]. The duplex algorithm selects the most unique samples based on the Mahalanobis distance to better ensure that the calibration and prediction set contain samples that are representative of the population, while still maintaining independence between the calibration and prediction sets [64; 65]. The specific gravity of the block (SG\({}_{\text{block}}\)), specific gravity of the entire lumber piece adjusted to 15% moisture content (SG\({}_{\text{lumber}}\)), modulus of elasticity adjusted to 15% moisture content (MOE), and modulus of rupture adjusted to 15% moisture content (MOR) were modeled as responses to the NIR and the NIR-HSI spectra. Calibrations were developed using partial least square (PLS) regression with four cross-validation segments and a maximum of 10 factors. The final number of factors were determined based on the standard error of cross-validation (SECV) (determined from the residuals of the final cross-validation), the root mean square error of cross-validation (RMSECV), the coefficient of determination of cross-validation (R\({}^{2}\)), and the ratio of performance to deviation for the cross-validation(RPDcv) [66]. RPDcv was calculated as the ratio of the standard deviation of the reference data to the SECV. Determination of the RPDcv allows the comparison of calibrations developed for different wood properties that have differing data ranges and units; the higher the RPDcv, the more accurately the data is described by the calibration. The performance of the calibration models was examined by predicting the wood properties of the test set samples. The standard error of prediction (SEP) (determined from the residuals of the predictions) was calculated and gives a measure of how well a calibration predicts parameters of interest for a set of samples not included in the calibration set. The predictive ability of the calibrations was assessed by the coefficient of determination (R\({}_{p}\)2) and calculating the RPDp, which is similar to the RPDcv, but uses the standard deviation of the prediction set reference data and the SEP. The bias (mean of prediction residuals) was also evaluated. Plots were produced to show the relationship between the measured data with the NIR or NIR-HSI data, with the plots also showing the confidence interval for the mean prediction and the 1:1 line of equivalence. Following the creation of the PLS NIR-HSI models, the coefficients of the PLS model were used to predict the spatial variation within each block for SG, MOE, and MOR in Matlab. This work was similar to a calibration transfer from a spectrometer to a hyperspectral imaging system, done in Matlab. The pretreatment (Savitzky-Golay filtering) process was exactly replicated in Matlab. Spectral data in each image were folded to a matrix form.