<DIV>hi Rathore,</DIV>
<DIV> </DIV>
<DIV>may be my question is not that clear, after loading the 3D volume from 2D slices using vtkVolume16Reader, I want to access individual slices to perform filtering operation (on a slice-by-slice basis).</DIV>
<DIV> </DIV>
<DIV>(Put it in other way, I need to extract a single slice from the 3Dvolume image (from the v16Img object) , -- how can I do that?)</DIV>
<DIV> </DIV>
<DIV>thank you,</DIV>
<DIV>Ravi.<BR><BR><BR><B><I>Divya Rathore <divyaksr@iitk.ac.in></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2900.2096" name=GENERATOR>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Search in the examples directory if you are using the source code of VTK.</FONT></DIV>
<DIV><FONT face=Arial size=2>If you are using the binary (installable) version then also it is a matter of a simple file searching.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Windows/Linux?</FONT></DIV></FONT></DIV>
<BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> <A title=raviksamala@yahoo.com href="mailto:raviksamala@yahoo.com">Ravi Samala</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> Tuesday, October 04, 2005 10:00 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [vtkusers] Re: how to access 3D volume</DIV>
<DIV><BR></DIV>
<DIV>hi Rathore,</DIV>
<DIV> </DIV>
<DIV>I am kind of new to VTK, can you tell me where can I find ImagePlaneWidget.cpp file.</DIV>
<DIV> </DIV>
<DIV>thank you,</DIV>
<DIV> </DIV>
<DIV>Ravi<BR><BR><B><I>Divya Rathore <<A href="mailto:divyaksr@iitk.ac.in">divyaksr@iitk.ac.in</A>></I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<META content="MSHTML 6.00.2900.2096" name=GENERATOR>
<STYLE></STYLE>
<DIV><FONT face=Arial size=2>Check out ImagePlaneWidget.cpp (I would like to thank Dr. Nagarajan, <A href="mailto:raman_nagarajan@vsnl.net">raman_nagarajan@vsnl.net</A>, a member of this list).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>regards,</FONT></DIV>
<DIV><FONT face=Arial size=2>D. Rathore</FONT></DIV>
<BLOCKQUOTE style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> <A title=raviksamala@yahoo.com href="mailto:raviksamala@yahoo.com">Ravi Samala</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> Monday, October 03, 2005 7:02 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [vtkusers] how to access 3D volume</DIV>
<DIV><BR></DIV>
<DIV>hi vtkusers,</DIV>
<DIV> </DIV>
<DIV> I am reading 2D slices and constructing a 3D volume, using the following code....</DIV>
<DIV> </DIV>
<DIV><FONT size=2>
<P>vtkVolume16Reader *v16Img = vtkVolume16Reader::New();</P>
<P>v16Img->SetDataDimensions (sizex,sizey);</P>
<P>v16Img->SetImageRange (atoi(argv[3]),atoi(argv[4])); </P></FONT><FONT size=2>
<P>v16Img->SetHeaderSize(HeadS);</P>
<P>v16Img->SetFilePrefix (argv[2]); </P>
<P>v16Img->SetDataSpacing (0.1, 0.1, 0.5);</P>
<P>v16Img->SetDataOrigin(0, 0, 0);</P>
<P>cout<<"Image Volume Read...."<<endl;</P></FONT><FONT color=#008000 size=2>
<P> </P></FONT><FONT size=2>
<P></P>
<P></FONT><FONT color=#008000 size=2>//CompositeFunction with option</P></FONT><FONT size=2>
<P>vtkVolumeRayCastCompositeFunction *compositeFunction = vtkVolumeRayCastCompositeFunction::New();</P>
<P>compositeFunction->SetCompositeMethodToInterpolateFirst(); </P>
<P></FONT><FONT color=#008000 size=2></FONT> </P>
<P><FONT color=#008000 size=2>//Mapper with selected RayCastFunction</P></FONT><FONT size=2>
<P>vtkVolumeRayCastMapper *volumeMapper = vtkVolumeRayCastMapper::New();</P>
<P>volumeMapper->SetInput(v16Img -> GetOutput());</P>
<P>volumeMapper->SetVolumeRayCastFunction(compositeFunction);</P></FONT><FONT color=#008000 size=2>
<P> </P>
<P>// Create transfer mapping scalar value to opacity</P></FONT><FONT size=2>
<P>vtkPiecewiseFunction *pieceFunc = vtkPiecewiseFunction::New();</P>
<P>pieceFunc->AddPoint(0, 0.0); </FONT><FONT color=#008000 size=2>// alpha value for the lower intensity limit</P></FONT><FONT size=2>
<P>pieceFunc->AddPoint(15000, 0.5); </FONT><FONT color=#008000 size=2>// alpha value for the upper intensity limit</P></FONT><FONT color=#008000 size=2>
<P> </P>
<P>//Set Volume Property</P></FONT><FONT size=2>
<P>vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New();</P>
<P>volumeProperty->SetInterpolationTypeToLinear();</P></FONT><FONT size=2>
<P>volumeProperty->SetScalarOpacity(pieceFunc);</P>
<P>volumeProperty->ShadeOn();</P></FONT><FONT color=#008000 size=2>
<P> </P>
<P>//The special actor with properties</P></FONT><FONT size=2>
<P>vtkVolume *vol = vtkVolume::New();</P>
<P>vol->SetMapper(volumeMapper);</P>
<P>vol->SetProperty(volumeProperty);</P></FONT><FONT color=#008000 size=2>
<P> </P>
<P>// An outline provides context around the data.</P></FONT><FONT size=2>
<P>vtkOutlineFilter *outlineData = vtkOutlineFilter::New();</P>
<P>outlineData->SetInput((vtkDataSet *) v16Img->GetOutput());</P>
<P>vtkPolyDataMapper *mapOutline = vtkPolyDataMapper::New();</P>
<P>mapOutline->SetInput(outlineData->GetOutput());</P>
<P>vtkActor *outline = vtkActor::New();</P>
<P>outline->SetMapper(mapOutline);</P>
<P>outline->GetProperty()->SetColor(0,0,0); </P>
<P></P></FONT><FONT color=#008000 size=2>
<P> </P>
<P>//Starting to Render</P></FONT><FONT size=2>
<P>vtkRenderer *renderer=vtkRenderer::New();</P></FONT><FONT size=2>
<P>renderer->AddVolume(vol); </P>
<P>renderer->SetBackground(1,1,1);</P></FONT><FONT color=#008000 size=2>
<P></FONT><FONT color=#008000 size=2> </P></FONT><FONT size=2>
<P>vtkRenderWindow *renWin=vtkRenderWindow::New();</P>
<P>renWin->SetSize(500,500);</P>
<P>renWin->DoubleBufferOn(); </P>
<P>renWin->AddRenderer(renderer);</P>
<P></P>
<P>vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New();</P>
<P>iren->SetRenderWindow(renWin);</P>
<P>iren->Initialize(); </P>
<P>iren->Start();</P>
<P> </P>
<P>my question is : is there any way I can access individual slices and a point in the 3 dimensional space (like p(x,y,z).</P>
<P> </P>
<P>thanks in advance,</P>
<P> </P>
<P>Ravi.</P></FONT></DIV>
<P>
<HR SIZE=1>
Yahoo! for Good<BR><A href="http://store.yahoo.com/redcross-donate3/">Click here to donate</A> to the Hurricane Katrina relief effort.
<P>
<HR>
<P></P>_______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>Follow this link to subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></BLOCKQUOTE>_______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>Follow this link to subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></BLOCKQUOTE>
<P>
<HR SIZE=1>
Yahoo! for Good<BR><A href="http://store.yahoo.com/redcross-donate3/">Click here to donate</A> to the Hurricane Katrina relief effort.
<P>
<HR>
<P></P>_______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>Follow this link to subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></BLOCKQUOTE>_______________________________________________<BR>This is the private VTK discussion list. <BR>Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>Follow this link to subscribe/unsubscribe:<BR>http://www.vtk.org/mailman/listinfo/vtkusers<BR></BLOCKQUOTE><p>
                <hr size=1>Yahoo! for Good<br>
<a href="http://store.yahoo.com/redcross-donate3/">Click here to donate</a> to the Hurricane Katrina relief effort.