[vtkusers] Re: Re: Creating a Volume from 2D BMP files.
Yixun Liu
yxliu at fudan.edu.cn
Thu Aug 31 20:48:10 EDT 2006
Hi,
Assuming image is 256x256x100. The first file name is image1 and the last file name is image100. So, SetDataExtent(0, 255, 0, 255, 1, 100); The access violation may be caused by wrong extent setting.
If you use vtkVolume, use vtkVolumeRayCastMapper(vtk4.2.2) or use vtkFixedPointVolumeRayCastMapper(vtk5.0). Note that if you use vtkFixedPointVolumeRayCastMapper you no need to call SetVolumeRayCastFunction();
Hope it help.
Yixun Liu
----- Original Message -----
From: Sharwari Mavalankar
To: Yixun Liu
Cc: VTK
Sent: Thursday, August 31, 2006 6:37 PM
Subject: Re: Creating a Volume from 2D BMP files.
hi Yixun,
Thanks for your email.I had a couple of more questions though.
1.I do not want to visualize colour slices.They are grey level images.
2.Also if I put SetDataExtent() before the Update() then I am getting an access violation error.What does the Update function do exactly?
Also can you tell me what the five parameters in SetDataExtent() mean?
3.If I use vtkVolume what mapper should I use to visualize the slices?
Thanks again for all your help.
Sharwari
On 8/23/06, Yixun Liu <yxliu at fudan.edu.cn> wrote:
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/20060901/301d4d4b/attachment.htm>
More information about the vtkusers
mailing list