Compute corneal deflection volume (DeflVol) at the highest concavity (HC) moment using a two-sphere intersection model. The default algorithm is a closed-form analytical volume; an equivalent disk-integration method is also available.
install.packages("pak")
pak::pak("GulumimiRen/CorDeflVol")From the package directory:
install.packages(".", repos = NULL, type = "source")Download CorDeflVol_0.1.0.tar.gz from the v0.1.0 release (Assets on that page).
With pak (local path or release URL):
pak::pak("path/to/CorDeflVol_0.1.0.tar.gz")pak::pak("https://github.com/GulumimiRen/CorDeflVol/releases/download/v0.1.0/CorDeflVol_0.1.0.tar.gz")With base R:
install.packages("path/to/CorDeflVol_0.1.0.tar.gz", repos = NULL, type = "source")library(CorDeflVol)
CR <- 7.8
IR <- 6.4
DeflAmp <- 0.93
# scalar
deflvol(CR, IR, DeflAmp)
# vectorized
deflvol(c(7.8, 7.5), c(6.4, 6.2), c(0.93, 0.90))
# column-wise with dplyr
library(dplyr)
df <- df |> mutate(DeflVol = deflvol(CR, IR, DeflAmp))
# disk integration (optional)
deflvol(CR, IR, DeflAmp, method = "integral", N = 4000L)| Parameter | Description | Unit |
|---|---|---|
CR |
Corneal curvature radius | mm |
IR |
Inverse curvature radius | mm |
DeflAmp |
Deflection amplitude at HC | mm |
Units must be consistent across all three inputs (mm).
Missing or non-positive radii return NA; non-overlapping geometry returns 0.
| Parameter | Description | Unit |
|---|---|---|
DeflVol |
HC deflection volume | μL |
When inputs are in mm, DeflVol is in μL (1 mm³ = 1 μL).
Sphere-center distance: d = CR + IR - DeflAmp.
Closed-form two-sphere intersection volume:
DeflVol = π (CR + IR − d)² [d² + 2d(CR + IR) − 3(CR − IR)²] / (12d)
The integral method computes the same volume by trapezoidal disk integration
over the overlap region (default N = 4000 segments).
If you use CorDeflVol in your research, please cite the article describing the DeflVol model:
Ren Q, Deng Z, Chu Z, Pan Z and Wan P (2026). DeflVol: a model-derived volumetric descriptor of corneal deflection at highest concavity under Corvis ST air-puff loading. Frontiers in Bioengineering and Biotechnology, 14:1933733. https://doi.org/10.3389/fbioe.2026.1933733
MIT — see LICENSE.