2

I am trying to visualise segmented anatomical models in 3D. Currently, my attemps are very basic, like the following code. What other ways could you come up with? ListSurfacePlot3D doesn't work that well. The files contain lines with the coordinates of each voxel (x,y,z).

ClearAll["Global`*"];

prop = Import[#, "Table"] & /@ {"http://leaf.dragonflybsd.org/~beket/skull.txt", 
"http://leaf.dragonflybsd.org/~beket/brainwhite.txt"};

genPoint[{x_, y_, z_}] := 
 Graphics3D[{FaceForm[Red], EdgeForm[], Lighting -> "Neutral", 
   Sphere[{x, y, z}, 1/5]}]

ParallelTable[
 Show[genPoint /@ prop[[k]], ViewPoint -> {1.3, 2.4, 2.}, ImageSize -> 300],
    {k, 1, Length@prop}]

A 3D segmented skull

anderstood
  • 14,301
  • 2
  • 29
  • 80
stathisk
  • 3,054
  • 20
  • 37
  • 1
    What is the problem with the image you show and what kind of visualisation would you expect? Are you looking for surfaces instead of points, such as joining all outer points with surfaces? – anderstood Mar 15 '17 at 16:02
  • Yes, a surface joining all outer points would be very nice. ConvexHullMesh didn't cut it for me, because I lose the information of cavities. – stathisk Mar 15 '17 at 16:02
  • 1
    I think that "finding the outer points of a list of points defining a non-convex volume" is an interesting question in itself. If that's really what you want, you should probably rephrase the question as such. In that case, somehow related questions: http://mathematica.stackexchange.com/questions/89725/how-to-find-points-along-the-inner-and-outer-edge-of-a-ring-along-a-specific-dir and http://mathematica.stackexchange.com/questions/2998/how-can-the-x-y-z-points-that-fall-on-the-outer-boundary-of-a-set-of-values-be. – anderstood Mar 15 '17 at 16:15
  • Thank you for the references @anderstood! I'll study them and come back again. – stathisk Mar 15 '17 at 16:18
  • 2
    Just a head's up, you can get decent visualizations with Entity["AnatomicalStructure", "Skull"]["MeshRegion"] and Entity["AnatomicalStructure", "Skull"]["Graphics3D"] – Jason B. Mar 15 '17 at 16:25
  • You might also check ExampleData[{"Geometry3D", "StanfordBunny"}] which provides a nice rendering or explore the documentation related to Printout3D, you might stumble upon functions to build a printable model from your list of points, and so also 3D viewing (I don't know much about MMA 3D viewing so I can't be more precise). – anderstood Mar 15 '17 at 16:26
  • See also https://reference.wolfram.com/language/ref/AnatomyPlot3D.html, if you just want to visualise anatomy. – anderstood Mar 15 '17 at 16:28
  • Thanks folks for the great references. I need to plot the data that I am given, not just built-in anatomical data (which look awesome by the way). – stathisk Mar 15 '17 at 16:32
  • @Zet - if you aren't able to make this work using RunnyKine's answer in the marked duplicate, we can reopen the question. I was able to get this result from his code using the input meshregion = alphaShapes[data3D, 2.4]; Graphics3D[ GraphicsComplex[MeshCoordinates@meshregion, MeshCells[meshregion, 2]]] – Jason B. Mar 15 '17 at 20:05

1 Answers1

0

Why not use Mathematica's curated data instead?

Entity["AnatomicalStructure","Skull"]["Graphics3D"]

enter image description here

David G. Stork
  • 41,180
  • 3
  • 34
  • 96
  • 1
    David, the OP specified that they have to plot their own data set specifically, rather than a generic one. – MarcoB Mar 15 '17 at 18:19