How to import data sets?

   3583   3   2
User Avatar
Member
29 posts
Joined: Sept. 2007
Offline
Hi guys,

I have data sets of nodes, links and other attributes, which I'd like to import into Houdini to run some visualisation models.

The idea is that the position of the node is defined by the links.

The first step is to be able to read lists of data, any advice on where I should be looking would help me allot.

Sincere regards to the community,

Gon
User Avatar
Member
1390 posts
Joined: July 2005
Offline
Are your nodes holding geometry like data? In Houdini there are two levels of working with nodes:
- the object level which consists with “objects” - containers for many types of geometry and animations.
- the surface (SOP) level that contains actual data like points, primitives, particles with all corresponding attributes.

If you have something like a molecule model, SOPs are the place to start with. The easiest way I see now is a mixture of PythonSOP that lets you create geometry (like points and edges for your links) from any kind of data valid for Python like: lists, numpy arrays, binary string etc.

Additionally you would like to add some number of attributes to these points in order to develop the geometry further. For example adding “scale” or “color” attributes (read from your data set), saving it on points and using this data later on for coping spheres on points (or adding “width” to a curve in render-time) is very common and trivial task in Houdini.
Reading data from an array and creating set of points from that is a matter of 5 lines of code. Pretty simply.

Another way is to use CHOPs (channel operators) to read a data from a text file and apply them on points created previously in SOPs context.

PythonSOP is not very efficient for manipulating huge amount of data since it's… Python. In case of heavy tasks, as soon as you have your points created, you can switch to VEX scripting, which lets you modify your geometry (points and attributes mostly) with a speed of compiled and multi-threaded C++ code.

Visualisation of artificial neural network designed in external toolkit I was used to work on took me 2 hours…

There are plenty room in Houdini for such tasks. Maybe if you could write something more about your project, we could be more specific with help.


Cheers!
sy.
User Avatar
Member
398 posts
Joined: July 2005
Offline
PythonSOP is not very efficient for manipulating huge amount of data since it's… Python. In case of heavy tasks, as soon as you have your points created, you can switch to VEX scripting, which lets you modify your geometry (points and attributes mostly) with a speed of compiled and multi-threaded C++ code.
Just one remark: everything is true but the best benefits you can get from optimized algorithms not from the language itself. It's possible to make Python 100 times faster in some cases when you use optimized data structures like trees. And I'm wondering is it possible to use stackless Python with Houdini? Maybe someone here has such experience.
f = conserve . diffuse . advect . add

fx td @ the mill
User Avatar
Member
29 posts
Joined: Sept. 2007
Offline
The data is thus not clustered, but quite simple:
one is composed of a list defining edges between nodes (pairs of proteins interacting with each other):

Q0080 YBL099W
Q0080 YJR121W
YAL021C YPL042C
YAL056W YGL121C
YAR003W YKL018W


then I have other lists that annotate groups of nodes with an attribute:

GO:0000123,YBL052C,YOR064C,YPL129W,YFL039C,YDR167W,YJL081C,YBR198C,YGR252W,YFL024C,YOR244W, (…)


Could you guys develop a bit on the process of using Python to drive in the data into the SOP?
I tested with a POP net with rules that resemble what I try to achieve (on the data) and am able to generate a surface. So that part is clear.

Basically what we know are the edges, not the points positions. The idea is to link the points (like binding each pair by a string) and run a simulation until the nodes find their (most) ‘relax’ position.

http://www.metahaven.net/sandbox/exodus/community-clusters_inside_platform.jpg [metahaven.net]

I hope this clarifies a bit. The next dataset will be links between web content, the protein data is for comparing with web behaviour (Barabasi-Albert model).

Thank you for taking the time for this, Gon.
  • Quick Links