- Advanced Photonics Nexus
- Vol. 4, Issue 3, 037001 (2025)
Abstract
1 Introduction
Collagen is the most abundant protein in the human body and the main component of the extracellular matrix,1 playing essential structural2 and regulatory roles3,4 in tissue organization, development, and disease. Given its importance, various imaging techniques have been employed to assess collagen structure and behavior. Although the usefulness of non-optical methods for collagen assessment (e.g., ultrasound imaging,5 magnetic resonance imaging,6 and positron emission tomography7) cannot be disputed, optical methods are typically non-ionizing and safer than other medical imaging approaches and offer the best spatiotemporal resolution for non-invasive imaging of collagen.
Among the optical imaging methods, second harmonic generation (SHG) microscopy, has emerged as a powerful, label-free method for visualizing fibrillar collagen, with polarization-resolved SHG (PSHG) microscopy enabling quantitative characterization of collagen microstructure. SHG imaging operates on the principle that when a high-intensity laser pulse illuminates a non-centrosymmetric structure, two incident photons combine to generate a new photon with exactly twice the energy of each original photon. With SHG microscopy variants based on laser beam scanning being already established as powerful biomedical imaging methods,8
Although PSHG microscopy offers valuable structural information, extracting quantitative parameters from PSHG image sets requires theoretical models for collagen17 and specialized fitting algorithms to determine ratios between non-zero coefficients of the second-order nonlinear susceptibility tensor , which governs the SHG phenomenon. The analysis of these ratios provides information on the molecular organization of collagen at a pixel level, which enables the identification of extracellular matrix remodeling associated with a plethora of diseases.28,29 Earlier approaches based on the nonlinear least square method30 were computationally expensive, requiring several hours to analyze a single image. More recent Fourier-based31 and linear least squares32 methods significantly reduced processing time to . However, these implementations have remained largely inaccessible to researchers without programming expertise, limiting their broader adoption in the life sciences community.
Sign up for Advanced Photonics Nexus TOC. Get the latest issue of Advanced Photonics Nexus delivered right to you!Sign up now
To bridge this gap, we introduce CollagenFitJ, a user-friendly FIJI33 plugin using the single-axis molecule model34,35 for collagen, and designed for quantitative PSHG image analysis. Built on the Fast Fourier PSHG (FF-PSHG) approach,31 CollagenFitJ streamlines the extraction of collagen biophysical parameters such as fibril orientation and tensor element ratios, as well as parameters assessing the fitting quality. Finally, dispersion and randomness maps of the collagen structure-related parameters are generated for local statistical assessment of the results.
By integrating this method into FIJI, we eliminate the need for custom MATLAB31 or Python36 scripts, making PSHG analysis more accessible to end-users with limited coding skills or time availability. Unlike previous PSHG analysis tools that require significant technical expertise, CollagenFitJ is easily installable, fully compatible with ImageJ macros, and adaptable for diverse experimental designs. The plugin provides an intuitive, modular workflow that allows users with minimal programming experience to perform quantitative analyses, export data for further processing, and generate collagen structure-related maps for statistical assessment. This work aligns with ongoing efforts37 to establish standardized bioimage analysis frameworks, promoting reproducibility and collaboration in biomedical imaging research.
2 Methods
2.1 Employed Biophysical Model for Collagen
The collagen model used in the CollageFitJ plugin is the single-axis molecule model, which was described in previous works.34,35 The model describes the dependence of the collagen SHG intensity on the polarization orientation of the excitation beam (), on the in-plane orientation of collagen (), and on the nonlinear susceptibility tensor () elements. The model assumes cylindrical symmetry for the collagen fibrils along their main axis and in-plane orientation with respect to the imaging plane. Under these assumptions, the SHG intensity dependence can be expressed as
Another form of the model expressed in Eq. (1) was found to be more suitable for fitting the experimental PSHG images using a Fourier series expansion
![]()
Figure 1.Exemplary raw PSHG dataset obtained using a laser-scanning PSHG microscope on rat tail tendon and typical outputs from CollagenFitJ. (a) A typical PSHG dataset acquired at polarization angles in steps of 20 deg from 0 to 180 deg. (b) Collagen structure-related images generated using the single-axis molecular model for collagen: FI, CHI3115, CHI3315, CHI3331, and THETA. (c) Fitting assessment images: ERR, SNR, and
Using FF-PSHG analysis, the CollagenFitJ plugin can compute not only the ratios of the tensor elements but also the in-plane orientation of collagen (), and the orientation of the hyperpolarizability tensor’s dominant axis (), which was previously associated with the helical pitch angle of the collagen triple helix. The helical pitch angle can be derived from the ratios of the tensor elements as follows:34
Most importantly, by exploiting the specifics of the single-axis molecule model for collagen, the CollagenFitJ plugin can generate five collagen structure-related images (Fig. 1): FI, CHI3115, CHI3315, CHI3331, and THETA. Each pixel in these images corresponds to the values for the in-plane collagen orientation (), the element ratios , , and , and the helical pitch angle (), respectively. Pixels in which fitting was not performed are assigned NaN values in all images.
2.2 Fitting Process Assessment
The same pixel-wise procedure applied for fitting the experimental data with the collagen model is used for the fitting assessment. For this, the plugin generates three fitting assessment images, where each pixel contains information regarding the fitting quality.38
One fitting assessment image is generated using the coefficient of determination (),
values computed for each pixel are used to obtain the image [Fig. 1(c)]. Values closer to unity indicate a better fit.
The second fitting assessment image is created using an experimental error based on the model in Eq. (2), where only coefficients , , and have biophysical significance. Therefore, the other coefficients, which can be computed from the DFT coefficients, are treated as noise39 because they do not contribute to the calculation of collagen parameters. The experimental error is thus defined as
The third assessment image is generated using the same assumption that only a part of the DFT coefficients contains meaningful information from a biophysical point of view. A signal-to-noise ratio (SNR) can be calculated for each pixel by considering that the signal power corresponding to each spectral DFT component () can be expressed as
For all fitting assessment images, pixels where fitting was not conducted are assigned a NaN value.
Because the pixel values in all fitting assessment images (ERR, SNR, and ) provide information on both fitting quality and collagen presence, these images can be used to segment collagen and create binary masks of collagen regions (Fig. 2).
![]()
Figure 2.Examples of binary collagen masks created for the same PSHG image set as in
2.3 Local Statistics Images
Dispersion and randomness in SHG images were previously used as quantitative methods to characterize the collagen architecture in the tissue.24,27,41 The dispersion of a set of values can be estimated by standard deviation (SD) and median absolute deviation (MAD). Although SD measures the dispersion of a dataset relative to its mean, MAD is defined as the median of the absolute deviations from the median. With normally distributed values SD is commonly used to assess the spread, whereas for other distributions, MAD is more robust, being less sensitive to outliers than SD.42
Entropy (ENT) measures randomness, with higher values indicating greater randomness. The entropy of an image can be calculated as follows:
We use these three statistics to create the SD, MAD, and ENT images, which provide local dispersion and randomness information by calculating the standard deviation, mean absolute deviation, and entropy within circular kernels. ImageJ’s circular masks (defined by radius and size) include 99 different circular kernels for this purpose.
2.4 Nonlinear Optical Imaging
Images were acquired with scanning38 and widefield43 SHG microscope systems with input laser polarization control for image sets acquisition. PSHG image sets were acquired on collagen-rich samples: (i) rat-tail tendon,19 a widely used model for benchmarking SHG image analysis methods; (ii) human-origin tissue slides prepared as per standard histology protocol, stained with H&E,24,44 or left unstained;44,45 and (iii) tumoral tissue imaged in vivo.19
A typical raw polarization-dependent dataset can be seen in Fig. 1(a). The dataset was acquired using a Leica TCS SP laser scanning confocal microscope adapted for nonlinear imaging. The excitation source was a Ti:Sapphire laser (Coherent Chameleon Ultra II) emitting at 870 nm, with a pulse width of 140 fs and a repetition rate of 80 MHz. During scanning, laser beam power levels were kept below 15 mW, measured at the objective focus. The excitation laser beam was linearly polarized using a combination of an achromatic quarter-wave plate (AQWP05M-980, Thorlabs) and an achromatic half-wave plate (AHWP05M-980, Thorlabs), both mounted on motorized rotation stages (PRM1/MZ8, Thorlabs) and placed in the laser beam path before the microscope. A polarimeter (PAX1000IR1, Thorlabs) was used to verify the purity of the linearly polarized laser beam, ensuring an absolute ellipticity of less than 0.3 deg and power variations within 7%. A 40× magnification, 0.75 numerical aperture (NA) objective was used to focus the excitation laser beam. The forward-generated SHG signal was collected using a 0.9 NA condenser lens and was spectrally separated from the excitation beam by a combination of a short-pass filter (FF01-750/SP-25, Semrock) and a bandpass filter (FB430-10, Thorlabs) placed in the forward detection path.
All the images underlying the figures featured in this article are available in a public repository at 10.17605/OSF.IO/F3QA9. Additional sample images for tissue sections prepared as per standard histology protocol, stained with H&E or left unstained, can also be found in a public repository, linked to the curated PSHG-TISS dataset.38
3 Results
3.1 Experimental Design
The PSHG image sets can be acquired with multiphoton microscopes featuring polarization control for the input laser beam.19,38 Datasets collected with widefield SHG systems15 with input laser polarization control represent a good match as well for CollagenFitJ. For a laser scanning SHG microscope, to efficiently configure the image acquisition protocol, the reader is advised to consult Chen et al.9 Furthermore, valuable aspects of the precise laser beam polarization control are provided by Romijn et al.46 Images in all formats readable by ImageJ/FIJI can be used with our plugin, but lossless file formats (e.g., .tiff) are recommended for reliable quantitative analysis. The PSHG microscope can either provide PSHG image stacks, which can be readily processed by the CollagenFitJ plugin (workflow A, see final paragraph of this section), or standalone images for each input polarization, which can be easily converted in stacks using ImageJ (workflow B, see final paragraph of this section). The plugin can handle images with standard dimensions (e.g., , , and ). Depending on the computer’s performance and available memory, we recommend processing widefield PSHG stacks in regions of interest rather than all at once. For image mosaics that cover large areas or the entire tissue sample, it is advisable to process the individual tiles with CollagenFitJ before assembling the complete mosaic.
The method described here features three distinct workflows, each with its own outputs and capable of being executed separately based on user needs: workflow A (using only the CollagenFitJ plugin), workflow B (utilizing the CollagenFitJ macro along with the integrated plugin and an optional macro for image adaptation for classification tasks), and workflow C (employing either the CollagenFitJ plugin or macro with a data export macro). The workflows are detailed below, and the step-by-step instructions for installing and operating the plugin are provided in the Supplementary Materials, Sec. 1.
Workflow A Output: FI.tif, CHI3115.tif, CHI3315.tif, CHI3331.tif, THETA.tif, ERR.tif, SNR.tif, and R2.tif.
Workflow B output:
- 1.Raw images: the same as those for Workflow A Output.
- 2.Images with selected pixels. The file names for these images follow the next convention: “CollagenFitJ output image”_”thresholding method”_threshold_”threshold value”.tif, where “CollagenFitJ output image” can be one of the eight images in Workflow A Output, and “thresholding method” can be one of the fitting assessment images.
- 3.Local statistics images. These are selected by the user in step 20. The file names for these images follow the next convention:
“CollagenFitJ output image”_(”thresholding method”_threshold_”threshold value”_)”method”_radius_”radius value”_size_”size value”, where the information about thresholding appears only if pixel selection was chosen, “method” is one of: SD, MAD, and ENT, whereas “radius value” and “size value” correspond to the radius and size of the selected kernel in ImageJ’s circular masks.
Workflow C output: tabulated data for statistical analysis.
3.2 Technical Validation
We validated CollagenFitJ on PSHG images obtained from both scanning laser and widefield SHG microscopes. For scanning SHG, validation was performed on rat tail tendon [Fig. 3(a)], thyroid nodule capsules [Fig. 3(b)], and mouse colon tumor [Fig. 3(c)]. For widefield SHG, we assessed collagen organization in rat tail tendon [Fig. 3(d)]. The plugin also provided conclusive results for in vivo B16 melanoma images (Fig. 4), which align with previously published data from phasor analysis of PSHG stacks.19 We anticipate that the proposed method will require no modifications for use with PSHG images obtained from super-resolution SHG microscopes (e.g., image scanning SHG10 and rescan-SHG11).
![]()
Figure 3.Validation of CollagenFitJ on PSHG image sets from various formalin-fixed paraffin-embedded tissue sections using different techniques and configurations. For each dataset, a PSHG image obtained as the average of the raw PSHG image stack is provided. Also included are the outputs of the CollagenFitJ plugin: collagen structure-related images (FI, CHI3115, CHI3315, CHI3331, and THETA), fitting assessment images (ERR, SNR, and
![]()
Figure 4.Validation of CollagenFitJ using
To assess potential trade-offs between computational speed and fitting accuracy when using CollagenFitJ, we compared its outputs with those of a slow iterative algorithm (Fig. S3 in the Supplementary Material). While the iterative algorithm processed the images in , CollagenFitJ offered significantly faster runtime (see Sec. 3.3). Fitting efficiency47 was slightly higher for the iterative algorithm, but it produced fewer meaningful fitted pixels compared with the CollagenFitJ plugin.
Comparing the and ratios (Table S1 in the Supplementary Material), CollagenFitJ showed higher SD values for the ratios’ distributions than the iterative algorithm, indicating more outliers. Filtering CollagenFitJ’s results to include only pixels with reduced SD and brought the mode and mean closer to those of the iterative algorithm.
Although the slight differences between the outputs of the iterative algorithm and CollagenFitJ can be mitigated by filtering pixels with better fitting estimation parameters (here we propose ), one potential disadvantage of the FF-PSHG method, which requires further investigation for mitigation, is its suitability only to collagen models that can be reduced to SHG intensity dependence expressible as a Fourier series expansion.
Overall, the examples presented here illustrate that CollagenFitJ is versatile for analyzing PSHG images regardless of the acquisition technique, offering valuable insights into collagen orientation and anisotropy at the pixel level. Future iterations of the plugin could also be adapted for PSHG image sets from tissue samples with striated muscle areas with minimal modifications to the current algorithm. These modifications would need to account for the differences between collagen fibril and myofibril models.48
By employing this method, we successfully quantified collagen anisotropy and improved its evaluation.21 We also applied this method to optimize the determination of collagen structure-related parameters47 in skin tissue samples. In addition, our previous research demonstrated that local statistics derived from collagen structure parameters provide insights beyond the parameter values themselves. For instance, in a study on thyroid cancer, we used this approach to differentiate between benign and malignant thyroid nodule capsules.24 Moreover, given the prevalence of SHG analysis methods applied indiscriminately to images from fresh, fixed, or stained tissues, CollagenFitJ’s approach revealed the impact of hematoxylin and eosin staining on extracting collagen structure parameters from PSHG image sets.44 Finally, the value of using the PSHG fitting methods in CollagenFitJ was underscored in a Data Paper where we introduced PSHG-TISS, the first public and curated PSHG dataset,38 which supports the development and benchmarking of PSHG-oriented computer vision and image analysis techniques.
3.3 Timing
The timing information provided below is obtained by running the CollagenFitJ plugin and macros on a desktop personal computer equipped with an Intel Core i7-8700 CPU @ 3.20 GHz and 16 GB RAM.
Installation of the entire CollagenFitJ package (steps 1 to 7): 2 min.
Initial CollagenFitJ execution (steps 8 to 10): 1 min.
The CollagenFitJ plugin runtime (workflow A): for a image stack (10 deg polarization angle step).
Custom collagen mask generation (depending on user experience) (step 11): 2 to 5 min.
Setting the CollagenFitJ macro without the macro runtime (steps 12 to 24): 1 min.
For step 25, the runtime depends on the selected options. The runtime is if no local statistics images are selected. Runtime associated with individual options is provided in Table 1.
| Time (s) | Kernel | |||
| Radius: 0.5; size: 3 | Radius: 5; size: 11 | Radius: 10; size: 21 | ||
| Local statistics image | SD | 2 | 2 | 2.5 |
| MAD | 11 | 94 | 140 | |
| ENT | 21 | 24 | 28 |
Table 1. CollagenFitJ macro runtimes for
Conversion of NaN values to 0 for 100 image files (steps 26 to 29): 0.5 s.
Exporting a 10,000-pixel sample from a set of 100 images (steps 30 to 33): 15 s.
4 Discussion and Conclusion
In the previous section, we outlined the outputs generated by the CollagenFitJ plugin and macros. Figures 3 and 4 illustrate these outputs across a range of application examples, highlighting different tissue types, experimental configurations, and techniques.
Notably, the CollagenFitJ plugin employs methods that closely resemble those used in previous studies for extracting quantitative information on collagen orientation and anisotropy from PSHG image stacks. These principles have been independently validated across various peer-reviewed studies involving different tissue types and pathologies.19,49
In previous research, we utilized the methodologies underlying CollagenFitJ to enhance collagen orientation angle determination for more accurate anisotropy evaluation21 and to examine the impact of hematoxylin and eosin staining on extracting collagen structural information.44 We also applied these methods to differentiate between benign and malignant thyroid nodules,24 by analyzing collagen structural parameters and parameter spread maps in thyroid nodule capsules. In addition, following this approach, we developed PSHG-TISS,38 the first public and curated PSHG image dataset featuring breast, skin, and thyroid tissue samples. PSHG-TISS includes raw PSHG image stacks as well as maps related to collagen structure and its distribution. Beyond these applications, we propose that the techniques used in CollagenFitJ are broadly applicable to various polarization-dependent SHG microscopy methods, including widefield PSHG [as shown in Fig. 3(d) on the rat tail tendon and in previous publications on thyroid tissue sections53] and super-resolved techniques such as image scanning10 or re-scan SHG.11
The plugin produces three fitting assessment images [ERR,31 SNR,40 and (Ref. 47)] that have previously been utilized to identify relevant pixels for display or further analysis. These images evaluate the goodness-of-fit between PSHG data and theoretical collagen models, and good-fitting results are typically observed in collagen-rich areas, with ERR, SNR, and values being influenced by the number of images in the PSHG stack (Fig. S4 in the Supplementary Materials). As the number of images in the PSHG stack decreases, values exhibit a slight decline, whereas values in ERR and SNR remain relatively stable. However, further reducing the number of images in the stack results in a significant increase in values in ERR and a decrease in those in SNR images. This trend is generally expected, but the goodness-of-fit should also be considered in the context of the suitability of the collagen model for the sample. In this study, we employed the single-axis molecule model, which assumes cylindrical symmetry. However, more general models, such as the trigonal model, have been shown to yield better results in specific cases,54 often leading to an increase in fitting quality estimators.
CollagenFitJ can play a key role in improving segmentation techniques for collagen PSHG images by enabling the creation of binary masks from fitting assessment images (see step 11A in the Supplementary Material). These masks can be effectively used for subsequent collagen segmentation. Although the results depend heavily on image type and threshold selection (Fig. S5 in the Supplementary Material), combining masks derived from fitting assessment images with binary operations and intensity-based segmentation may yield more robust results. On the other hand, intensity-based segmentation, though widely used in image analysis, is highly sensitive to noise, lighting variations, and low contrast, leading to inconsistent outcomes. It disregards spatial context and texture, often resulting in over- or under-segmentation. In addition, its effectiveness is limited by dataset-specific threshold selection, making it less adaptable, and it struggles to distinguish overlapping structures with similar intensities. However, collagen masks derived from CollagenFitJ outputs incorporate biophysical meaning, as the assessment values reflect the suitability of the collagen model for the sample.
Another feature provided by CollagenFitJ is the extraction of pixel sample sets prepared for statistical analysis. A preliminary step in evaluating potential differences for distinguishing between tissues with various pathologies involves performing statistical analysis on the dataset. For our purposes, the dataset includes collagen structure-related parameters provided by the CollagenFitJ plugin, along with locally computed dispersion and randomness maps. CollagenFitJ allows for the extraction of pixel values from the entire dataset (workflow C). These extracted pixel samples can then be used initially for visualization through bar and scatter plots and for statistical analysis24 using any third-party software (e.g., GraphPad Prism).
Images produced using the CollagenFitJ plugin can be used for classification experiments, transfer learning approaches,55 or information fusion techniques.56 In the context of transfer learning, the PSHG images along with the additional images generated by CollagenFitJ are particularly valuable, as SHG microscopy is a label-free method well-suited for in vivo applications. CollagenFitJ facilitates the creation of numerous representations of PSHG datasets, offering valuable diagnostic insights. Although not yet explored, the rich variety of representations and information generated by CollagenFitJ presents an excellent opportunity for future research in PSHG image analysis, particularly through information fusion methods. Combining various PSHG image representations to produce composite data that enhances the detection of abnormalities or highlights key features will be a focus of our future work.
To conclude, we describe an image analysis method for deriving collagen structural parameters from polarization-resolved second harmonic generation microscopy. The accompanying FIJI plugin and processing method are designed to facilitate this analysis, potentially driving similar initiatives that address open data. These efforts could significantly enhance current image processing and analysis techniques and support the development of new methods for extracting meaningful quantitative data from raw PSHG image sets.
Biographies of the authors are not available.
References

Set citation alerts for the article
Please enter your email address


AI Video Guide
AI Picture Guide
AI One Sentence


