Question: I need to process a simulation that was acquired using FE Bio ( of an LV ) . Below are the directions, deliverables, and helpful

I need to process a simulation that was acquired using FE Bio (of an LV). Below are the directions, deliverables, and helpful hints. I will also attach an image of what the final graph should look like.
Import all the .csv files into MATLAB (or Python)
Identify the nodes on the periphery of the LV on the base plane to calculate the centroid.
Convert the triangle information (the node numbers) to coordinates using the position file and find the volume (for all steps) using the tetrahedron method described in class.
Extract the pressure values on the triangles associated with the LV and take the average (again, for all the steps).
Plot the Pressure (in mmHg) vs Volume (in micro Liter)
Files required: .feb (geometry), position.csv, and pressure.csv
Copy all nodes and elements from the .feb file and store them in arrays.
Nodes =[x coordinate, y coordinate, z coordinate]
Elements =[Elem_ID, Node_ID 1, Node_ID 2, Node_ID 3, Node_ID 4]
Extract nodes and faces belonging to the LV endocardium from the .feb file
i.e., the faces on which the LV pressure is applied.
Endo_Faces =[Node_ID 1, Node_ID 2, Node_ID 3]
Endo_Nodes = stack(unique(Endo_Faces))
Find corresponding elements.
for face in Endo_Faces:
if 2 or 3 Nodes of face in Elements:
Endo_Elements = stack(Elem_ID)
Endo_Elements = unique(Endo_Elements)
Extracting pressure (element data) and volume (node data) for each
time point.
pressure =[Elem_ID, t1, t2,.... tn]
position =[Node_ID, xt1, yt1, zt1, xt2, yt2, zt2,....,
xtn, ytn, ztn]
for time_point in 1= tn:
endo_pressure =[]
endo_volume =[]
for i in size(pressure,1):
if pressure(i,0) in Endo_Elements:
endo_pressure = stack(pressure,time_point)
Endo_Pressure_average = mean(endo_pressure)
for i in size(position,1):
if position(i,0) in Endo_Nodes:
endo_position = stack(x_time_point, y_time_point, z_time_point)
centroid = mean(endo_position[base nodes])
position_vector = endo_position - centroid
for face in Endo_Faces:
Tet_Volume =(1/6)*(position_vector(Node_ID 1) x position_vector(Node_ID 2)).(position_vector(Node_ID 2) x position_vector(Node_ID 3))
Tet_Volume = stack(Tet_Volume)
Endo_Volume_Total = sum(Tet_Volume)
Helpful commands
MATLAB: readmatrix, vertcat, horzcat, unique, mean, sum, cross, dot
Python: numpy.genfromtxt, numpy.vstack, numpy.hstack, numpy.sum
numpy.unique, numpy.mean, numpy.cross, numpy.dot
I need to process a simulation that was acquired

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!