Skip to content

Commit

Permalink
Merge branch 'dev' into 13-clarifying-environment-setup-in-readme
Browse files Browse the repository at this point in the history
Max added a new function to the dev branch, so updaing this feature branch to include that.
  • Loading branch information
LevanBokeria committed Feb 7, 2025
2 parents b193d12 + a492779 commit 6ecf4c6
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions ModularCirc/Analysis/BaseAnalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ def compute_cardiac_output(self, component:str)->float:
## Inputs
component : str
name of the component (ideally the aortic valve) for which we are computing the cardiac outpu
name of the component (ideally the aortic valve) for which we are computing the cardiac output
## Outpus
## Outputs
CO : float
the cardiac ouput value
"""
Expand All @@ -243,6 +243,25 @@ def compute_cardiac_output(self, component:str)->float:

return self.CO

def compute_ejection_fraction(self, component:str)->float:
"""
Method for estimating the cardiac output.
## Inputs
component : str
name of the component (ideally one of the ventricles) for which we are computing Ejection Fraction
## Outputs
CO : float
the ejection fraction
"""
ventricle = self.model.commponents[component]
edv = ventricle.V.values[self.tind].max()
esv = ventricle.V.values[self.tind].min()
self.EF = (edv - esv) / edv
return self.EF


def compute_artery_pressure_range(self, component:str)->tuple[float]:
"""Method for computing the range of pressures in artery
Expand Down Expand Up @@ -279,4 +298,4 @@ def compute_end_systolic_pressure(self, component:str, upstream:str):

flag = up > p
ind = np.arange(len(flag))[flag]
return p[ind[-1]]
return p[ind[-1]]

0 comments on commit 6ecf4c6

Please sign in to comment.