I have a 3D medical application developed by OSG. I want to realize volume rendering of CT/MRI dataset. Refer to the figure below. I can set different effects of rendering. I have browse the osgVolume. I find that the transfer functions are too few to realize the effect I want. So what I’m asking really if anybody has any advice. It would be really appreciated, thanks!
I have run the osgVolume demo of OSG. I try to find any transfer function to adjust effect I want. But I can't find more function besides "TransferFunction1D" and "AlphaFuncProperty". And the member functions of them are too less to realize the effects I want. This is some parts of my code.
osg::ref_ptr<osg::TransferFunction1D> transferFunction;
transferFunction = new osg::TransferFunction1D;
transferFunction->setColor(0.4, osg::Vec4(0.75,0.25,0.12,0.0));transferFunction->setColor(0.5, osg::Vec4(0.975, 0.9, 0.82, 0.6));transferFunction->setColor(0.6, osg::Vec4(1, 1, 1, 0.6));transferFunction->setColor(1.0, osg::Vec4(0.9, 0.9, 0.9, 0.6));float alphaFunc=0.02f;osgVolume::AlphaFuncProperty* ap = new osgVolume::AlphaFuncProperty(alphaFunc);osgVolume::CompositeProperty* cp = new osgVolume::CompositeProperty;cp->addProperty(ap);
This is the result of my demo.
I'm confused with how to get better effect by OSG volume rendering. I have attached the source code file. Thanks.