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

Add bladder markers #209

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/scaffoldmaker/annotation/bladder_terms.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,17 @@
("dorsal part of serosa of neck of urinary bladder", "ILX:0739280"),
("dorsal part of serosa of urethra", "ILX:0739283"),
("dorsal part of serosa of urinary bladder", "ILX:0739248"),
("external urethral sphincter", "UBERON:0004919"), # urinary_5
("fundus of urinary bladder", "UBERON:0006082"), # urinary_3
("hypogastric nerve", "UBERON:0005303"), # "keast_5"
("left hemi-bladder", "ILX:0793661"),
("lumbar splanchnic nerve", "UBERON:0018683"), # "keast_7"
("lumen of body of urinary bladder", "ILX:0739252"),
("lumen of neck of urinary bladder", "ILX:0739256"),
("lumen of urethra", "UBERON:0010390", "ILX:0736762"),
("neck of urinary bladder", "UBERON:0001258", "FMA:15912"),
("pelvic splanchnic nerve", "UBERON:0018675"), # "keast_4"
("pudendal nerve", "UBERON:0011390"), # keast_2
("right hemi-bladder", "ILX:0793662"),
("serosa of body of urinary bladder", "ILX:0739276"),
("serosa of neck of urinary bladder", "ILX:0739277"),
Expand Down
22 changes: 21 additions & 1 deletion src/scaffoldmaker/meshtypes/meshtype_3d_bladderurethra1.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import math

from opencmiss.utils.zinc.field import findOrCreateFieldGroup, findOrCreateFieldNodeGroup, \
findOrCreateFieldStoredMeshLocation, findOrCreateFieldStoredString
findOrCreateFieldStoredMeshLocation, findOrCreateFieldStoredString, findOrCreateFieldCoordinates
from opencmiss.utils.zinc.finiteelement import getMaximumNodeIdentifier
from opencmiss.zinc.element import Element
from opencmiss.zinc.field import Field
from opencmiss.zinc.node import Node
Expand Down Expand Up @@ -1163,6 +1164,25 @@ def generateBaseMesh(cls, region, options):
bladderNodesetGroup.addNode(markerPoint)
nodeIdentifier += 1

################
# point markers
################

markerTermNameBrainstemCoordinatesMap = {
# "pudendal nerve": [0.0, 1.0, 0.0],
# "pelvic splanchnic nerve": [0.0, 1.0, 0.0],
# "hypogastric nerve": [0.0, 1.0, 0.0],
# "lumbar splanchnic nerve": [0.0, 1.0, 0.0],
"fundus of urinary bladder": [14.6, 0.01, 23.1],
"external urethral sphincter": [-1.5, 6.7, 110.5],
}
bladder_coordinates = findOrCreateFieldCoordinates(fm)
nodeIdentifier = max(1, getMaximumNodeIdentifier(nodes) + 1)
for termName, brainstemCoordinatesValues in markerTermNameBrainstemCoordinatesMap.items():
annotationGroup = findOrCreateAnnotationGroupForTerm(annotationGroups, region, get_bladder_term(termName))
annotationGroup.createMarkerNode(nodeIdentifier, bladder_coordinates, brainstemCoordinatesValues)
nodeIdentifier += 1

Comment on lines +1171 to +1185
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Firstly, this would be OK if bladder_coordinates exist, but they do not.
(And it would need to use "bladder" rather than "brainstem" so the latter word should not appear anyway.)
Currently this will only work for human and when no-one changes any central path or size parameters, since coordinates are being used as material coordinates.
We need to discuss what's best here; I think it's better to use only element & xi until actual material coordinates exist. The above code won't work for other species - the locations will be different/wrong for other species.

fm.endChange()
return annotationGroups

Expand Down