[osg-users] How to realize volume rendering for medical use

Yuhui Ren yuhuimoon at gmail.com
Tue Dec 24 19:40:40 PST 2019


I want to show different parts of one man's head, such as brain, 
bones, blood vessel, muscle and other tissue, by using color functions and 
gradient opacity function. As the following pictures of reference software, 
I can get different effects by adjusting control points, including scalar 
color mapping, scalar opacity mapping and gradient opacity.

[image: 2019-12-25_111721.png][image: 2019-12-25_111539.png] 

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.

[image: 2019-12-25_112706.png]




I'm confused with how to get better effect by OSG volume rendering. I have 
attached the source code file. Thanks.




On Tuesday, December 24, 2019 at 11:58:17 PM UTC+8, Robert Osfield wrote:
>
> Hi Yuhui,
>
> On Sunday, 22 December 2019 08:40:00 UTC, Yuhui Ren wrote:
>>
>> 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 don't know what you are looking for so can't provide any specific 
> advice.  
>
> What do you mean by "the transfer functions are too few"?  
>
> What effect do you want?
>  
> Cheers,
> Robert.
>

-- 
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/8aa0e1e8-2463-4b35-acb3-60998b16b356%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20191224/43af8755/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 53623 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20191224/43af8755/attachment-0001.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2019-12-25_111721.png
Type: image/png
Size: 753060 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20191224/43af8755/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2019-12-25_111539.png
Type: image/png
Size: 401500 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20191224/43af8755/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2019-12-25_112706.png
Type: image/png
Size: 357489 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20191224/43af8755/attachment-0005.png>


More information about the osg-users mailing list