histogram of scalar volume

   3015   4   1
User Avatar
Member
383 posts
Joined: June 2010
Offline
Is there a way to show or calculate a histogram of a volume ?
I found a histogram function in the openvdb header files, but it doesnt seem to be accessible through houdini nodes …
www.woogieworks.at
User Avatar
Member
7740 posts
Joined: July 2005
Offline
You can probably do it in a Volume VOP by summing up the results into a new (detail) array attribute. I haven't looked at the OpenVDB histogram method but one needs to define the buckets that you want to sum over since it so clear for floating point values as it is for integer values.
User Avatar
Staff
6245 posts
Joined: July 2005
Offline
This is much faster than it has a right to be.

I merge a 256 point line with my volume. Then in a volume vop, run setpointattrib() to accumulate each point of the line according to the density*256.


int pt = @density * 255;
pt = clamp(pt, 0, 255);

vector displace = {0, 1, 0};
displace /= 1000*1000;
setpointattrib(0, ‘P’, pt, displace, “add”);

Attachments:
histogram.hip (165.2 KB)

User Avatar
Member
383 posts
Joined: June 2010
Offline
Wow !
A histogram in the viewport ! I am astonished.

I am playing around with a python sop which uses numpy histogram to generate the buckets, but I could not get the resulting data into the GUI
I was trying to write the values into a ramp parameter of the pysop to show the histogram.
www.woogieworks.at
User Avatar
Member
383 posts
Joined: June 2010
Offline
Just to bump this topic one more time. Is there a way to access the openvdb histogram function in houdini without c++ / hdk ?
www.woogieworks.at
  • Quick Links