WOLFRAM

Visualizing Anatomy

Brain image

In Mathematica 10, we introduced support for anatomical structures in EntityValue, which included, among many other things, a “Graphics3D” property that returns a 3D model of the anatomical structure in question. We also styled the models and aligned them with the concepts in the Unified Medical Language System (UMLS).

EntityValue[{Entity["AnatomicalStructure", "LeftFemur"],    Entity["AnatomicalStructure", "LeftHand"]}, "Graphics3D"]

The output is a standard Graphics3D expression, but it contains metadata in the form of an Annotation that allows for additional exploration.

Head[Entity["AnatomicalStructure", "LeftThumb"]["Graphics3D"]]

This means each model knows what lower-level structures it’s made of.

Hip Bone and Structure Below

Computation versus Appearance

I should note that the models being used are not just eye candy. If that were the intent, we might explore low polygon count models and use textures for a more realistic appearance. But these models are not just good for looking at—you can also use them for computation. For meaningful results, you need accurate models, which may be large, so you may need to be patient when downloading and/or rendering them. Keep in mind that some entities, like the brain, have lots of internal structures. So the model may be larger than you expect, although you may not see this internal structure from the outside.

One example of using these models for computation would be calculating the eigenfrequencies of an air-filled transverse colon (let the jokes fly). Finite element mesh (FEM) calculations are common in medical research today. By retrieving the mesh from AnatomyData, we can perform computations on the model.

ev1 = AnatomyData[Entity["AnatomicalStructure", "TransverseColon"],    "MeshRegion"]

bev = BoundaryMeshRegion[MeshCoordinates[ev1], MeshCells[ev1, 2]];

nde = NDEigenvalues[{-Laplacian[u[x, y, z], {x, y, z}],      DirichletCondition[u[x, y, z] == 0, True]},     u, {x, y, z} \[Element] bev, 20];

Now we can obtain the resonant frequencies of the transverse colon.

