OpenAnatomy's reference .dicom. Visualisation of the whole project

If the input is a high-resolution image then 99% mesh reduction is not necessarily too much. Even with a basic method like VTK’s decimation, 90% reduction often does not result in visible difference in the mesh. If a more sophisticated method is used then 99% reduction may be achievable without any significant loss of detail.

This seems like a very nice database. I’ve checked out the “partof” model, containing 1258 structures and wrote a short script to create subject hierarchy folders from the relation list text file.

Script for creating subject hierarchy from relation list
shNode = slicer.mrmlScene.GetSubjectHierarchyNode()
sceneItemID = shNode.GetSceneItemID()

def getItemParentsFmaIds(shNode, itemShItemId):
    existingParentShItemId = shNode.GetItemParent(itemShItemId)
    existingParentFmaIds = []
    while existingParentShItemId != sceneItemID:
        existingParentFmaIds.append(shNode.GetItemUID(existingParentShItemId, "FMA"))
        existingParentShItemId = shNode.GetItemParent(existingParentShItemId)
    return existingParentFmaIds

# Create partof hierarchy
inclusionListTable = getNode('partof_inclusion_relation_list').GetTable()
parentIdArray = inclusionListTable.GetColumnByName('parent id')
parentNameArray = inclusionListTable.GetColumnByName('parent name')
childIdArray = inclusionListTable.GetColumnByName('child id')
childNameArray = inclusionListTable.GetColumnByName('child name')
for i in range(inclusionListTable.GetNumberOfRows()):
    parentFmaId = parentIdArray.GetValue(i)
    parentShItemId = shNode.GetItemByUID("FMA", parentFmaId)
    if not parentShItemId:
        parentShItemId = shNode.CreateFolderItem(sceneItemID, parentNameArray.GetValue(i))
        shNode.SetItemUID(parentShItemId, "FMA", parentFmaId)
    childFmaId = childIdArray.GetValue(i)
    childShItemId = shNode.GetItemByUID("FMA", childFmaId)
    if not childShItemId:
        childShItemId = shNode.CreateFolderItem(sceneItemID, childNameArray.GetValue(i))
        shNode.SetItemUID(childShItemId, "FMA", childFmaId)
    existingParentFmaIds = getItemParentsFmaIds(shNode, childShItemId)
    if parentFmaId in existingParentFmaIds:
        # this parent is already a parent of the current item
        continue
    shNode.SetItemParent(childShItemId,parentShItemId)

# Update part list with names and FMA IDs
partsListTable = getNode('partof_element_parts').GetTable()
fmaIdArray = partsListTable.GetColumnByName('concept id')
filenameArray = partsListTable.GetColumnByName('element file id')
for i in range(partsListTable.GetNumberOfRows()):
    partNode = slicer.mrmlScene.GetFirstNodeByName(filenameArray.GetValue(i))
    if not partNode:
      continue
    parentFmaId = fmaIdArray.GetValue(i)
    parentShItemId = shNode.GetItemByUID("FMA", parentFmaId)
    if not parentShItemId:
        # this hierarchy is not found in the SH tree
        continue
    itemShItemId = shNode.GetItemByDataNode(partNode)
    existingParentFmaIds = getItemParentsFmaIds(shNode, itemShItemId)
    newParentFmaIds = getItemParentsFmaIds(shNode, parentShItemId)
    if len(newParentFmaIds)>len(existingParentFmaIds):
        # New parent is more specific than the current (parent has more nesting levels)
        shNode.SetItemParent(itemShItemId, parentShItemId)

The resulting scene can be downloaded from here (compatible with Slicer-4.11.x, revision r28625 or later).

image

Unfortunately, the same model is usually listed in multiple branches of the hierarchy, and in the subject hierarchy tree a node can be only listed once, so structures are often “missing” from where you would expect to find it. For example, skin is listed in both human body/integumentary system and in human body/integument/skin, but in the subject hierarchy tree it can be only listed in one branch, so it appears only in human body/integument/skin. Due to this, probably the scene is not very useful as is, but may serve as an example of how to import hierarchical anatomical atlases into Slicer.

2 Likes