# Structural Pattern Analysis in _Patella vulgata_ Shells Using Raman Imaging
## 2 Materials and Methods
### Data Analysis  
Data processing and analysis were managed through in-house software developed in MATLAB (licensed version R2023a). First, it is essential to ensure precise estimation of the Raman bands' height, central wavelength, and spectral width for accurate spectral characterization. To this end, a non-linear least-square fitting algorithm to a Gaussian function was initially implemented. However, due to the iterative and nonlinear nature of  
Figure 3: Schematic overview of the experimental setup used for Raman mapping. A 532 nm laser and a spectrometer are coupled to a Raman probe, while a 10\(\times\) objective lens and a camera are used for precise sample positioning and focus control. The sample is mounted on a motorized XYZ stage, and the entire system is controlled via a custom PC interface developed in MATLAB (licensed version R2023a). the fitting method, occasional artifacts were observed in the processed spectra. Additionally, the computational cost of this approach was high, requiring several hours of processing time per sample on a standard PC. To address these limitations, two fast, non-iterative algorithms were explored, the centroid detection algorithm (CDA) and the linear phase operator (LPO). CDA calculates the center of mass of the Raman peak, providing a computationally efficient means of determining peak positions with high accuracy [52]. LPO, on the other hand, is a high-pass spectral filtering technique combined with linear interpolation to estimate the central wavelength [52]. Both methods were employed to improve peak detection, while significantly reducing processing time. With the optical setup, the laser line at 532 nm is highly attenuated but still visible in the captured Raman spectrum. This allows for the real-time monitoring of potential laser instability during measurements, with subpixel resolution. Tracking the laser emission wavelength ensures consistency in spectral calibration, minimizing errors due to instrumental fluctuations. LPO and CDA were applied in each measurement to verify laser stability. The following preprocessing steps were applied to Raman spectra. First, spectra were cropped to the range of 180 to 2800 cm\({}^{-1}\). Next, electronic noise was subtracted to minimize background interference. Spectra were then examined for saturation levels, and those reaching the detector's threshold of 65,000 counts were discarded. To correct systematic instrumental variations, normalization was performed using a reference spectrum from a white light source. Baseline correction was then applied using Eilers asymmetric least squares (ALS), with a smoothness parameter of 50 and an asymmetry parameter of \(10^{-4}\). Finally, spectra that did not display the characteristic peak at 1085 cm\({}^{-1}\), which corresponds to the strongest Raman signal of carbonate and should always be present, were removed. This ensured that only valid spectra were retained for further analysis. Raman maps were generated from preprocessed Raman spectra to analyze the spatial distribution of aragonite, calcite, carotenoids, and carbonate ion substitution in the CaCO\({}_{3}\) lattice. Specifically, the presence of aragonite and calcite was determined based on the intensity of characteristic peaks; the 208 cm\({}^{-1}\) peak served as an indicator of aragonite, while the 280 cm\({}^{-1}\) peak identified calcite. The sum of the 1130 cm\({}^{-1}\) and 1521 cm\({}^{-1}\) bands was used to represent total carotenoid content. This combination provides a more robust signal under variable conditions, maintains a linear relationship with concentration [53], and improves the signal-to-noise ratio compared to using either band individually. Intensity values were expressed in arbitrary units (a.u. ), corresponding to the number of detected events (counts) after preprocessing. Variations in carotenoids were further examined by analyzing the shift of the 1521 cm\({}^{-1}\) band.