freqs = Sqrt[    nde] QuantityMagnitude[     UnitConvert[ThermodynamicData[

You can use Sound to listen to the resonant frequencies of the transverse colon.


We can find the surface area of the model by directly operating on the MeshRegion. Units are in square millimeters.

Area[ev1]

To compute the volume, we need to convert the MeshRegion into a BoundaryMeshRegion first. Units are in cubic millimeters.

Volume[BoundaryMeshRegion[MeshCoordinates[ev1], MeshCells[ev1, 2]]]

You can even compute the distance between the transverse colon and the region centroid of the large intestine. Units are in millimeters.

RegionDistance[ev1,   AnatomyData[Entity["AnatomicalStructure", "LargeIntestine"],    "RegionCentroid"]]

Lower-resolution models will give lower-quality results.

Structure and Style

To make it easy to render anatomical structures, we introduced AnatomyPlot3D.

AnatomyPlot3D[{Entity["AnatomicalStructure", "LeftFemur"]}]

AnatomyPlot3D allows directives to modify its “primitives,” similar in syntax to Graphics3D.

The output of AnatomyPlot3D doesn’t contain the original Entity objects. They get resolved at evaluation time to 3D graphics primitives, and the normal rules of the graphics language apply to them. The output of AnatomyPlot3D is a Graphics3D object.

AnatomyPlot3D[{RGBColor[0.56, 0, 0],    Entity["AnatomicalStructure", "LeftFemur"], RGBColor[   0.45, 0.58, 0.7000000000000001],    Entity["AnatomicalStructure", "RightFemur"], {RGBColor[    1, 0.81, 0.49], Entity["AnatomicalStructure", "HipBone"]},    Entity["AnatomicalStructure", "Sacrum"]}]

Head[%]

Because AnatomyPlot3D can be thought of as an extension to the Graphics3D language, you can mix anatomical structures with normal Graphics3D primitives.

AnatomyPlot3D[{Entity["AnatomicalStructure", "LeftFemur"],    Cuboid[{200, -44, 550}, {222, 44, 575}]}, Boxed -> True,   Axes -> True]

In AnatomyPlot3D, the Graphics3D language has been extended at multiple levels to make use of anatomical structures. Within AnatomyPlot3D, anatomical entities work just like graphics primitives do in Graphics3D. But they can also be used in place of coordinates in Graphics3D primitives like Point and Line. In that context, the entity represents the region centroid of the structure. This allows you, for example, to draw a line from one entity to another.

AnatomyPlot3D[{Entity["AnatomicalStructure", "LeftHand"],    Entity["AnatomicalStructure", "RightHand"], Thick, Red,    Line[{Entity["AnatomicalStructure", "LeftHand"],      Entity["AnatomicalStructure", "RightHand"]}]}]

This concept can be applied to annotate a 3D model using arrows and labels.

AnatomyPlot3D[{Entity["AnatomicalStructure", "SkeletonOfRightHand"],    Red, Arrow[{{-175, -130, 758},      Entity["AnatomicalStructure", "RightFifthMetacarpalBone"]}, 5],    Text["5th metacarpal", {-175, -130, 758}, {0, -1}]}]

You can refer to the subparts of structures and apply styles to them using AnatomyForm. It applies only to anatomical structures (not Graphics3D primitives) and supports a couple of different forms. The following example behaves similar to a standalone directive, except that it applies only to the anatomical structure, not the Cuboid.

AnatomyPlot3D[{AnatomyForm[EdgeForm[ RGBColor[0.42, 0.52, 1]]], Entity["AnatomicalStructure", "LeftFemur"],    Cuboid[{200, -44, 550}, {222, 44, 575}]}, Boxed -> True,   Axes -> True]

A more useful form can be used to style subparts.

AnatomyPlot3D[{AnatomyForm[<|     Entity["AnatomicalStructure", "SetOfBones"] -> RGBColor[      0.45, 0.55, 1],      Entity["AnatomicalStructure", "Muscle"] -> RGBColor[      0.93, 0.7000000000000001, 0.4]|>],    Entity["AnatomicalStructure", "LeftHand"]}]

AnatomyForm works by allowing you to associate specified directives with specified entities that may or may not exist in the structure you are visualizing. Any Directive supported by Graphics3D is supported, including Lighting, Opacity, EdgeForm, FaceForm, ClipPlanes and any combination thereof. In addition to supporting styles for specific entities, AnatomyForm also supports a default case via the use of an underscore. The following example shows the left humerus in red and everything else transparent and backlit, giving an X-ray-like appearance.

reverselights =    Join[{{"Ambient", Black}},     Table[{"Directional", Hue[.58, .5, 1],       ImageScaled[{Sin[x], Cos[x], -.5}]}, {x, 0, 2 Pi - 2 Pi/8,       2 Pi/8}]];

AnatomyPlot3D[{AnatomyForm[<|_ ->       Directive[Specularity[White, 50], Hue[.58, 0, 1, .1],        Lighting -> reverselights],      Entity["AnatomicalStructure", "LeftHumerus"] -> Red|>],    Entity["AnatomicalStructure", "LeftArm"]},   Background -> Hue[.58, 1, .3], SphericalRegion -> True]

PlotRange can make use of entities to constrain what would otherwise include all of the referenced entities. The following example includes several bones of the left lower limb, but the PlotRange is centered on the left patella and padded out from there by a fixed amount.

AnatomyPlot3D[{Entity["AnatomicalStructure", "LeftFemur"],    Entity["AnatomicalStructure", "LeftTibia"],    Entity["AnatomicalStructure", "LeftFibula"],    Entity["AnatomicalStructure", "LeftPatella"]},   PlotRange -> Entity["AnatomicalStructure", "LeftPatella"],   PlotRangePadding -> 50]

SkinStyle is a convenient way to include any enclosing skin that can be found around the specified entities.

AnatomyPlot3D[{Entity["AnatomicalStructure", "RightHand"]},   SkinStyle -> Automatic]

The default styling can be overridden.

AnatomyPlot3D[{Entity["AnatomicalStructure", "RightHand"]},   SkinStyle -> Directive[RGBColor[0.39, 0.58, 1], Opacity[.3]]]

You can use ClipPlanes to peel away layers of skin.

With[{z = 1000},   AnatomyPlot3D[{Entity["AnatomicalStructure", "LeftUpperLimb"],     ClipPlanes -> {InfinitePlane[{{0, -300, z}, {300, -300,          z + 200}, {200, 0, z}}]},     Entity["AnatomicalStructure", "SkinOfLeftUpperLimb"]}]]

Use multiple clip planes to peel away successive anatomical layers.

AnatomyPlot3D[{AnatomyForm[    Association[     Entity["AnatomicalStructure", "Muscle"] ->       Directive[RGBColor[0.43, 0.65, 1],        ClipPlanes -> {InfinitePlane[{{0, -100, 850}, {300, 0,             1050}, {0, 0, 850}}]}],      Entity["AnatomicalStructure", "Skin"] ->       Directive[RGBColor[0.43, 0.6900000000000001, 0.32],        ClipPlanes -> {InfinitePlane[{{0, -200, 1050}, {300, 0,             1250}, {0, 0, 1050}}]}],      Entity["AnatomicalStructure", "SetOfBones"] -> RGBColor[      0.9, 0.64, 0.47000000000000003`], All -> Transparent]],    Entity["AnatomicalStructure", "LeftUpperLimb"],    Entity["AnatomicalStructure", "Skin"]},   PlotRange -> {{0, 400}, {-300, 100}, {650, 1375}},   Background -> Hue[.58, 1, .3]]

Apply geometric transformations to anatomical structures to rotate them. The following example includes many bones in the skull, but applies a rotation to just the elements of the lower jaw around the temporomandibular joint.

Grid[{Table[    AnatomyPlot3D[{Entity["AnatomicalStructure", "Neurocranium"],       Entity["AnatomicalStructure", "ZygomaticBone"],       Entity["AnatomicalStructure", "SphenoidBone"],       Entity["AnatomicalStructure", "NasalBone"],       Entity["AnatomicalStructure", "Maxilla"],       Entity["AnatomicalStructure", "MaxillaryDentition"],       Rotate[{Entity["AnatomicalStructure", "Mandible"],         Entity["AnatomicalStructure", "MandibularDentition"]},        t Degree, {1, 0, 0},        Entity["AnatomicalStructure", "TemporomandibularJoint"]]},      SphericalRegion -> True,      PlotRange -> Entity["AnatomicalStructure", "Skull"],      PlotRangePadding -> 20], {t, {0, 10, 20}}]}]

A mix of styles can be useful for highlighting different tissue types in the head.

AnatomyPlot3D[{{ClipPlanes -> {InfinitePlane[{{-50, -146,          1500}, {-20, -146 - 20, 1550}, {-50, -146 - 20, 1500}}],       InfinitePlane[{{-50, -146, 1550}, {-20, -146 - 20,          1550}, {-50, -146 - 20, 1550}}]},     Entity["AnatomicalStructure", "Skull"]},    Entity["AnatomicalStructure", "Eye"],    Entity["AnatomicalStructure", "Brain"],    Directive[Specularity[White, 50], Hue[.58, 0, 1, .1],     Lighting ->      Join[{{"Ambient", Black}},       Table[{"Directional", Hue[.58, .5, 1],         ImageScaled[{Sin[x], Cos[x], -.5}]}, {x, 0, 2 Pi - 2 Pi/8,         2 Pi/8}]]], Entity["AnatomicalStructure", "Nose"],    Entity["AnatomicalStructure", "Neck"],    Entity["AnatomicalStructure", "SkinOfHead"],    Entity["AnatomicalStructure", "SkinOfNeck"],    Entity["AnatomicalStructure", "Lip"],    Entity["AnatomicalStructure", "Ear"]},   PlotRange -> Entity["AnatomicalStructure", "Head"],   PlotRangePadding -> 10, Background -> Hue[.58, 1, .3],   SphericalRegion -> True, ViewAngle -> Pi/5, ImageSize -> 600,   ViewPoint -> {-1.4, -1.29, 0.07}, ViewVertical -> {0.16, -0.08, 1.}]

A similar approach can be used in the torso for different organs.

reverselights =    Join[{{"Ambient", Black}},     Table[{"Directional", Hue[.58, .5, 1],       ImageScaled[{Sin[x], Cos[x], -.5}]}, {x, 0, 2 Pi - 2 Pi/8,       2 Pi/8}]];

reverselights2 =    Join[{{"Ambient", GrayLevel[.3]}},     Table[{"Directional", Yellow,       ImageScaled[{Sin[x], Cos[x], -.5}]}, {x, 0, 2 Pi - 2 Pi/8,       2 Pi/8}]];

AnatomyPlot3D[{Entity["AnatomicalStructure", "RibCage"],    Entity["AnatomicalStructure", "Esophagus"],    Entity["AnatomicalStructure", "Stomach"],    Entity["AnatomicalStructure", "SmallIntestine"],    Entity["AnatomicalStructure", "LargeIntestine"],    Entity["AnatomicalStructure", "Spleen"],    Entity["AnatomicalStructure", "Liver"],    Entity["AnatomicalStructure", "Lung"],    Entity["AnatomicalStructure", "Heart"],    Entity["AnatomicalStructure", "Kidney"],    Entity["AnatomicalStructure",     "UrinaryBladder"], {Directive[Specularity[White, 50],      Hue[.58, 0, 1, .1], Lighting -> reverselights],     Entity["AnatomicalStructure", "MusculatureOfTrunk"],     Entity["AnatomicalStructure", "MusculatureOfPectoralGirdle"],     Entity["AnatomicalStructure", "PectoralisMajor"]}},   Background -> Hue[.58, 1, .3], SphericalRegion -> True,   ViewAngle -> Pi/10, ImageSize -> 600,   BaseStyle -> {RenderingOptions -> {"DepthPeelingLayers" -> 20}}]

Here is an advanced example showing the use of ClipPlanes to remove muscles below a specific cutting plane.

reverselights =    Join[{{"Ambient", Black}},     Table[{"Directional", Hue[.58, .5, 1],       ImageScaled[{Sin[x], Cos[x], -.5}]}, {x, 0, 2 Pi - 2 Pi/8,       2 Pi/8}]];

With[{z = 1100},  AnatomyPlot3D[{    {ClipPlanes -> {InfinitePlane[{{0, -100, z}, {0, 0, z}, {300, 0,           z}}]}, AnatomyForm[<|       Entity["AnatomicalStructure", "Muscle"] ->         Directive[Specularity[White, 50], Hue[.58, 0, 1, .1],          Lighting -> reverselights]|>],      Entity["AnatomicalStructure", "LeftUpperLimb"]},    {ClipPlanes -> {InfinitePlane[{{0, -100, z}, {300, 0, z}, {0, 0,           z}}]}, Entity["AnatomicalStructure", "LeftUpperLimb"]}    }, Background -> Hue[.58, 1, .3], ImageSize -> {400, 700},    SphericalRegion -> True, ViewAngle -> Pi/10]]

Inner structures can be differentiated using styles, in this case within the brain.

reverselights =    Join[{{"Ambient", Black}},     Table[{"Directional", Hue[.58, .5, 1],       ImageScaled[{Sin[x], Cos[x], -.5}]}, {x, 0, 2 Pi - 2 Pi/8,       2 Pi/8}]];

reverselights2 =    Join[{{"Ambient", GrayLevel[.3]}},     Table[{"Directional", Yellow,       ImageScaled[{Sin[x], Cos[x], -.5}]}, {x, 0, 2 Pi - 2 Pi/8,       2 Pi/8}]];

With[{style =     Directive[Specularity[White, 50], Red,      Lighting -> reverselights2]},   AnatomyPlot3D[{AnatomyForm[<|      Entity["AnatomicalStructure", "Brainstem"] -> style,       Entity["AnatomicalStructure", "Hypothalamus"] -> style,       Entity["AnatomicalStructure", "Thalamus"] -> style,       Entity["AnatomicalStructure", "LateralVentricle"] -> style,       Entity["AnatomicalStructure", "ThirdVentricle"] -> style,       Entity["AnatomicalStructure", "FourthVentricle"] -> style,       Entity["AnatomicalStructure", "LateralGeniculateBody"] -> style,       Entity["AnatomicalStructure", "MedialGeniculateBody"] ->        style, _ ->        Directive[Specularity[White, 50], Hue[.58, 0, 1, .1],         Lighting -> reverselights]|>],     Entity["AnatomicalStructure", "Brain"]},    Background -> Hue[.58, 1, .3], ImageSize -> 600,    SphericalRegion -> True, ViewAngle -> Pi/6,    ViewPoint -> {-1.4, -1.29, 0.07}, ViewVertical -> {0.16, -0.08, 1.},    BaseStyle -> {RenderingOptions -> {"DepthPeelingLayers" -> 20}}]]

Here are links to some animations rendered using AnatomyPlot3D:

Mandible Opening and Closing

Rotating Head

Rotating Brain

Rotating Torso

Erasing Muscles in Arm

Scaling Transform Applied to the Bones of the Skull

As time goes on, we will continue to add additional models and tools allowing you to explore human anatomy more deeply.

To download this post as a CDF, click here. New to CDF? Get your copy for free with this one-time download.

Comments

Join the discussion

!Please enter your comment (at least 5 characters).

!Please enter your name.

!Please enter a valid email address.

2 comments

  1. There are definitely muscles in the hand. The abductor digiti minimi muscle is located on the medial side of the hand. That muscle is the distal endpoint of the Deep Back Arm Line (DBAL), a line starting in the upper back and responsible for outward rotation of the arm and hand. You can identify this muscle when you execute a Vulcan “live long and prosper!” salute and feel along the side of your hand. There’s a good Wikipedia article on this muscle as well as a summary article “muscles of the hand”. I had learned about the abductor digiti minimi muscles when I started exercising my arm rotators and that tiny muscle was noticeably sore.

    You are right: the vast majority of the muscles for flexing and extending our fingers are located far up the arm. Tension-transmitters (i.e., tendons and ligaments) are cheap and have a small diameter; tension-adjustors (i.e., muscles) are expensive and have a far greater diameter. By having our finger’s function controlled by distant muscles, we’re able to use our hands for both high strength and precise manipulations. In “The Mote in God’s Eye”, Niven and Pournelle, created aliens with two tool-manipulating hands and one club-like hand. I don’t think they realized the trick that nature pulled off in multi-purpose human hands. OTOH, our carpal tunnel is a very busy place; inflammation of this tendon-channel can be debilitating.

    Reply