Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Left atria PV annulus changes #133

Merged
merged 10 commits into from
May 6, 2021
7 changes: 5 additions & 2 deletions src/scaffoldmaker/annotation/heart_terms.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# convention: preferred name, preferred id, followed by any other ids and alternative names
heart_terms = [
( "heart", "FMA:7088", "UBERON:0000948" ),
( "heart", "UBERON:0000948", "FMA:7088" ),
# ventricles
( "left ventricle myocardium", "FMA:9558" ),
( "right ventricle myocardium", "FMA:9535" ),
Expand Down Expand Up @@ -52,7 +52,10 @@
( "anterior cusp of pulmonary valve", "FMA:7249" ),
( "left cusp of pulmonary valve", "FMA:7247" ),
# future: fiducial markers
( "apex of heart", "FMA:7164", "UBERON:0002098")
( "apex of heart", "UBERON:0002098", "FMA:7164"),
( "crux of heart", "ILX:0777104", "FMA:7220" ),
( "left atrium epicardium venous midpoint", "None"), # point at centre of pulmonary vein ostia on left atrium epicardium, on anterior/ventral side for rodents
( "right atrium epicardium venous midpoint", "None") # point at centre of inferior & superior vena cavae on right atrium epicardium
]

def get_heart_term(name : str):
Expand Down
23 changes: 15 additions & 8 deletions src/scaffoldmaker/meshtypes/meshtype_3d_heart1.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,19 @@ def getOrderedOptionNames():
optionNames = MeshType_3d_heartventriclesbase1.getOrderedOptionNames()
optionNamesAtria = MeshType_3d_heartatria1.getOrderedOptionNames()
# insert new numbers of elements from atria; others came with ventriclesbase1
optionNames.insert(7, 'Number of elements along vena cava inlet')
optionNames.insert(8, 'Number of elements over atria')
optionNames.insert(7, 'Number of elements along atrial appendages')
optionNames.insert(8, 'Number of elements along vena cava inlet')
optionNames.insert(9, 'Number of elements over atria')
optionNames.insert(10, 'Number of elements radial pulmonary vein annuli')
# remove number of elements, unit scale and dependent options from atria options
for key in [
'Number of elements along atrial appendages',
'Number of elements along vena cava inlet',
'Number of elements around atrial septum',
'Number of elements around left atrium free wall',
'Number of elements around right atrium free wall',
'Number of elements over atria',
'Number of elements radial pulmonary vein annuli',
'Unit scale',
'Aorta outer plus diameter']:
optionNamesAtria.remove(key)
Expand Down Expand Up @@ -133,6 +137,8 @@ def generateBaseMesh(cls, region, options):
ventriclesAnnotationGroups = MeshType_3d_heartventriclesbase1.generateBaseMesh(region, options)
atriaAnnotationGroups = MeshType_3d_heartatria1.generateBaseMesh(region, options)
annotationGroups = mergeAnnotationGroups(ventriclesAnnotationGroups, atriaAnnotationGroups)
heartGroup = findOrCreateAnnotationGroupForTerm(annotationGroups, region, get_heart_term("heart"))
cruxGroup = findOrCreateAnnotationGroupForTerm(annotationGroups, region, get_heart_term("crux of heart"))
lFibrousRingGroup = findOrCreateAnnotationGroupForTerm(annotationGroups, region, get_heart_term("left fibrous ring"))
rFibrousRingGroup = findOrCreateAnnotationGroupForTerm(annotationGroups, region, get_heart_term("right fibrous ring"))

Expand Down Expand Up @@ -211,6 +217,7 @@ def generateBaseMesh(cls, region, options):
# Create elements
#################

heartMeshGroup = heartGroup.getMeshGroup(mesh)
lFibrousRingMeshGroup = lFibrousRingGroup.getMeshGroup(mesh)
rFibrousRingMeshGroup = rFibrousRingGroup.getMeshGroup(mesh)

Expand All @@ -233,7 +240,7 @@ def generateBaseMesh(cls, region, options):
lavNodeId[0][0][n1], lavNodeId[0][0][n1 + 1], lavNodeId[0][1][n1], lavNodeId[0][1][n1 + 1],
lavNodeId[1][0][n1], lavNodeId[1][0][n1 + 1], lavNodeId[1][1][n1], lavNodeId[1][1][n1 + 1]]
scalefactors = None
meshGroups = [ lFibrousRingMeshGroup ]
meshGroups = [ heartMeshGroup, lFibrousRingMeshGroup ]

if e == -1:
# interatrial groove straddles left and right atria, collapsed to 6 node wedge
Expand Down Expand Up @@ -295,7 +302,7 @@ def generateBaseMesh(cls, region, options):
ravNodeId[0][0][n1], ravNodeId[0][0][n1 + 1], ravNodeId[0][1][n1], ravNodeId[0][1][n1 + 1],
ravNodeId[1][0][n1], ravNodeId[1][0][n1 + 1], ravNodeId[1][1][n1], ravNodeId[1][1][n1 + 1]]
scalefactors = None
meshGroups = [ rFibrousRingMeshGroup ]
meshGroups = [ heartMeshGroup, rFibrousRingMeshGroup ]

if e == -1:
# interatrial groove straddles left and right atria, collapsed to 6 node wedge
Expand Down Expand Up @@ -350,7 +357,7 @@ def generateBaseMesh(cls, region, options):
meshGroup.addElement(element)

# fibrous ring septum:
meshGroups = [ lFibrousRingMeshGroup, rFibrousRingMeshGroup ]
meshGroups = [ heartMeshGroup, lFibrousRingMeshGroup, rFibrousRingMeshGroup ]
for e in range(elementsCountAroundAtrialSeptum):
eft1 = eftFibrousRing
nlm = e - elementsCountAroundAtrialSeptum
Expand Down Expand Up @@ -391,13 +398,13 @@ def generateBaseMesh(cls, region, options):
# annotation fiducial points
cruxElement = mesh.findElementByIdentifier(cruxElementId)
cruxXi = [ 0.5, 0.5, 1.0 ]
cache.setMeshLocation(cruxElement, cruxXi)
result, cruxCoordinates = coordinates.evaluateReal(cache, 3)
markerPoint = markerPoints.createNode(nodeIdentifier, markerTemplateInternal)
nodeIdentifier += 1
cache.setNode(markerPoint)
markerName.assignString(cache, "crux of heart")
markerName.assignString(cache, cruxGroup.getName())
markerLocation.assignMeshLocation(cache, cruxElement, cruxXi)
for group in [ heartGroup, cruxGroup ]:
group.getNodesetGroup(nodes).addNode(markerPoint)

return annotationGroups

Expand Down
Loading