Hi Robert,
Sorry, I just saw your reply. Is TransferFunctionProperty used for defined
colour map?
osg::ref_ptr<osg::TransferFunction1D> transferFunction = new
osg::TransferFunction1D;
transferFunction->setColor(0.0, osg::Vec4(1.0,0.0,0.0,0.0));
transferFunction->setColor(0.5, osg::Vec4(1.0,1.0,0.0,0.5));
transferFunction->setColor(1.0, osg::Vec4(0.0,0.0,1.0,1.0));
transferFunction->assign(transferFunction->getColorMap());
osg::ref_ptr<osgVolume::TransferFunctionProperty> tfp = new
osgVolume::TransferFunctionProperty(transferFunction.get());
osg::ref_ptr<osgVolume::CompositeProperty> cp = new
osgVolume::CompositeProperty;
layer->addProperty(cp.get());
cp->addProperty(tfp.get());
If I don't use TransferFunctionProperty, I guess osg will use default colour
map. Then I no need to create another colour map. Is that correct?
For example, the size of my volume cube is 100 * 100 * 50. If I show the
first layer (100 * 100 * 1), the colour from the back view is more brightness
than from the front view. I am not understand why it is related to
TransferFunctionProperty. The colour brightness is affected by adjusting the
SampleDensityProperty value.
I have more question about performance. If the image is showed the first
layer, the performance is the same as showing all layers (100 * 100 * 50). Is
any possible way to increase the rendering speeding when only first layer is
shown? Many thanks.
Regards,
Clement
________________________________________
From: [email protected]
[[email protected]] On Behalf Of Robert Osfield
[[email protected]]
Sent: Wednesday, 25 April 2012 2:30 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] osgvolume brightness and sample density
Hi Clement,
You simply need to attach a TransferFunctionProperty to the Layer
assigned VolumeTile and set up this to map floating point intensity
value to the colour/alpha value required. The osgvolume has example of
it's setup.
Robert.
On 12 April 2012 03:52, <[email protected]> wrote:
> Hi,
>
> I am using osgVolume to display my CT data. If I set the value of
> SampleDensityProperty lower, I can get more details, but the brightness will
> become darker or dull. Does any method that allow to use smaller value of
> SampleDensityProperty and keep image colour brighter. I tried to use
> LightingProperty, but I don't know why I got an error to have this property.
>
>
> Regards,
> Clement
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org