This repository contains MATLAB code used for the Methods/Results analyses accompanying the manuscript "An Integrated Multiphoton Imaging Workflow for Quantitative Analysis of Aortic Tissue Microstructure" Manuscript DOI: TBD.
The DOI for this repository is: https://doi.org/10.5281/zenodo.18234603
Volume Fraction/— collagen/elastin/other volume fractions from 3D multiphoton stacksCollagen/— collagen fiber waviness/straightness, orientation distributions, porosity/linear densityCell Nuclei/— nuclear aspect ratio (NAR) and nuclear orientation from 3D segmentationsElastin/— elastin lamella thickness from 2D cross-sections via manual boundary tracing + circle fits
Each subfolder is intended to be runnable independently (with its own inputs), but files within a subfolder typically call one another.
Developed/tested with MATLAB R2022b+ (newer should be fine).
- Image Processing Toolbox (e.g.,
imgaussfilt3,isosurface,bwconncomp,regionprops,adaptthresh,drawpolygon) - Statistics and Machine Learning Toolbox (e.g.,
rmoutliers)
Many scripts include absolute paths (e.g., OneDrive locations). You must edit those config variables to point to your local data directories.
Compute volume fractions (VF) of collagen, elastin, and other wall content using fixed intensity thresholds applied consistently across samples.
<baseCtrl>/<MouseID>/collagen_<P>mmHg.tiff
<baseCtrl>/<MouseID>/elastin_<P>mmHg.tiff
<basePreg>/<MouseID>/collagen_<P>mmHg.tiff
<basePreg>/<MouseID>/elastin_<P>mmHg.tiff
Purpose: Build fixed thresholds from a balanced subset of Control/Pregnant data.
What you must edit:
baseCtrl,basePreg(top of file)pressures,samplesPerGroupPerPressure(optional)
Outputs:
VF_thresholds_fixed.matVF_thresholds_fixed.txt
Purpose: Apply fixed thresholds to all samples, generate CSV + summary figures.
What you must edit:
baseCtrl,basePregzxlsPath(Excel file for Z-resolution if used)dx,dy(XY pixel size in µm)
Outputs:
- A results CSV (written by the script)
- Figures summarizing VF vs pressure and aggregate stacked bars
Purpose: Robustness checks (threshold stability, morphology sensitivity) using synthetic/phantom-style tests.
Quantify collagen fiber geometry and organization across pressure:
- Fiber waviness/straightness distributions (often stored as “allWaviness”)
- Orientation distributions and von Mises / mixture fits
- Linear density and/or porosity-related metrics
Most collagen scripts expect per-sample folders containing per-pressure MATLAB files like:
results_<P>mmHg.mat
Some scripts create these results files from ctFIRE outputs.
Run:
collagen_fiber_extraction_control.m
Inputs (ctFIRE):
- Plane-wise ctFIRE outputs such as
ctFIREout_<P>mmHg*.mat(pattern described in the file header)
Outputs (per sample, per pressure):
results_<P>mmHg.matcontaining vectors like:allWavinessallTrueLengthsallOrientationAngles
This script calls
LabelBranchesAM, but it can be commented out or deleted.
Run:
straightness_complete_analysis_Circ_and_Axial.m
Purpose:
- Filters fibers by length
- Splits by orientation (circumferential vs axial)
- Fits Beta distributions to waviness
- Plots group mean ± SEM vs pressure
Important note: If the file begins with a markdown fence (e.g., ```matlab), remove that line before running in MATLAB.
Options depending on what you want to report:
-
compute_fiber_orientation_distribution.m
Builds angle histograms across pressures fromallOrientationAnglesstored inresults_<P>mmHg.mat. -
Select_peaks_manual_6parameter.mlxandselect_peaks_manual_methods_paper_syntheticIM.m
Manual peak selection + fitting (two-fiber von Mises style). Use when you want interactive control over peaks.
Run:
get_all_3d_collagen_reconstructions.m
Inputs:
- Overlay images
OL_ctFIRE_<P>mmHg*.tifexported by ctFIRE
Outputs:
- Multi-page 3D binary TIFF stacks per sample/pressure (see script header)
-
porosity_linear_density.m
Computes total traced length per unit imaged area vs pressure. -
collagen_porosity_with_width_extraction.m
End-to-end network analysis combining average fiber width extraction and porosity logic. This script expects to be run from a directory containing group folders.
Other helper functions used by fitting scripts:
Error_Calc_6_parameter.mnonlinear_constraints.mamplitude.m
Compute nuclear aspect ratio (NAR) and orientation from 3D nuclei segmentations.
threshold_Image.m
Uses Gaussian smoothing + background subtraction + Otsu thresholding and removes small components.
Input:
Original(3D grayscale volume)
Output:
binaryImage(3D logical mask)
get_Fibrin_centroids.m
Computes centroids and performs a cylindrical/flattening style radial selection to separate populations.
process_centroids.m
Given a labeled image and centroid list, returns a mask containing the full objects at those centroids.
-
nar_all_cells.m
For each connected surface component (viaisosurface+ mesh connectivity), fits an ellipsoid and computes:NAR(k) = a/c(major/minor semi-axis)V1_all(k,:)major-axis directiontheta_all(k)in-plane angle from XY projection ofV1
Also returns inliers after
rmoutliers:NAR2,V1_inliers,theta_inliers,inlier_mask
This calls:
calculate_ellipsoid_axes_STL_DATA.m
nar_violin_plots.m
Generates violin plots / summary statistics (expects saved.matfiles with NAR arrays).
M33Control.m
Example “batch” driver for one sample folder containing multiple pressure TIFFs. EditfolderPathand the filename→metadata mapping at the top.
Measure elastin lamella thickness from 2D cross-sectional images by:
- thresholding/enhancing image (optional),
- manually tracing boundaries,
- fitting circles to traced boundaries,
- computing thickness (outer radius − inner radius).
Extract_Coordinates.m- loads a binary image (or thresholds a grayscale image inside the script)
- prompts for pixel sizes
- uses
drawpolygonto trace inner and outer boundaries - saves:
innerBoundary.matouterBoundary.mat
Run_Coordinates.m- loads
innerBoundary.matandouterBoundary.mat - uses
fitCircleRobust.m+ helpers to fit circles - prints fitted parameters and thickness
- plots fitted circles
- loads
-
Extract_Coordinates_Lamellae.m- interactive tracing of multiple inner/outer boundaries
- saves a consolidated
.matfile intoCoordinates/
-
Run_coordinates_multiplelayers.m- loads a processed coordinate
.matfromCoordinates/ - performs thresholding display and metadata prompts
- hands off to circle fitting / thickness logic (see file)
- loads a processed coordinate
fitCircleRobust.mfitCircleWithFixedCenter.mcircleError.m,circleRadiusError.mCircle_Layers.mLamellae_Thickness.mCombined_Thickness_Distribution.mFinding_Sensitivity.mThresholding_Sample.m(standalone threshold exploration)
Example .mat inputs are included:
Lamellae_Raw_M1_Pregnant_20 mmHg.matLamellae_Raw_M2_Control_80mmHg.mat
Most scripts assume a specific directory layout and/or absolute paths.
Fix by editing the baseDir / folderPath / imagePath variables near the top of the script.
Some scripts compute angles in degrees, others plot in radians. When comparing across modules, confirm:
- angle range (e.g., 0–90 vs 0–180)
rmoutliers uses defaults; if you need a specific outlier policy for the manuscript,
document the method/threshold and pass name-value args explicitly in your final analysis version.