Run the following command for installation of the project
git clone https://github.com/Paddy-Xu/RenalFullSimu
cd RenalFullSimu
conda create -n NephronModel python==3.10
conda activate NephronModel
pip install -r requirements.txt
It will install the required packages listed in requirements.txt.
For simulating autoregulation on the full-scale neprhon-vascular network with inlet pressure range from 80 mmHg to 200 mmHg, run
python tree_model.py
-
final_tree.vtkThe most crucial input to the simulation pipeline is a full-scale renal arterial tree structure stored in .vtk format. Each node has its xyz location while each edge has its radius as edge feature. The simulation starts by first computing the blood flow and pressure along the vascular tree without autoregulation by applying Kirchhoff's current law as described in the paper. Since this step is quite time-consuming, these can also be precomputed and provide another .vtk file, in which the tree contains not only the topological info but also hemodynamic feautres (flow and pressure without autoregulation). -
surface.nii.gzA binary mask of the kidney surface, of which the full-scale renal arterial tree was reconstructed from. This is ONLY required if we want to differentiate three subpopulations of nephrons based on its depth/distance from kidney surface.
The hyper-parameters we used are given in the code already, but you may also want to adjust them if necessary
P_in_rangeRange of the inlet arterial pressure to simulate the autoregulation (in mmHg where 100 is the control case value)num_itermaximum number of iterations when solving autoregulationlrlearning rate (for updating AA radii after each iteration)only_myoflag for simulating myogenic mechanism only by blocking TGFpopflag for simulating 3 subpopulations of nephronsrelTolrelative tolerance of change of renal blood flow after each iteration to assess convergence (stop iteration)- Vascular tree related parameters (these should never be changed unless you have a new vascular tree data)
root_locroot location of the tree (xyz coordinates)vspacevoxel size
The code will output the renal blood flow under each arterial pressure level given in P_in_range, both with and without autoregulation.
For simulating a single nephron model, run
python single_model.py
This will calculate the pre-AA resistance of a certain nephron (and its connected AA) and simulate autoregulation of a single nephron. Note that a full-scale renal arterial tree structure will still have to be defined and loaded to calculate the pre-AA resistance and initial AA flow and pressure of a certain nephron.
Please refer to the input to the previous section (tree_model.py) for detailed illustration. Here we just list parameters specific to the single nephron model.
cur_nodeindex of a certain nephron number. This can be precomputed based on the initial pressure.
tree_model and single_model: main entry files for running simulation as described above
parameters includes all the parameters that are given in the appendix of the paper
nephron_eqs defines all the equations for both glomerular and tubular model as described in the method section
nephron_sovler defines the step for sovling the nephron model (both glomerular and tubular model). The final output to the next (afferent_arteriole) model is the Cs_md (NaCl concentration at macula densa)
afferent_arteriole defines the afferent arteriole model as described in the method section (for solving AA radius)
vascular_tree_model defines how the input vascular tree file in .vtk is read into python and also defines the
Kirchhoff's law to solve blood flow and pressure though the vascular tree given a new set of afferent arteriole radii