[vtkusers] re:Creating a Volume from 2D BMP files.

Yixun Liu yxliu at fudan.edu.cn
Wed Aug 23 21:14:06 EDT 2006


Hi,

If you want to visualize color slices, you need to 
1. read these slices. You need to put the SetDataExtent(0, 111, 0, 127, 1, 300);
before Update();

 vtkTIFFReader *v16 = vtkTIFFReader::New();
 v16->SetFilePrefix("D:\\MyVC\\VTKtest\\Raycasting\\Data\\BrainColor\\brain");
 v16->SetFilePattern("%s%d.TIF");
 v16->SetDataExtent(0, 111, 0, 127, 1, 300);
 v16->SetDataSpacing(1.2,1.2,0.5);
 v16->SetDataOrigin(0.0, 0.0, 0.0);
 v16->SetNumberOfScalarComponents(3);
 v16->Update();

2. Add the 4th component. The first three components are color and the 4th is used to map to opacity. I compute the luminancy according to the firft three components and take it as the 4th component.

3. Opacity map using vtkPiecewiseFunction

4. no need color map function

5. you need vtk5.0

Regads,

Yixun Liu


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060824/93dc7300/attachment.htm>


More information about the vtkusers mailing list