Commit 3ffb463c authored by laura.pfeiffer's avatar laura.pfeiffer
Browse files

converted Biventricles from Tobias

parent dbc8779f
This diff is collapsed.
This diff is collapsed.
......@@ -4,7 +4,21 @@ from vtk.vtkIOXML import vtkXMLUnstructuredGridReader
from utility.geo import Geometry
def activationByPointData(geometry,point_indicies,path,filename, default_data=[-10.0, 0.0, 0.0]):
reader = vtkXMLUnstructuredGridReader()
reader.SetFileName(path + filename + ".vtu")
reader.Update()
data = reader.GetOutput()
point_data = data.GetPointData()
for pi in point_indicies:
d = point_data.GetAbstractArray(pi).GetNumberOfComponents()
data = vtk_to_numpy(point_data.GetAbstractArray(pi))
for pi,point in geometry.points.items():
if data[pi] >=0.0:
geometry.add_vdata(pi, [data[pi], 0.003, 30.0])
else:
geometry.add_vdata(pi, default_data)
def activation_ventricle(geometry, default_data=[-10.0, 0.0, 0.0]):
endocard_points = []
for fi, face in geometry.faces.items():
......@@ -347,6 +361,18 @@ def convert_T4():
geometry.fill_vdata(default_vdata)
finish(geometry)
def convertBiVentricle():
vtu = VtuGeometry("../../../IBT/A_W_BiVentricle/", "level_0", "BiVentricle")
vtu.remap({0:0})
geometry = vtu.convert(-1, -1, [], [1,2,3])
activationByPointData(geometry,[0],"../../../IBT/A_W_BiVentricle/", "level_0")
finish(geometry)
vtu = VtuGeometry("../../../IBT/A_W_BiVentricle/", "level_1", "BiVentriclefine")
vtu.remap({0:0})
geometry = vtu.convert(-1, -1, [], [1,2,3])
activationByPointData(geometry,[0],"../../../IBT/A_W_BiVentricle/", "level_1")
finish(geometry)
def convert_heart_kovacheva():
vtu = VtuGeometry("vtk/", "wholeHeartNotSmoothed", "KovachevaHeart")
mat_map = vtu.material_map
......@@ -529,8 +555,9 @@ if __name__ == "__main__":
# convert_T4()
# convert_2LayerEllipsoid()
# convert_plainEllipsoid()
convert_ellipsoid()
convert_quarter_ellipsoid()
convertBiVentricle()
#convert_ellipsoid()
#convert_quarter_ellipsoid()
# convert_ventricle()
# convert_heart_kovacheva()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment