Biomedical Image Analysis in Python
Stephen Bailey
Instructor
$$ Ejection\ Fraction = \frac{LV_{max} - LV_{min}}{LV_{max}} $$
Procedure
# Stored in (t,z,x,y) format
vol_ts.shape
labels.shape
(20, 12, 256, 256)
(20, 12, 256, 256)
# Calculate voxel volume in mm^3 d0,d1,d2,d3=vol_ts.meta['sampling'] dvoxel = d1 * d2 * d3
# Instantiate empty list ts = np.zeros(20)
# Loop through volume time series for t in range(20):
nvoxels=ndi.sum(1, labels[t], index=1)
ts[t] = nvoxels * dvoxel
plt.plot(ts) plt.show()
min_vol = ts.min() max_vol = ts.max()
ejec_frac = (max_vol - min_vol) / max_vol
ejec_frac
0.58672
Biomedical Image Analysis in Python