<!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.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi Madhu</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Sorry I am newbie also in VTK but I will share my
experience to you.</FONT></DIV>
<DIV><FONT face=Arial size=2>I did the same thing with you. I will give you the
code if you need it :-)</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Volume rendering is different with surface
rendering. In volume rendering the volume doesn't need to be segmented
before rendered. In my code you will find 4 modes of volume
rendering:MIP,Composite,Isosurface and X-Ray like projection. For surface
rendering, you can derive from medical1.cxx, medical2.cxx or medical.cxx
examples or I can give you also the code.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>To use my code you must have the dataset where each
voxel stored in unsigned char. If you have dicom data you can read by VolView
and save as a series of PNG,BMP, or PNM (my code use PNG format). You can
download VolView from internet. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Cheers</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>----- Original Message ----- </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=madhu_lsu@yahoo.com href="mailto:madhu_lsu@yahoo.com">Madhusudhanan
Balasubramanian</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=vtkusers@vtk.org
href="mailto:vtkusers@vtk.org">vtkusers@vtk.org</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Wednesday, June 30, 2004 5:58
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [vtkusers] Volume rendering with
ray casting</DIV>
<DIV><BR></DIV>
<DIV>Hi all,</DIV>
<DIV> </DIV>
<DIV>I've a volume data that I tried to volume render with ray casting(which I
constructed from 5, 2D images). I've a couple of questions at
this time:</DIV>
<DIV> </DIV>
<DIV>1. When I rotate the volume around, assuming that image slice 1 is
visible, I expect the see the structures in other slices; say if I rotate it
180 degrees around I'm expecting to see structures from image slice 5; but I
still see only the structures from slice 1. Am I missing
something while rendering? (I've verified the dimensions of the volume
dataset and it is correct).</DIV>
<DIV> </DIV>
<DIV>2. Are there segmentation algorithms that are available with vtk that can
used on 2D images before being volume rendered?</DIV>
<DIV> </DIV>
<DIV>3. With the volume built from 5 image slices, when I rotate the volume
around, the thickness of the volume (along z-axis) appears to be got just from
a single image. May be I'm doing something wrong in rendering.</DIV>
<DIV> </DIV>
<DIV>Here are few fragments of my code that I used to volume render:</DIV>
<DIV> </DIV>
<DIV>CVolRendererView::CVolRendererView()<BR>{<BR> this->color =
vtkPiecewiseFunction::New();<BR> this->color->AddPoint(0,
0.0);<BR> this->color->AddPoint(255, 1.0);</DIV>
<DIV> </DIV>
<DIV> this->opacity =
vtkPiecewiseFunction::New();<BR> this->opacity->AddPoint(0,
0.0);<BR> this->opacity->AddPoint(130,
0.0);<BR> this->opacity->AddPoint(140,
1.0);<BR> this->opacity->AddPoint(255, 1.0);</DIV>
<DIV> </DIV>
<DIV> this->gradOpacity =
vtkPiecewiseFunction::New();<BR> this->gradOpacity->AddPoint(0,
0.0);<BR> this->gradOpacity->AddPoint(3,
0.0);<BR> this->gradOpacity->AddPoint(6,
1.0);<BR> this->gradOpacity->AddPoint(255, 1.0);</DIV>
<DIV> </DIV>
<DIV> this->property =
vtkVolumeProperty::New();<BR> this->property->SetColor(this->color);<BR> this->property->SetScalarOpacity(this->opacity);<BR> this->property->SetGradientOpacity(this->gradOpacity);</DIV>
<DIV> this->property->ShadeOn();<BR> this->property->SetInterpolationTypeToLinear();</DIV>
<DIV> </DIV>
<DIV> this->composite =
vtkVolumeRayCastCompositeFunction::New();<BR> this->composite->SetCompositeMethodToInterpolateFirst();</DIV>
<DIV> </DIV>
<DIV> this->mapper =
vtkVolumeRayCastMapper::New();<BR> this->mapper->SetVolumeRayCastFunction(composite);</DIV>
<DIV> </DIV>
<DIV> this->volume =
vtkVolume::New();<BR> this->volume->SetMapper(this->mapper);<BR> this->volume->SetProperty(this->property);</DIV>
<DIV> </DIV>
<DIV> this->ren =
vtkRenderer::New();<BR> this->ren->AddVolume(volume);</DIV>
<DIV> this->renWin = vtkWin32OpenGLRenderWindow::New();</DIV>
<DIV> </DIV>
<DIV> this->iren = vtkRenderWindowInteractor::New();</DIV>
<DIV><BR> this->imageAppend =
vtkImageAppend::New();<BR> this->imageAppend->SetAppendAxis(2);</DIV>
<DIV> </DIV>
<DIV> this->renWin->AddRenderer(this->ren);<BR> this->iren->SetRenderWindow(this->renWin);<BR> this->iren->Start();<BR>}</DIV>
<DIV> </DIV>
<DIV>//Updating the volume with new image slices</DIV>
<DIV>this->imageAppend->AddInput(this->GetDocument()->reader->GetOutput());<BR>this->imageAppend->UpdateWholeExtent();<BR></DIV>
<DIV>//Rendering</DIV>
<DIV>this->mapper->SetInput((vtkImageData*)this->imageAppend->GetOutput());<BR>this->ren->ResetCamera();<BR>this->renWin->Render();<BR></DIV>
<DIV>I would appreciate your inputs on this.</DIV>
<DIV> </DIV>
<DIV>Thanks,</DIV>
<DIV>Madhu.</DIV>
<P>__________________________________________________<BR>Do You
Yahoo!?<BR>Tired of spam? Yahoo! Mail has the best spam protection around
<BR>http://mail.yahoo.com
<P>
<HR>
<P></P>_______________________________________________<BR>This is the private
VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq><BR>Follow this link to
subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></BLOCKQUOTE></BODY></HTML>