Data and code for: Position-dependent bias and uncertainty in stiffness and viscosity estimates from renal shear wave elastography: a finite element study of focal fibrosis
Description
This deposit holds the simulation output and the analysis code for a two-dimensional finite element study of renal shear wave elastography. An acoustic radiation force impulse launches a shear wave. The wave is tracked along a line that passes before a focal fibrotic lesion, through it, and out the far side, at each of the five CKD stages. A second model with no lesion, carrying the same properties everywhere, is included as a control. The lesion is an ellipse with semi-axes of 14 and 6 mm, rotated 20 degrees, centred at (70, 40) mm. Axial particle velocity is recorded along y = 40 mm at 361 positions, from x = 45 to 90 mm every 0.125 mm, sampled every 0.05 ms over a 50 ms record. Three regions are analysed: before the lesion (45 to 58 mm), inside it (59 to 81 mm), and beyond it (82 to 90 mm). The tissue is nearly incompressible, with a density of 1000 kg/m3 in the background and 1050 kg/m3 in the lesion. Stiffness and viscosity are recovered three ways: time of flight from a windowed peak, time of flight from cross-correlation, and shear wave dispersion fitted to a Kelvin-Voigt model. Noise is then added and the dispersion analysis repeated 200 times at each of 0.5, 1 and 2 per cent of the peak velocity, from a fixed seed. That is 9000 fits for the focal model and 3000 for the diffuse one. The deposit also holds the checks behind the analysis: a linear elastic sweep over seven stiffness values, dispersion in two gel phantoms, a mesh convergence study, a peak-detection window check, a ridge threshold sweep, and a control run in uniform tissue that fixes the level below which regional differences cannot be put down to a lesion. Contents: code/ (25 scripts) - the three recovery methods, the noise sweeps, the validation and control scripts, and the figure scripts. data/ (16 files) - the COMSOL exports for both models at every stage, the probe-table export, the linear elastic sweep, and the mesh convergence and phantom data. output/ (44 files) - the result tables as CSV, the figures as PDF and PNG, and the noise sweep log. run_all.m - runs everything in the right order. README.md - requirements, run order, the data file layouts, and what produces each table and figure. Every table and figure in the paper comes from a named script listed in README.md, and every reported number can be traced to a CSV in output/. The scripts need MATLAB R2023b with the Optimization Toolbox and the Signal Processing Toolbox. One figure is also given as a Python script. The finite element solution was produced in COMSOL Multiphysics 6.2.0.415; the model file is not included. What the data show: at the last CKD stage, recovered stiffness runs from 1.6 per cent below to 29.5 per cent above the assigned value, depending only on where the measurement is taken and which method is used. Beyond the lesion the dispersion fit stays repeatable but reads about 90 per cent low.
Files
Steps to reproduce
1. Unpack the zip. It opens as a folder called CKD_SWE_deposit, holding run_all.m, code/, data/ and output/. 2. Open MATLAB in that folder and run run_all.m. It puts code/ and data/ on the path, checks that the data files are there, runs the scripts in the right order, and writes everything into output/. 3. Run two more scripts by hand. NoiseSweep_CaseIV goes straight after CaseIV_MonteCarlo_AllStages, and NoiseSweep_CaseV straight after CaseV_MonteCarlo_AllStages, in the same MATLAB session. These two read arrays left in the workspace, so run the parent script on its own, do not type clear in between, and do not run them through run_all.m. They produce Supplementary Tables S1 to S3. You need MATLAB R2023b with the Optimization Toolbox (for lsqcurvefit) and the Signal Processing Toolbox (for xcorr). Nothing else is required. Figure 16 comes as both a MATLAB script and a Python 3 script that uses matplotlib. The Monte Carlo scripts set rng(1) before the 200 noise runs, so repeating them gives the same numbers as the paper. README.md says which script makes each table and each figure, explains the three data file layouts, and lists the settings that change the reported values. Expected runtime and how to check it worked run_all.m takes about 15 minutes on a desktop machine and ends by printing "22 of 22 scripts completed". The two Monte Carlo scripts are the slow part, performing 12,000 fits between them. If a script fails, run_all.m reports it, carries on, and lists the failures at the end. The output/ folder in this deposit already holds the results used in the paper, so you can compare your own run against them directly. A correct run reproduces all 17 result CSVs. Which script makes which table Table 4 LinearElastic_Validation. Table 5 MeshConvergence_PhantomA. Table 6 CaseII_PeakToF_vs_Xcorr. Table 7 CaseIII_PeakToF_AllStages and CaseIII_XcorrToF_AllStages. Table 8 CaseIII_Dispersion_AllStages. Table 9 CaseIV_MonteCarlo_AllStages. Table 10 CaseV_XcorrToF_AllStages and CaseV_Dispersion_AllStages. Table 11 CaseV_MonteCarlo_AllStages. Tables 1 to 3 list model inputs and are not script output. Reading the data files directly If you read the CSV files rather than running the scripts, note two quirks of the COMSOL export. In the Case III files, columns beyond 1003 are empty, because the column header contains a comma and splits into two fields while the data rows do not; the scripts trim with M = M(:,1:1003). The Case V and phantom files begin with an eight-line metadata block marked with %, which readmatrix skips.
Institutions
- Indian Institute of Technology MadrasTamil Nadu, Chennai