Making tree-diagrams with pdf output without using graphviz - graphics

I usually like graphviz a lot for making graphs and trees and outputting them to pdf files. Right now I have a program that builds a tree with a large branching factor (up to 12, usually closer to 8 or 9). The problem is that graphviz cannot draw the tree more than two or three levels deep (and less if I use my fancy labels).
My train of thought is that this is a very simple graphic to generate. It's a very generic tree structure and no specialized placement algorithms are needed at all. I'm wondering if anybody knows of another software package that might get the job done. Here are the features I'm looking for:
Bare minimum:
Draws really wide trees with many vertices (perhaps a few million)
Outputs to pdf, postscript, svg, or some other common, portable graphics format
Good to have:
input format similar to graphviz
nodes that can be colored
html-style tables, similar to the awesome ones that graphviz has

Have you considered TikZ? http://www.texample.net/tikz/examples/tag/graphs/
I have not had to make graphs with millions of nodes, so I can't be sure this will work.

I originally suggested, in a comment, that graphviz provided facilities to produce multi-million node graphs. The rendering engine I was thinking of was sfdp, which is supplied as part of the graphviz package. An example is provided in the Graphviz gallery. As far as I am aware, this can be used with all the normal Graphviz output facilities.

Related

Looking for Python module for graph visualization

I'm looking for a python 3 module that can generate a visual representation of a graph. Ideally I would give it a list of nodes and a list of connection, as well as some small amount of data associated with those things, and it would open a window (but an image saved on disk is fine) showing said nodes connected as specified. I don't want to specify the positions of the nodes, instead I'd like the software to arrange them in a way that minimizes edge crossings at least approximately.
Is there any such module? All I've been able to find are plotters and such...
If there is none, an easy-to-learn graphics module would do: I have never done any graphics things.
You can take a look at networkx. It offers the possibility to draw graphs with matplotlib

How do CAD programs display parametric models?

Softwares like Catia, SolidWorks or the like all can visualize complex models while designing.
Exporting such models to raster triangle meshes yields huge files that later need to be greatly simplified to be imported into 3D engines like Unreal Engine or equivalent.
My question is: how do they visualize such complex geometries without rasterization? How do they do it that fast?
GPUs can only deal with triangles, therefore they tessellate geometry exactly as for STL export. Tessellation tolerance may vary from display to STL export affecting the time required to compute it.
Exporting such models to raster triangle meshes yields huge files
Not entirely correct. When you ask solidworks for the mesh you also provide quality that will influence number of triangles you receive - can be millions, can be just a dozen.
CAD packages operate with most bodies/shapes analytically - they have a formula. My guess is any other 3D engine does the same, the thing is format of the analytical data that different engines use is not the same. So you need to convert from one to another using triangles, format that everybody understands.

Is it possible to cut parts out of a picture and analyze them separately with python?

I am doing some studies on eye vascularization - my project contains a machine which can detect the different blood vessels in the retinal membrane at the back of the eye. What I am looking for is a possibility to segment the picture and analyze each segmentation on it`s own. The Segmentation consist of six squares wich I want to analyze separately on the density of white pixels.
I would be very thankful for every kind of input, I am pretty new in the programming world an I actually just have a bare concept on how it should work.
Thanks and Cheerio
Sam
Concept DrawOCTA PICTURE
You could probably accomplish this by using numpy to load the image and split it into sections. You could then analyze the sections using scikit-image or opencv (though this could be difficult to get working. To view the image, you can either save it to a file using numpy, or use matplotlib to open it in a new window.
First of all, please note that in image processing "segmentation" describes the process of grouping neighbouring pixels by context.
https://en.wikipedia.org/wiki/Image_segmentation
What you want to do can be done in various ways.
The most common way is by using ROIs or AOIs (region/area of interest). That's basically some geometric shape like a rectangle, circle, polygon or similar defined in image coordinates.
The image processing is then restricted to only process pixels within that region. So you don't slice your image into pieces but you restrict your evaluation to specific areas.
Another way, like you suggested is to cut the image into pieces and process them one by one. Those sub-images are usually created using ROIs.
A third option which is rather limited but sufficient for simple tasks like yours is accessing pixels directly using coordinate offsets and several nested loops.
Just google "python image processing" in combination with "library" "roi" "cropping" "sliding window" "subimage" "tiles" "slicing" and you'll get tons of information...

How can I implement 'finding min-spanning tree algorithm' on a complex graph using graph-viz?

I need to find minimum spanning trees in a large graph using graph-viz. The number of nodes and edge information will be given in another text-file in 2 columns,"source" and "destination". please help.
Graphviz is principally a tool to layout graphs. The algorithms that are included relate to this task. The input for a graph is a graph specification.
What you need is a tool that computes the MST. There are several. The wikipedia article is a good start for references:
http://en.wikipedia.org/wiki/Prim's_algorithm
In python there is
http://pygraphviz.github.io/
In perl, I found
https://gist.github.com/hirotnk/780342
The SO answer here:
Graphviz Dot Algorithm
is also a good reference.
Given the output of an MST tool, you can general a file that is rendered by graphviz.

Non-Affine image transformations in .NET

Are there any classes, methods in the .NET library, or any algorithms in general, to perform non-affine transformations? (i.e. transformations that involve more than just rotation, scale, translation and shear)
e.g.:
(source: last100.com)
Is there another term for non-affine transformations?
I am not aware of anything integrated in .Net letting you do non affine transforms.
I guess you are trying to have some sort of 3D texture mapping? If that's the case you need an homogenous affine transform, which is not available in .Net. I'm also not aware of any integrated way to make pixel displacement transforms in .Net.
However, the currently voted solution might be good for what you are trying to do, just be aware that it won't do perspective correction out of the box.
For instance:
The picture on the left was generated using the single quad distort library provided by Neil N. The picture on the right was generated using a single quad (two triangles actually) in DirectX.
This may not have any impact on what you are trying to do, but this is something to keep in mind if you want to do 3D stuff, it will look very weird without perspective correct mapping.
All of the example images you posted can be done with a Quadrilateral Distortion. Though I cant say for certain that a quad distort will cover ALL non affine transforms.
Heres a link to a not so good implementation of it in C#... it works, but is slow. Poke around Wikipedia for the many different optimizations available for these kinds of calculations
http://www.vcskicks.com/image-distortion.html
-Neil
You can do this in wpf using a the Viewport3d control and a non-affine transform matrix. Rendering this to a bitmap again may be interesting.... Which I "fixed" by including an invisible <image> control with the same image as on my textured plane... (Also, I've had to work around the max texture size issues by splitting up the plane and cropping images...)
http://www.charlespetzold.com/blog/2007/08/060605.html
In my case I wanted the reverse of this (transform so arbitrary points on the warped become the corners of my rectangular window), which is the Inverse of the matrix to do the opposite.

Resources