[vtkusers] render color volume

Yixun Liu enjoywm at cs.wm.edu
Mon Jun 29 09:10:00 EDT 2009


My data is 3D volume. Each voxel includes 4 components: RGBA. I can use
vtkFixedPointVolumeRaycastMapper to render it, but need a opactiy
mapping function to control the mapping. This function
maps intensity to opacity. What I want to do is to map some region to
specified opacity. 

Thanks.

jalal sadeghi wrote:
>
>
> On Sun, Jun 28, 2009 at 7:59 AM, <enjoywm at cs.wm.edu
> <mailto:enjoywm at cs.wm.edu>> wrote:
>
>     Hi,
>     I want to render a color volume with 4 components: RGBA.
>     I want to use component alpha instead of opacity mapping function to
>     control the opacity. Can I do this?
>
>     Thanks for help.
>
>     Yixun
>     _______________________________________________
>     Powered by www.kitware.com <http://www.kitware.com>
>
>     Visit other Kitware open-source projects at
>     http://www.kitware.com/opensource/opensource.html
>
>     Please keep messages on-topic and check the VTK FAQ at:
>     http://www.vtk.org/Wiki/VTK_FAQ
>
>     Follow this link to subscribe/unsubscribe:
>     http://www.vtk.org/mailman/listinfo/vtkusers
>
>
>
> This Was my qeuestion about a week age and I used this Soloution:
> Filling an Image with 4 component r g b and alpha (value between 0 255)
>
>
> vtkImageData*  pImage=vtkImageData::New();
> pImage->SetDimensions(512,512,1);
> pImage->SetScalarTypeToUnsignedChar();
> pImage->SetNumberOfScalarComponents(4);
> pImage->AllocateScalars();
>
> and  
> a For filling it a code like this
> ptr=(unsigned char*)pImage->GetScalarPointer();
> while (i<count)
> {
>
>     *ptr=0;ptr++;//red
>              *ptr=120; ptr++; //green
>              *ptr=0;ptr++;//blue
>               *ptr=i%255;ptr++;//alpha
>
>  
> }
> }
>
>
> and I Used it as Texture for a plane
> vtkTexture* pTex=vtkTexture::New();
> pTex->SetInput(pImage);
>




More information about the vtkusers mailing list