Hi Robert,

Robert Osfield wrote:
On Wed, Jan 28, 2009 at 3:07 PM, Paul Melis <p...@science.uva.nl> wrote:
Robert Osfield wrote:
The osgvolume example supports reading a file containing a transfer
function. Am I correct in assuming this file must have the format
<scalar value> <r> <g> <b> <a>
where the color values are in the range [0-1]?

This is correct, here's an example of a simple little transfer
function that I put together for testing.

0    0 0 0 0
0.15 1 0 0 0.2
0.2  0 1 0 0.3
0.35 0 1 1 0.4
0.6  1 1 1 0.8
1    1 1 1 1
Ah! The scalar value range is also mapped onto [0-1], I didn't expect that. I was using values in the range [0-255]. Now I indeed get things more in line with what I expect.
It also seems that you must
use --cpu-tf in order for the transfer function to actually get used, but
I'm still not getting the results I expect (compared to other volume
rendering packages).

No, you should be able to use the GPU for transfer functions - this is
supported already, the shaders are available and built into osgVolume.
 You get the best visual quality by doing the transfer function down
on the GPU as well as it works at higher precision than the CPU based
conversion which drops you down to RGBA8.

Without the --cpu-tf flag the transfer function isn't used, as per osgvolume.cpp (line 1217):

   if (!gpuTransferFunction && transferFunction.valid())
   {
       for(Images::iterator itr = images.begin();
           itr != images.end();
           ++itr)
{ *itr = osgVolume::applyTransferFunction(itr->get(), transferFunction.get());
       }
   }

What are the current requirements on the data in
VolumeTiles, only 8-bit?

You can use any precision you want.  Most of the dicom files I've been
testing against are 16bit, and this certainly produces better results
than 8bit data sets.
Ok, good to hear. The 8-bit files I tried seem to work fine, but there seems to be some problem with 16-bit png files that don't get read in correctly.
I'll see if I can dig deeper in the near future.
I wonder if it's how you are setting up osgvolume that is the problem.
 Could you give an example of the osgvolume command line you are
using, as well as links to the data.
osgvolume --cpu-tf --tf file.tf dataset.dds

BTW, the --mip/--isosurface/--light flags are currently not functional it seems?

Regards,
Paul
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to