MorphologicalGraph[image]
gives a graph object that represents the connectivity of the morphological branch points and endpoints of the objects in image after applying morphological thinning.
MorphologicalGraph
MorphologicalGraph[image]
gives a graph object that represents the connectivity of the morphological branch points and endpoints of the objects in image after applying morphological thinning.
Details and Options
- MorphologicalGraph is an image-to-graph conversion, where branch points and end points of the image skeleton are the vertices and the connections between them are the edges.
- MorphologicalGraph creates a Graph object with undirected edges.
- MorphologicalGraph finds morphological branch points and endpoints after applying Thinning.
- For multichannel images, MorphologicalGraph operates on the intensity averaged over all channels.
- The morphological branch points and endpoints of the image skeleton are converted into vertices. The graph exhibits an undirected edge between two vertices if the corresponding branch points or endpoints are 8-connected by the skeleton.
- MorphologicalGraph takes the same options as Graph, with the following changes: [List of all options]
-
EdgeWeight Automatic smallest number of pixels connecting two vertices VertexCoordinates Automatic coordinates of vertices in the image -
AlignmentPoint Center the default point in the graphic to align with AnnotationRules {} annotations for graph, edges and vertices AspectRatio Automatic ratio of height to width Axes False whether to draw axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool DirectedEdges Automatic whether to interpret Rule as DirectedEdge EdgeLabels None labels and label placements for edges EdgeLabelStyle Automatic style to use for edge labels EdgeShapeFunction Automatic generate graphic shapes for edges EdgeStyle Automatic style used for edges EdgeWeight Automatic smallest number of pixels connecting two vertices Epilog {} primitives rendered after the main plot FormatType TraditionalForm the default format type for text Frame False whether to put a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks Automatic frame ticks FrameTicksStyle {} style specifications for frame ticks GraphHighlight {} graph elements to highlight GraphHighlightStyle Automatic style for highlight GraphLayout Automatic how to lay out vertices and edges GridLines None grid lines to draw GridLinesStyle {} style specifications for grid lines ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels etc. ImageSize Automatic the absolute size at which to render the graphic LabelStyle {} style specifications for labels Method Automatic details of graphics methods to use PerformanceGoal Automatic aspects of performance to try to optimize PlotLabel None an overall label for the plot PlotRange All range of values to include PlotRangeClipping False whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic the final display region to be filled PlotTheme $PlotTheme overall theme for the graph PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RotateLabel True whether to rotate y labels on the frame Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks VertexCoordinates Automatic coordinates of vertices in the image VertexLabels None labels and placements for vertices VertexLabelStyle Automatic style to use for vertex labels VertexShape Automatic graphic shape for vertices VertexShapeFunction Automatic generate graphic shapes for vertices VertexSize Medium size of vertices VertexStyle Automatic styles for vertices VertexWeight Automatic weights for vertices
List of all options
Examples
open all close allBasic Examples (3)
Convert an image to a graph object:
MorphologicalGraph[[image]]Graph of a structure stored in a binary image:
MorphologicalGraph[[image], VertexSize -> Medium]Conversion of a maze into a graph:
MorphologicalGraph[[image], VertexSize -> Medium]Applications (4)
Railroad tracks between Chicago and St. Louis:
i = [image];Binarize[ColorNegate[i]]MorphologicalGraph[%]Analyze the connectivity of a water drainage network:
i = [image];Extract and negate the green channel:
ColorNegate[ColorSeparate[i][[2]]]g = MorphologicalGraph[%]HighlightGraph[g, NeighborhoodGraph[g, {17}, 50]]Find the shortest path in a maze:
g = MorphologicalGraph[[image], VertexLabels -> "Name"]HighlightGraph[g, PathGraph[FindShortestPath[g, 1, 20]]]Graph of a trabecular bone structure:
i = [image];b = ColorNegate[Image[WatershedComponents[i]]]MorphologicalGraph[b]Related Guides
History
Text
Wolfram Research (2010), MorphologicalGraph, Wolfram Language function, https://reference.wolfram.com/language/ref/MorphologicalGraph.html.
CMS
Wolfram Language. 2010. "MorphologicalGraph." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MorphologicalGraph.html.
APA
Wolfram Language. (2010). MorphologicalGraph. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MorphologicalGraph.html
BibTeX
@misc{reference.wolfram_2026_morphologicalgraph, author="Wolfram Research", title="{MorphologicalGraph}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/MorphologicalGraph.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_morphologicalgraph, organization={Wolfram Research}, title={MorphologicalGraph}, year={2010}, url={https://reference.wolfram.com/language/ref/MorphologicalGraph.html}, note=[Accessed: 13-June-2026]}