.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples\liver\plot_tristan_volunteers.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_liver_plot_tristan_volunteers.py: ========================================================= Clinical - rifampicin induced inhibition (short protocol) ========================================================= This example illustrates the use of `~dcmri.AortaLiver` for joint fitting of aorta and liver signals to a whole-body model. The use case is provided by the liver work package of the `TRISTAN project `_ which develops imaging biomarkers for drug safety assessment. The data and analysis was first presented at the ISMRM in 2024 (Min et al 2024, manuscript in press). The data were acquired in the aorta and liver of 10 healthy volunteers with dynamic gadoxetate-enhanced MRI, before and after administration of a drug (rifampicin) which is known to inhibit liver function. The assessments were done on two separate visits at least 2 weeks apart. The research question was to what extent rifampicin inhibits gadoxetate uptake rate from the extracellular space into the liver hepatocytes (khe, mL/min/100mL) and excretion rate from hepatocytes to bile (kbh, mL/100mL/min). 2 of the volunteers only had the baseline assessment, the other 8 volunteers completed the full study. The results showed consistent and strong inhibition of khe (95%) and kbh (40%) by rifampicin. This implies that rifampicin poses a risk of drug-drug interactions (DDI), meaning it can cause another drug to circulate in the body for far longer than expected, potentially causing harm or raising a need for dose adjustment. **Note**: this example is different to the 2 scan example of the same study in that this uses only the first scan to fit the model. Reference --------- Thazin Min, Marta Tibiletti, Paul Hockings, Aleksandra Galetin, Ebony Gunwhy, Gerry Kenna, Nicola Melillo, Geoff JM Parker, Gunnar Schuetz, Daniel Scotcher, John Waterton, Ian Rowe, and Steven Sourbron. *Measurement of liver function with dynamic gadoxetate-enhanced MRI: a validation study in healthy volunteers*. Proc Intl Soc Mag Reson Med, Singapore 2024. .. GENERATED FROM PYTHON SOURCE LINES 44-46 Setup ----- .. GENERATED FROM PYTHON SOURCE LINES 46-58 .. code-block:: Python # Import packages import pandas as pd import matplotlib.pyplot as plt import pydmr import dcmri as dc # Fetch the data from the TRISTAN rifampicin study: dmrfile = dc.fetch('tristan_humans_healthy_rifampicin') data = pydmr.read(dmrfile, 'nest') rois, pars = data['rois'], data['pars'] .. GENERATED FROM PYTHON SOURCE LINES 59-63 Model definition ---------------- In order to avoid some repetition in this script, we define a function that returns a trained model for a single dataset: .. GENERATED FROM PYTHON SOURCE LINES 63-103 .. code-block:: Python def tristan_human_1scan(roi, par, **kwargs): model = dc.AortaLiver( # Injection parameters weight = par['weight'], agent = 'gadoxetate', dose = par['dose_1'], rate = 1, # Acquisition parameters field_strength = 3, t0 = par['t0'], TR = par['TR'], FA = par['FA_1'], TS = roi['time_1'][1]-roi['time_1'][0], # Signal parameters R10a = 1/par['T1_aorta_1'], R10l = 1/par['T1_liver_1'], # Tissue parameters vol = par['liver_volume'], ) xdata = ( roi['time_1'][roi['aorta_1_accept']] - roi['time_1'][0], roi['time_1'][roi['liver_1_accept']] - roi['time_1'][0], ) ydata = ( roi['aorta_1'][roi['aorta_1_accept']], roi['liver_1'][roi['liver_1_accept']], ) model.train(xdata, ydata, **kwargs) return xdata, ydata, model .. GENERATED FROM PYTHON SOURCE LINES 104-109 Check model fit --------------- Before running the full analysis on all cases, lets illustrate the results by fitting the baseline visit for the first subject. We use maximum verbosity to get some feedback about the iterations: .. GENERATED FROM PYTHON SOURCE LINES 109-117 .. code-block:: Python xdata, ydata, model = tristan_human_1scan( rois['001']['control'], pars['001']['control'], xtol=1e-3, verbose=2, ) .. rst-class:: sphx-glr-script-out .. code-block:: none Iteration Total nfev Cost Cost reduction Step norm Optimality 0 1 2.3888e+07 1.06e+08 1 2 4.6841e+06 1.92e+07 5.14e+01 1.93e+07 2 3 1.1038e+06 3.58e+06 5.45e+01 9.63e+06 3 4 3.2929e+05 7.74e+05 6.01e+01 6.82e+06 4 5 9.9582e+04 2.30e+05 1.18e+02 2.29e+06 5 6 5.4377e+04 4.52e+04 6.96e+01 3.47e+05 6 7 5.0327e+04 4.05e+03 8.59e+01 4.13e+05 7 8 4.7209e+04 3.12e+03 7.50e+01 6.81e+04 8 9 4.6352e+04 8.57e+02 2.62e+01 1.55e+04 9 13 4.6317e+04 3.50e+01 7.00e-01 6.78e+04 10 15 4.6317e+04 0.00e+00 0.00e+00 6.78e+04 `xtol` termination condition is satisfied. Function evaluations 15, initial cost 2.3888e+07, final cost 4.6317e+04, first-order optimality 6.78e+04. Iteration Total nfev Cost Cost reduction Step norm Optimality 0 1 8.4783e+06 5.93e+08 1 2 1.2022e+05 8.36e+06 6.59e+02 3.68e+07 2 3 6.9595e+04 5.06e+04 7.88e+01 1.02e+06 3 4 6.5110e+04 4.49e+03 9.71e+01 6.72e+05 4 5 6.3848e+04 1.26e+03 7.04e+01 2.98e+05 5 6 6.3621e+04 2.26e+02 2.92e+01 5.39e+04 6 7 6.3620e+04 1.22e+00 3.12e+00 1.22e+03 7 8 6.3620e+04 1.71e-02 1.13e-01 5.66e+00 `xtol` termination condition is satisfied. Function evaluations 8, initial cost 8.4783e+06, final cost 6.3620e+04, first-order optimality 5.66e+00. Iteration Total nfev Cost Cost reduction Step norm Optimality 0 1 1.0995e+05 6.31e+04 1 5 1.0993e+05 2.10e+01 2.33e+00 7.78e+03 `xtol` termination condition is satisfied. Function evaluations 5, initial cost 1.0995e+05, final cost 1.0993e+05, first-order optimality 7.78e+03. .. GENERATED FROM PYTHON SOURCE LINES 118-120 Plot the results to check that the model has fitted the data. The plot also shows the concentration in the two liver compartments separately: .. GENERATED FROM PYTHON SOURCE LINES 120-123 .. code-block:: Python model.plot(xdata, ydata) .. image-sg:: /examples/liver/images/sphx_glr_plot_tristan_volunteers_001.png :alt: plot tristan volunteers :srcset: /examples/liver/images/sphx_glr_plot_tristan_volunteers_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 124-127 Print the measured model parameters and any derived parameters. Standard deviations are included as a measure of parameter uncertainty, indicate that all parameters are identified robustly: .. GENERATED FROM PYTHON SOURCE LINES 127-130 .. code-block:: Python model.print_params(round_to=3) .. rst-class:: sphx-glr-script-out .. code-block:: none -------------------------------- Free parameters with their stdev -------------------------------- First bolus arrival time (BAT): 72.758 (0.674) sec Cardiac output (CO): 232.299 (6.087) mL/sec Heart-lung mean transit time (Thl): 21.773 (1.195) sec Heart-lung dispersion (Dhl): 0.611 (0.013) Organs blood mean transit time (To): 24.302 (0.693) sec Organs extraction fraction (Eo): 0.132 (0.002) Organs extravascular mean transit time (Toe): 626.014 (21.459) sec Body extraction fraction (Eb): 0.044 (0.003) Liver extracellular volume fraction (ve): 0.462 (0.015) mL/cm3 Extracellular mean transit time (Te): 60.0 (2.838) sec Extracellular dispersion (De): 0.845 (0.015) Hepatocellular uptake rate (khe): 0.005 (0.0) mL/sec/cm3 Hepatocellular mean transit time (Th): 2577.068 (48.07) sec ---------------------------- Fixed and derived parameters ---------------------------- Hematocrit (H): 0.45 Biliary tissue excretion rate (Kbh): 0.0 mL/sec/cm3 Hepatocellular tissue uptake rate (Khe): 0.011 mL/sec/cm3 Biliary excretion rate (kbh): 0.0 mL/sec/cm3 Liver blood clearance (CL): 5.698 mL/sec .. GENERATED FROM PYTHON SOURCE LINES 131-137 Fit all data ------------ Now that we have illustrated an individual result in some detail, we proceed with fitting the data for all 10 volunteers, at baseline and rifampicin visit. We do not print output for these individual computations and instead store results in one single dataframe: .. GENERATED FROM PYTHON SOURCE LINES 137-168 .. code-block:: Python results = [] # Loop over all datasets for subj in rois.keys(): for visit in rois[subj].keys(): roi = rois[subj][visit] par = pars[subj][visit] # Generate a trained model for the scan: _, _, model = tristan_human_1scan(roi, par, xtol=1e-3) # Export fitted parameters as lists rows = model.export_params(type='list') # Add study, visit and subject info rows = [row + [visit, subj] for row in rows] # Add to the list of all results results += rows # Combine all results into a single dataframe. cols = ['parameter', 'name', 'value', 'unit', 'stdev', 'visit', 'subject'] results = pd.DataFrame(results, columns=cols) # Print all results print(results.to_string()) .. rst-class:: sphx-glr-script-out .. code-block:: none parameter name value unit stdev visit subject 0 BAT First bolus arrival time 72.757986 sec 0.673615 control 001 1 CO Cardiac output 232.299188 mL/sec 6.087238 control 001 2 Thl Heart-lung mean transit time 21.773497 sec 1.194844 control 001 3 Dhl Heart-lung dispersion 0.610652 0.012799 control 001 4 To Organs blood mean transit time 24.302444 sec 0.692816 control 001 5 Eo Organs extraction fraction 0.131726 0.002352 control 001 6 Toe Organs extravascular mean transit time 626.013716 sec 21.459012 control 001 7 Eb Body extraction fraction 0.044127 0.002946 control 001 8 H Hematocrit 0.450000 0.000000 control 001 9 ve Liver extracellular volume fraction 0.462281 mL/cm3 0.014664 control 001 10 Te Extracellular mean transit time 60.000000 sec 2.838266 control 001 11 De Extracellular dispersion 0.844578 0.014999 control 001 12 khe Hepatocellular uptake rate 0.005151 mL/sec/cm3 0.000046 control 001 13 Th Hepatocellular mean transit time 2577.067980 sec 48.070015 control 001 14 Kbh Biliary tissue excretion rate 0.000388 mL/sec/cm3 0.000000 control 001 15 Khe Hepatocellular tissue uptake rate 0.011143 mL/sec/cm3 0.000000 control 001 16 kbh Biliary excretion rate 0.000209 mL/sec/cm3 0.000000 control 001 17 CL Liver blood clearance 5.698430 mL/sec 0.000000 control 001 18 BAT First bolus arrival time 76.884398 sec 0.463265 control 002 19 CO Cardiac output 74.826143 mL/sec 2.013844 control 002 20 Thl Heart-lung mean transit time 17.720279 sec 0.606438 control 002 21 Dhl Heart-lung dispersion 0.477478 0.016282 control 002 22 To Organs blood mean transit time 27.107456 sec 2.358084 control 002 23 Eo Organs extraction fraction 0.327986 0.013195 control 002 24 Toe Organs extravascular mean transit time 426.424427 sec 35.130333 control 002 25 Eb Body extraction fraction 0.010235 0.006230 control 002 26 H Hematocrit 0.450000 0.000000 control 002 27 ve Liver extracellular volume fraction 0.144395 mL/cm3 0.277559 control 002 28 Te Extracellular mean transit time 55.793368 sec 77.539785 control 002 29 De Extracellular dispersion 0.836376 0.204701 control 002 30 khe Hepatocellular uptake rate 0.006753 mL/sec/cm3 0.000294 control 002 31 Th Hepatocellular mean transit time 1618.012511 sec 90.634292 control 002 32 Kbh Biliary tissue excretion rate 0.000618 mL/sec/cm3 0.000000 control 002 33 Khe Hepatocellular tissue uptake rate 0.046769 mL/sec/cm3 0.000000 control 002 34 kbh Biliary excretion rate 0.000529 mL/sec/cm3 0.000000 control 002 35 CL Liver blood clearance 4.617024 mL/sec 0.000000 control 002 36 BAT First bolus arrival time 72.078082 sec 0.881352 drug 002 37 CO Cardiac output 89.615884 mL/sec 2.457399 drug 002 38 Thl Heart-lung mean transit time 15.915348 sec 1.037939 drug 002 39 Dhl Heart-lung dispersion 0.383825 0.017846 drug 002 40 To Organs blood mean transit time 21.296471 sec 1.550553 drug 002 41 Eo Organs extraction fraction 0.189222 0.012829 drug 002 42 Toe Organs extravascular mean transit time 263.752979 sec 25.617603 drug 002 43 Eb Body extraction fraction 0.060823 0.003361 drug 002 44 H Hematocrit 0.450000 0.000000 drug 002 45 ve Liver extracellular volume fraction 0.163167 mL/cm3 0.012324 drug 002 46 Te Extracellular mean transit time 40.234734 sec 5.246645 drug 002 47 De Extracellular dispersion 0.703015 0.059625 drug 002 48 khe Hepatocellular uptake rate 0.000491 mL/sec/cm3 0.000039 drug 002 49 Th Hepatocellular mean transit time 35999.999996 sec 78438.163239 drug 002 50 Kbh Biliary tissue excretion rate 0.000028 mL/sec/cm3 0.000000 drug 002 51 Khe Hepatocellular tissue uptake rate 0.003011 mL/sec/cm3 0.000000 drug 002 52 kbh Biliary excretion rate 0.000023 mL/sec/cm3 0.000000 drug 002 53 CL Liver blood clearance 0.394182 mL/sec 0.000000 drug 002 54 BAT First bolus arrival time 72.297856 sec 2.257268 control 003 55 CO Cardiac output 98.982185 mL/sec 2.941431 control 003 56 Thl Heart-lung mean transit time 12.514941 sec 2.757268 control 003 57 Dhl Heart-lung dispersion 0.556608 0.085506 control 003 58 To Organs blood mean transit time 33.476426 sec 2.420000 control 003 59 Eo Organs extraction fraction 0.131137 0.010026 control 003 60 Toe Organs extravascular mean transit time 324.211574 sec 29.506717 control 003 61 Eb Body extraction fraction 0.095546 0.005084 control 003 62 H Hematocrit 0.450000 0.000000 control 003 63 ve Liver extracellular volume fraction 0.159067 mL/cm3 0.073263 control 003 64 Te Extracellular mean transit time 30.841463 sec 13.531573 control 003 65 De Extracellular dispersion 0.693396 0.160659 control 003 66 khe Hepatocellular uptake rate 0.008348 mL/sec/cm3 0.000164 control 003 67 Th Hepatocellular mean transit time 2747.864393 sec 123.549416 control 003 68 Kbh Biliary tissue excretion rate 0.000364 mL/sec/cm3 0.000000 control 003 69 Khe Hepatocellular tissue uptake rate 0.052484 mL/sec/cm3 0.000000 control 003 70 kbh Biliary excretion rate 0.000306 mL/sec/cm3 0.000000 control 003 71 CL Liver blood clearance 7.297126 mL/sec 0.000000 control 003 72 BAT First bolus arrival time 68.130792 sec 0.583453 drug 003 73 CO Cardiac output 125.069164 mL/sec 3.397503 drug 003 74 Thl Heart-lung mean transit time 10.645574 sec 0.659684 drug 003 75 Dhl Heart-lung dispersion 0.309266 0.014965 drug 003 76 To Organs blood mean transit time 18.375134 sec 1.125476 drug 003 77 Eo Organs extraction fraction 0.131255 0.011886 drug 003 78 Toe Organs extravascular mean transit time 206.404244 sec 21.861610 drug 003 79 Eb Body extraction fraction 0.042835 0.002039 drug 003 80 H Hematocrit 0.450000 0.000000 drug 003 81 ve Liver extracellular volume fraction 0.205298 mL/cm3 0.012600 drug 003 82 Te Extracellular mean transit time 26.706008 sec 2.933755 drug 003 83 De Extracellular dispersion 0.617572 0.056332 drug 003 84 khe Hepatocellular uptake rate 0.000520 mL/sec/cm3 0.000040 drug 003 85 Th Hepatocellular mean transit time 35999.915589 sec 76916.840000 drug 003 86 Kbh Biliary tissue excretion rate 0.000028 mL/sec/cm3 0.000000 drug 003 87 Khe Hepatocellular tissue uptake rate 0.002535 mL/sec/cm3 0.000000 drug 003 88 kbh Biliary excretion rate 0.000022 mL/sec/cm3 0.000000 drug 003 89 CL Liver blood clearance 0.448462 mL/sec 0.000000 drug 003 90 BAT First bolus arrival time 75.096203 sec 0.172183 control 004 91 CO Cardiac output 64.735969 mL/sec 1.100655 control 004 92 Thl Heart-lung mean transit time 8.271387 sec 0.265919 control 004 93 Dhl Heart-lung dispersion 0.641363 0.008897 control 004 94 To Organs blood mean transit time 39.850158 sec 1.886112 control 004 95 Eo Organs extraction fraction 0.301993 0.009059 control 004 96 Toe Organs extravascular mean transit time 478.511252 sec 35.198708 control 004 97 Eb Body extraction fraction 0.148924 0.008047 control 004 98 H Hematocrit 0.450000 0.000000 control 004 99 ve Liver extracellular volume fraction 0.097127 mL/cm3 6.834463 control 004 100 Te Extracellular mean transit time 59.999992 sec 3659.437747 control 004 101 De Extracellular dispersion 0.868003 8.042481 control 004 102 khe Hepatocellular uptake rate 0.003384 mL/sec/cm3 0.001031 control 004 103 Th Hepatocellular mean transit time 11784.633715 sec 1873.441478 control 004 104 Kbh Biliary tissue excretion rate 0.000085 mL/sec/cm3 0.000000 control 004 105 Khe Hepatocellular tissue uptake rate 0.034838 mL/sec/cm3 0.000000 control 004 106 kbh Biliary excretion rate 0.000077 mL/sec/cm3 0.000000 control 004 107 CL Liver blood clearance 2.998097 mL/sec 0.000000 control 004 108 BAT First bolus arrival time 68.094059 sec 0.284698 drug 004 109 CO Cardiac output 92.653777 mL/sec 0.866168 drug 004 110 Thl Heart-lung mean transit time 14.542657 sec 0.321128 drug 004 111 Dhl Heart-lung dispersion 0.518254 0.011421 drug 004 112 To Organs blood mean transit time 52.712769 sec 1.392276 drug 004 113 Eo Organs extraction fraction 0.212850 0.004247 drug 004 114 Toe Organs extravascular mean transit time 565.444858 sec 33.572212 drug 004 115 Eb Body extraction fraction 0.030844 0.003373 drug 004 116 H Hematocrit 0.450000 0.000000 drug 004 117 ve Liver extracellular volume fraction 0.193796 mL/cm3 0.006942 drug 004 118 Te Extracellular mean transit time 60.000000 sec 3.747732 drug 004 119 De Extracellular dispersion 0.799336 0.021149 drug 004 120 khe Hepatocellular uptake rate 0.000307 mL/sec/cm3 0.000026 drug 004 121 Th Hepatocellular mean transit time 4965.170987 sec 1811.381880 drug 004 122 Kbh Biliary tissue excretion rate 0.000201 mL/sec/cm3 0.000000 drug 004 123 Khe Hepatocellular tissue uptake rate 0.001586 mL/sec/cm3 0.000000 drug 004 124 kbh Biliary excretion rate 0.000162 mL/sec/cm3 0.000000 drug 004 125 CL Liver blood clearance 0.302233 mL/sec 0.000000 drug 004 126 BAT First bolus arrival time 77.669999 sec 0.929095 control 005 127 CO Cardiac output 116.889484 mL/sec 3.762678 control 005 128 Thl Heart-lung mean transit time 10.468399 sec 1.164545 control 005 129 Dhl Heart-lung dispersion 0.656596 0.050925 control 005 130 To Organs blood mean transit time 26.335754 sec 1.223506 control 005 131 Eo Organs extraction fraction 0.171999 0.007224 control 005 132 Toe Organs extravascular mean transit time 348.103480 sec 18.273857 control 005 133 Eb Body extraction fraction 0.056401 0.003524 control 005 134 H Hematocrit 0.450000 0.000000 control 005 135 ve Liver extracellular volume fraction 0.254699 mL/cm3 0.033283 control 005 136 Te Extracellular mean transit time 44.531771 sec 6.841390 control 005 137 De Extracellular dispersion 0.789135 0.044475 control 005 138 khe Hepatocellular uptake rate 0.006262 mL/sec/cm3 0.000111 control 005 139 Th Hepatocellular mean transit time 1731.096731 sec 47.935959 control 005 140 Kbh Biliary tissue excretion rate 0.000578 mL/sec/cm3 0.000000 control 005 141 Khe Hepatocellular tissue uptake rate 0.024587 mL/sec/cm3 0.000000 control 005 142 kbh Biliary excretion rate 0.000431 mL/sec/cm3 0.000000 control 005 143 CL Liver blood clearance 4.417015 mL/sec 0.000000 control 005 144 BAT First bolus arrival time 71.098251 sec 0.107100 control 006 145 CO Cardiac output 80.535306 mL/sec 1.406188 control 006 146 Thl Heart-lung mean transit time 14.959238 sec 0.230475 control 006 147 Dhl Heart-lung dispersion 0.372219 0.007546 control 006 148 To Organs blood mean transit time 35.422011 sec 2.088555 control 006 149 Eo Organs extraction fraction 0.223823 0.011773 control 006 150 Toe Organs extravascular mean transit time 327.921715 sec 24.657978 control 006 151 Eb Body extraction fraction 0.077183 0.003926 control 006 152 H Hematocrit 0.450000 0.000000 control 006 153 ve Liver extracellular volume fraction 0.290468 mL/cm3 0.097317 control 006 154 Te Extracellular mean transit time 59.616385 sec 19.369244 control 006 155 De Extracellular dispersion 0.790568 0.075413 control 006 156 khe Hepatocellular uptake rate 0.007464 mL/sec/cm3 0.000202 control 006 157 Th Hepatocellular mean transit time 2308.531027 sec 112.733731 control 006 158 Kbh Biliary tissue excretion rate 0.000433 mL/sec/cm3 0.000000 control 006 159 Khe Hepatocellular tissue uptake rate 0.025696 mL/sec/cm3 0.000000 control 006 160 kbh Biliary excretion rate 0.000307 mL/sec/cm3 0.000000 control 006 161 CL Liver blood clearance 5.158722 mL/sec 0.000000 control 006 162 BAT First bolus arrival time 66.293679 sec 0.422394 drug 006 163 CO Cardiac output 123.556229 mL/sec 1.839985 drug 006 164 Thl Heart-lung mean transit time 19.761583 sec 0.501526 drug 006 165 Dhl Heart-lung dispersion 0.321588 0.007270 drug 006 166 To Organs blood mean transit time 20.475061 sec 1.029143 drug 006 167 Eo Organs extraction fraction 0.166170 0.006958 drug 006 168 Toe Organs extravascular mean transit time 321.269102 sec 22.093643 drug 006 169 Eb Body extraction fraction 0.029888 0.001767 drug 006 170 H Hematocrit 0.450000 0.000000 drug 006 171 ve Liver extracellular volume fraction 0.288691 mL/cm3 0.010961 drug 006 172 Te Extracellular mean transit time 43.489624 sec 2.886927 drug 006 173 De Extracellular dispersion 0.678584 0.030434 drug 006 174 khe Hepatocellular uptake rate 0.000256 mL/sec/cm3 0.000036 drug 006 175 Th Hepatocellular mean transit time 35999.999913 sec 150176.289850 drug 006 176 Kbh Biliary tissue excretion rate 0.000028 mL/sec/cm3 0.000000 drug 006 177 Khe Hepatocellular tissue uptake rate 0.000888 mL/sec/cm3 0.000000 drug 006 178 kbh Biliary excretion rate 0.000020 mL/sec/cm3 0.000000 drug 006 179 CL Liver blood clearance 0.180954 mL/sec 0.000000 drug 006 180 BAT First bolus arrival time 70.324553 sec 0.893698 control 007 181 CO Cardiac output 94.514812 mL/sec 2.149391 control 007 182 Thl Heart-lung mean transit time 9.906647 sec 1.042241 control 007 183 Dhl Heart-lung dispersion 0.457203 0.033365 control 007 184 To Organs blood mean transit time 31.973720 sec 1.467773 control 007 185 Eo Organs extraction fraction 0.248905 0.008846 control 007 186 Toe Organs extravascular mean transit time 417.174855 sec 19.122731 control 007 187 Eb Body extraction fraction 0.049195 0.003170 control 007 188 H Hematocrit 0.450000 0.000000 control 007 189 ve Liver extracellular volume fraction 0.052482 mL/cm3 0.030613 control 007 190 Te Extracellular mean transit time 59.997586 sec 12.405136 control 007 191 De Extracellular dispersion 1.000000 0.075934 control 007 192 khe Hepatocellular uptake rate 0.005441 mL/sec/cm3 0.000089 control 007 193 Th Hepatocellular mean transit time 2001.999413 sec 64.725676 control 007 194 Kbh Biliary tissue excretion rate 0.000500 mL/sec/cm3 0.000000 control 007 195 Khe Hepatocellular tissue uptake rate 0.103681 mL/sec/cm3 0.000000 control 007 196 kbh Biliary excretion rate 0.000473 mL/sec/cm3 0.000000 control 007 197 CL Liver blood clearance 5.137575 mL/sec 0.000000 control 007 198 BAT First bolus arrival time 65.005490 sec 0.498505 drug 007 199 CO Cardiac output 102.549107 mL/sec 1.894996 drug 007 200 Thl Heart-lung mean transit time 14.126141 sec 0.615160 drug 007 201 Dhl Heart-lung dispersion 0.353436 0.006788 drug 007 202 To Organs blood mean transit time 20.754797 sec 0.943864 drug 007 203 Eo Organs extraction fraction 0.207300 0.008668 drug 007 204 Toe Organs extravascular mean transit time 237.876132 sec 13.006344 drug 007 205 Eb Body extraction fraction 0.049817 0.001694 drug 007 206 H Hematocrit 0.450000 0.000000 drug 007 207 ve Liver extracellular volume fraction 0.169981 mL/cm3 0.007089 drug 007 208 Te Extracellular mean transit time 50.924697 sec 3.968114 drug 007 209 De Extracellular dispersion 0.772083 0.029980 drug 007 210 khe Hepatocellular uptake rate 0.000258 mL/sec/cm3 0.000019 drug 007 211 Th Hepatocellular mean transit time 35999.864432 sec 62296.227297 drug 007 212 Kbh Biliary tissue excretion rate 0.000028 mL/sec/cm3 0.000000 drug 007 213 Khe Hepatocellular tissue uptake rate 0.001519 mL/sec/cm3 0.000000 drug 007 214 kbh Biliary excretion rate 0.000023 mL/sec/cm3 0.000000 drug 007 215 CL Liver blood clearance 0.288004 mL/sec 0.000000 drug 007 216 BAT First bolus arrival time 72.641703 sec 0.826157 control 008 217 CO Cardiac output 175.779345 mL/sec 3.775950 control 008 218 Thl Heart-lung mean transit time 18.386905 sec 1.006370 control 008 219 Dhl Heart-lung dispersion 0.387347 0.013231 control 008 220 To Organs blood mean transit time 19.786910 sec 1.145831 control 008 221 Eo Organs extraction fraction 0.174005 0.007106 control 008 222 Toe Organs extravascular mean transit time 360.235691 sec 20.017259 control 008 223 Eb Body extraction fraction 0.043322 0.002353 control 008 224 H Hematocrit 0.450000 0.000000 control 008 225 ve Liver extracellular volume fraction 0.185668 mL/cm3 0.019805 control 008 226 Te Extracellular mean transit time 23.518401 sec 2.991641 control 008 227 De Extracellular dispersion 0.555301 0.074115 control 008 228 khe Hepatocellular uptake rate 0.006598 mL/sec/cm3 0.000109 control 008 229 Th Hepatocellular mean transit time 1647.439658 sec 45.848011 control 008 230 Kbh Biliary tissue excretion rate 0.000607 mL/sec/cm3 0.000000 control 008 231 Khe Hepatocellular tissue uptake rate 0.035539 mL/sec/cm3 0.000000 control 008 232 kbh Biliary excretion rate 0.000494 mL/sec/cm3 0.000000 control 008 233 CL Liver blood clearance 6.791766 mL/sec 0.000000 control 008 234 BAT First bolus arrival time 71.704176 sec 0.265582 drug 008 235 CO Cardiac output 147.168749 mL/sec 3.554397 drug 008 236 Thl Heart-lung mean transit time 15.410562 sec 0.588469 drug 008 237 Dhl Heart-lung dispersion 0.584072 0.008944 drug 008 238 To Organs blood mean transit time 26.015468 sec 0.959448 drug 008 239 Eo Organs extraction fraction 0.115199 0.003525 drug 008 240 Toe Organs extravascular mean transit time 586.185668 sec 34.635767 drug 008 241 Eb Body extraction fraction 0.022984 0.001904 drug 008 242 H Hematocrit 0.450000 0.000000 drug 008 243 ve Liver extracellular volume fraction 0.148707 mL/cm3 0.006694 drug 008 244 Te Extracellular mean transit time 30.124195 sec 2.369210 drug 008 245 De Extracellular dispersion 0.522664 0.054349 drug 008 246 khe Hepatocellular uptake rate 0.000252 mL/sec/cm3 0.000019 drug 008 247 Th Hepatocellular mean transit time 35999.999953 sec 61907.372123 drug 008 248 Kbh Biliary tissue excretion rate 0.000028 mL/sec/cm3 0.000000 drug 008 249 Khe Hepatocellular tissue uptake rate 0.001698 mL/sec/cm3 0.000000 drug 008 250 kbh Biliary excretion rate 0.000024 mL/sec/cm3 0.000000 drug 008 251 CL Liver blood clearance 0.222325 mL/sec 0.000000 drug 008 252 BAT First bolus arrival time 70.344514 sec 0.265087 control 009 253 CO Cardiac output 159.922755 mL/sec 2.231193 control 009 254 Thl Heart-lung mean transit time 17.887290 sec 0.312131 control 009 255 Dhl Heart-lung dispersion 0.408545 0.009933 control 009 256 To Organs blood mean transit time 34.371260 sec 1.174996 control 009 257 Eo Organs extraction fraction 0.131680 0.004127 control 009 258 Toe Organs extravascular mean transit time 620.702764 sec 38.222715 control 009 259 Eb Body extraction fraction 0.062044 0.002376 control 009 260 H Hematocrit 0.450000 0.000000 control 009 261 ve Liver extracellular volume fraction 0.121541 mL/cm3 0.016916 control 009 262 Te Extracellular mean transit time 29.466585 sec 5.359085 control 009 263 De Extracellular dispersion 0.675066 0.082066 control 009 264 khe Hepatocellular uptake rate 0.003588 mL/sec/cm3 0.000059 control 009 265 Th Hepatocellular mean transit time 2039.027123 sec 55.696516 control 009 266 Kbh Biliary tissue excretion rate 0.000490 mL/sec/cm3 0.000000 control 009 267 Khe Hepatocellular tissue uptake rate 0.029517 mL/sec/cm3 0.000000 control 009 268 kbh Biliary excretion rate 0.000431 mL/sec/cm3 0.000000 control 009 269 CL Liver blood clearance 4.255235 mL/sec 0.000000 control 009 270 BAT First bolus arrival time 76.322055 sec 0.426633 drug 009 271 CO Cardiac output 139.543529 mL/sec 1.883905 drug 009 272 Thl Heart-lung mean transit time 16.915331 sec 0.500800 drug 009 273 Dhl Heart-lung dispersion 0.607069 0.017703 drug 009 274 To Organs blood mean transit time 57.583549 sec 1.683468 drug 009 275 Eo Organs extraction fraction 0.119363 0.003399 drug 009 276 Toe Organs extravascular mean transit time 798.175038 sec 76.198181 drug 009 277 Eb Body extraction fraction 0.022232 0.003308 drug 009 278 H Hematocrit 0.450000 0.000000 drug 009 279 ve Liver extracellular volume fraction 0.192643 mL/cm3 0.007986 drug 009 280 Te Extracellular mean transit time 60.000000 sec 4.364793 drug 009 281 De Extracellular dispersion 0.699179 0.033381 drug 009 282 khe Hepatocellular uptake rate 0.000211 mL/sec/cm3 0.000029 drug 009 283 Th Hepatocellular mean transit time 2882.496628 sec 886.689694 drug 009 284 Kbh Biliary tissue excretion rate 0.000347 mL/sec/cm3 0.000000 drug 009 285 Khe Hepatocellular tissue uptake rate 0.001096 mL/sec/cm3 0.000000 drug 009 286 kbh Biliary excretion rate 0.000280 mL/sec/cm3 0.000000 drug 009 287 CL Liver blood clearance 0.253412 mL/sec 0.000000 drug 009 288 BAT First bolus arrival time 74.565277 sec 1.437076 control 010 289 CO Cardiac output 103.386377 mL/sec 3.421521 control 010 290 Thl Heart-lung mean transit time 13.024431 sec 1.677138 control 010 291 Dhl Heart-lung dispersion 0.446945 0.030309 control 010 292 To Organs blood mean transit time 45.480731 sec 1.459398 control 010 293 Eo Organs extraction fraction 0.142350 0.004558 control 010 294 Toe Organs extravascular mean transit time 797.190744 sec 62.012796 control 010 295 Eb Body extraction fraction 0.037411 0.004556 control 010 296 H Hematocrit 0.450000 0.000000 control 010 297 ve Liver extracellular volume fraction 0.102044 mL/cm3 0.252114 control 010 298 Te Extracellular mean transit time 59.928810 sec 115.318218 control 010 299 De Extracellular dispersion 0.841621 0.292852 control 010 300 khe Hepatocellular uptake rate 0.004001 mL/sec/cm3 0.000199 control 010 301 Th Hepatocellular mean transit time 2115.446637 sec 64.092882 control 010 302 Kbh Biliary tissue excretion rate 0.000473 mL/sec/cm3 0.000000 control 010 303 Khe Hepatocellular tissue uptake rate 0.039212 mL/sec/cm3 0.000000 control 010 304 kbh Biliary excretion rate 0.000424 mL/sec/cm3 0.000000 control 010 305 CL Liver blood clearance 4.305013 mL/sec 0.000000 control 010 306 BAT First bolus arrival time 80.051045 sec 1.494977 drug 010 307 CO Cardiac output 111.697940 mL/sec 3.001406 drug 010 308 Thl Heart-lung mean transit time 20.217266 sec 1.840148 drug 010 309 Dhl Heart-lung dispersion 0.553789 0.033845 drug 010 310 To Organs blood mean transit time 40.765224 sec 1.651711 drug 010 311 Eo Organs extraction fraction 0.159711 0.004830 drug 010 312 Toe Organs extravascular mean transit time 751.738132 sec 59.527535 drug 010 313 Eb Body extraction fraction 0.027082 0.004100 drug 010 314 H Hematocrit 0.450000 0.000000 drug 010 315 ve Liver extracellular volume fraction 0.208822 mL/cm3 0.010247 drug 010 316 Te Extracellular mean transit time 53.835314 sec 4.452070 drug 010 317 De Extracellular dispersion 0.628706 0.044518 drug 010 318 khe Hepatocellular uptake rate 0.000237 mL/sec/cm3 0.000034 drug 010 319 Th Hepatocellular mean transit time 4999.281903 sec 2486.109696 drug 010 320 Kbh Biliary tissue excretion rate 0.000200 mL/sec/cm3 0.000000 drug 010 321 Khe Hepatocellular tissue uptake rate 0.001133 mL/sec/cm3 0.000000 drug 010 322 kbh Biliary excretion rate 0.000158 mL/sec/cm3 0.000000 drug 010 323 CL Liver blood clearance 0.262413 mL/sec 0.000000 drug 010 .. GENERATED FROM PYTHON SOURCE LINES 169-174 Plot individual results ----------------------- Now lets visualise the main results from the study by plotting the drug effect for all volunteers, and for both biomarkers: uptake rate ``khe`` and excretion rate ``kbh``: .. GENERATED FROM PYTHON SOURCE LINES 174-214 .. code-block:: Python # Set up the figure clr = ['tab:blue', 'tab:orange', 'tab:green', 'tab:red', 'tab:purple', 'tab:brown', 'tab:pink', 'tab:gray', 'tab:olive', 'tab:cyan'] fs = 10 fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(8,3)) fig.subplots_adjust(wspace=0.5) ax1.set_title('Hepatocellular uptake rate', fontsize=fs, pad=10) ax1.set_ylabel('khe (mL/min/100mL)', fontsize=fs) ax1.set_ylim(0, 60) ax1.tick_params(axis='x', labelsize=fs) ax1.tick_params(axis='y', labelsize=fs) ax2.set_title('Biliary excretion rate', fontsize=fs, pad=10) ax2.set_ylabel('kbh (mL/min/100mL)', fontsize=fs) ax2.set_ylim(0, 6) ax2.tick_params(axis='x', labelsize=fs) ax2.tick_params(axis='y', labelsize=fs) # Pivot data for both visits to wide format for easy access: v1 = pd.pivot_table(results[results.visit=='control'], values='value', columns='parameter', index='subject') v2 = pd.pivot_table(results[results.visit=='drug'], values='value', columns='parameter', index='subject') # Plot the rate constants in units of mL/min/100mL for s in v1.index: x = ['baseline'] khe = [6000*v1.at[s,'khe']] kbh = [6000*v1.at[s,'kbh']] if s in v2.index: x += ['rifampicin'] khe += [6000*v2.at[s,'khe']] kbh += [6000*v2.at[s,'kbh']] color = clr[int(s)-1] ax1.plot(x, khe, '-', label=s, marker='o', markersize=6, color=color) ax2.plot(x, kbh, '-', label=s, marker='o', markersize=6, color=color) plt.show() # Choose the last image as a thumbnail for the gallery # sphinx_gallery_thumbnail_number = -1 .. image-sg:: /examples/liver/images/sphx_glr_plot_tristan_volunteers_002.png :alt: Hepatocellular uptake rate, Biliary excretion rate :srcset: /examples/liver/images/sphx_glr_plot_tristan_volunteers_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (5 minutes 49.959 seconds) .. _sphx_glr_download_examples_liver_plot_tristan_volunteers.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_tristan_volunteers.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_tristan_volunteers.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_tristan_volunteers.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_