<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face="Bookman Old Style">Hi,</FONT></DIV>
<DIV><FONT face="Bookman Old Style">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.</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">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();</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">Hope it help.</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">Yixun Liu</FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 9pt 宋体">----- Original Message ----- </DIV>
<DIV style="BACKGROUND: #e4e4e4; FONT: 9pt 宋体; font-color: black"><B>From:</B>
<A title=sharwari@gmail.com href="mailto:sharwari@gmail.com">Sharwari
Mavalankar</A> </DIV>
<DIV style="FONT: 9pt 宋体"><B>To:</B> <A title=yxliu@fudan.edu.cn
href="mailto:yxliu@fudan.edu.cn">Yixun Liu</A> </DIV>
<DIV style="FONT: 9pt 宋体"><B>Cc:</B> <A title=vtkusers@vtk.org
href="mailto:vtkusers@vtk.org">VTK</A> </DIV>
<DIV style="FONT: 9pt 宋体"><B>Sent:</B> Thursday, August 31, 2006 6:37 PM</DIV>
<DIV style="FONT: 9pt 宋体"><B>Subject:</B> Re: Creating a Volume from 2D BMP
files.</DIV>
<DIV><BR></DIV>
<DIV>hi Yixun,</DIV>
<DIV>Thanks for your email.I had a couple of more questions though.</DIV>
<DIV>1.I do not want to visualize colour slices.They are grey level
images.</DIV>
<DIV> </DIV>
<DIV>2.Also if I put SetDataExtent() before the Update() then I am getting an
access violation error.What does the Update function do exactly?</DIV>
<DIV>Also can you tell me what the five parameters in SetDataExtent()
mean?</DIV>
<DIV> </DIV>
<DIV>3.If I use vtkVolume what mapper should I use to visualize the
slices?</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thanks again for all your help.</DIV>
<DIV>Sharwari</DIV>
<DIV><BR><BR> </DIV>
<DIV><SPAN class=gmail_quote>On 8/23/06, <B class=gmail_sendername>Yixun
Liu</B> <<A href="mailto:yxliu@fudan.edu.cn">yxliu@fudan.edu.cn</A>>
wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<DIV>
<DIV bgcolor="#ffffff">
<DIV><FONT face="Bookman Old Style">Hi,</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">If you want to visualize color slices,
you need to </FONT></DIV>
<DIV><FONT face="Bookman Old Style">1. read these slices. You need to put
the SetDataExtent(0, 111, 0, 127, 1, 300);<BR>before Update();</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style"> vtkTIFFReader *v16 =
vtkTIFFReader::New();<BR></FONT><FONT
face="Bookman Old Style"> v16->SetFilePrefix("D:\\MyVC\\VTKtest\\Raycasting\\Data\\BrainColor\\brain");<BR> v16->SetFilePattern("%s%d.TIF");
<BR> v16->SetDataExtent(0, 111, 0, 127, 1,
300);<BR> v16->SetDataSpacing(1.2,1.2,0.5);<BR> v16->SetDataOrigin(0.0,
0.0, 0.0);</FONT></DIV>
<DIV><FONT
face="Bookman Old Style"> v16->SetNumberOfScalarComponents(3);<BR></FONT><FONT
face="Bookman Old Style"> v16->Update();</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">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. </FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">3. Opacity map using
vtkPiecewiseFunction</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">4. no need color map
function</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">5. you need vtk5.0</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style">Regads,</FONT></DIV>
<DIV><FONT face="Bookman Old Style"></FONT> </DIV>
<DIV><FONT face="Bookman Old Style"><SPAN class=st id=st
name="st">Yixun</SPAN> Liu</FONT></DIV>
<DIV><BR> </DIV>
<DIV><FONT
face="Bookman Old Style"></FONT> </DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></BODY></HTML>