<div>Hello Brian.</div>
<div>I have tried to do what you said, and it makes good sense. I think i almost got i working, but i still have a doubt about how exactly i can connect the </div>
<div>itk::ImageToVTKImageFilter to the vtkVolumeRayCastMapper.</div>
<div>It seems that&nbsp; ImageToVTKImageFilter-&gt;GetOutput(...) returns a vtkImageData, and </div>
<div>vtkVolumeRayCastMapper-&gt;SetInputConnection(...) only accepts a vtkAlgorithmOutput object.</div>
<div>&nbsp;</div>
<div>So how do i do the final mapping? I really hope you can help me, or any others can. </div>
<div>&nbsp;</div>
<div>Many regards</div>
<div>&nbsp;</div>
<div>Here is the code:</div>
<div>
<p>int main( int , char * argv[])<br>{<br>&nbsp;typedef unsigned char PixelType;<br>&nbsp;const unsigned int Dimension=3;<br>&nbsp;<br>&nbsp;typedef itk::Image&lt;PixelType,Dimension&gt; ImageType;<br>&nbsp;typedef itk::ImageFileReader&lt;ImageType&gt; ReaderType;
<br>&nbsp;typedef itk::ImageToVTKImageFilter&lt;ImageType&gt; ConnectorType;</p>
<p>&nbsp;ReaderType::Pointer reader = ReaderType::New();<br>&nbsp;ConnectorType::Pointer connector = ConnectorType::New();<br>&nbsp;<br>&nbsp;reader-&gt;SetFileName(&quot;D:\\skole\\thesis\\Data\\KDIGWKFN\\ANALYZE\\KDIGWKFN_mpr_pip.img&quot;);
<br>&nbsp;connector-&gt;SetInput(reader-&gt;GetOutput());//In connector lies now the imagedata. Retrieve it by calling GetOutput()<br>&nbsp;<br>&nbsp;vtkStructuredPointsReader *vtkReader=vtkStructuredPointsReader::New();<br>&nbsp;</p>
<p>&nbsp;//Create transfer mapping scalar value to color<br>&nbsp;vtkPiecewiseFunction *opacityTransferfunction=vtkPiecewiseFunction::New();<br>&nbsp;opacityTransferfunction-&gt;AddPoint(20.,0.0);<br>&nbsp;opacityTransferfunction-&gt;AddPoint(255.,
0.2);</p>
<p>&nbsp;vtkColorTransferFunction *colorTransferFunction=vtkColorTransferFunction::New();<br>&nbsp;colorTransferFunction-&gt;AddRGBPoint(0.0,0.0,0.0,0.0);<br>&nbsp;colorTransferFunction-&gt;AddRGBPoint(64.0,1.0,0.0,0.0);<br>&nbsp;colorTransferFunction-&gt;AddRGBPoint(
128.0,0.0,0.0,1.0);<br>&nbsp;colorTransferFunction-&gt;AddRGBPoint(192.0,0.0,1.0,0.0);<br>&nbsp;colorTransferFunction-&gt;AddRGBPoint(255.0,0.0,0.2,0.0);</p>
<p>&nbsp;vtkVolumeProperty *volumeProperty=vtkVolumeProperty::New();<br>&nbsp;volumeProperty-&gt;SetColor(colorTransferFunction);<br>&nbsp;volumeProperty-&gt;SetScalarOpacity(opacityTransferfunction);</p>
<p>&nbsp;vtkVolumeRayCastCompositeFunction *compositeFunction=vtkVolumeRayCastCompositeFunction::New();<br>&nbsp;vtkVolumeRayCastMapper *volumeMapper=vtkVolumeRayCastMapper::New();<br>&nbsp;volumeMapper-&gt;SetVolumeRayCastFunction(compositeFunction);
<br>&nbsp;<br>&nbsp;volumeMapper-&gt;SetInputConnection(connector-&gt;GetOutput()); //This i cannot do. What should i do instead?</p></div>
<div>&nbsp;</div>
<div><span class="gmail_quote">2006/10/11, Brian Chacko &lt;<a href="mailto:brianchacko@yahoo.com">brianchacko@yahoo.com</a>&gt;:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Hello! </div>
<div>I suggest you go through the link given below. It gives basics of using ITK and visualizing in VTK.</div>
<div><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.itk.org/CourseWare/Training/GettingStarted-II.pdf" target="_blank">http://www.itk.org/CourseWare/Training/GettingStarted-II.pdf</a><br>&nbsp;</div>

<div>[P.N The header file itkImageToVTKImageFilter.h is not available as it is, when you download the ITK software source.&nbsp;Download&nbsp;<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://prdownloads.sourceforge.net/itk/InsightApplications-2.8.1.zip?download" target="_blank">
InsightApplications-2.8.1.zip</a>. It is available in the ITK download page. Include the header file with the .cxx file in the VTK 5.0\IO\&nbsp; (or any sub folder of vtk 5.0 which contains&nbsp;headers and source files). Remember to include the appropriate library file in your 
CMakeLists.txt)].</div>
<div>&nbsp;</div>
<div>To&nbsp; visualize volume view, try out the volume example in VTK folder </div>
<div>Directory path is&nbsp;&nbsp;&nbsp;&nbsp; &quot;\VTK 5.0\Examples\VolumeRendering\Tcl\SimpleRayCast.tcl&quot;.</div>
<div>&nbsp;<br>Regards</div>
<div>Brian</div><span class="q"><b><i></i></b>
<div><b><i></i></b>&nbsp;</div>
<div><b><i></i></b>&nbsp;</div>
<div><b><i>Prename Surname &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:bsd.diverse@gmail.com" target="_blank">bsd.diverse@gmail.com</a>&gt;</i></b> wrote:</div></span>
<blockquote style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">
<div><span class="e" id="q_10e36cf9f3e4e51d_3">
<div>
<div>Hello</div>
<div>I am reading files from ANALYZE format in ITK. I do processing of the image, and then i want to visualize it in VTK.</div>
<div>So&nbsp; my question is how i get the data fra ITK to VTK, and is it then difficult to show a volumne view of the data in VTK?</div>
<div>A codeexample would be very nice. Thank you very much</div>
<div>&nbsp;</div>
<div>Best of regards</div></div></span></div><span class="q">_______________________________________________<br>This is the private VTK discussion list. <br>Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br></span></blockquote><span class="ad"><br>
<p>
<hr size="1">
How low will we go? Check out Yahoo! Messenger's low <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://us.rd.yahoo.com/mail_us/taglines/postman8/*http://us.rd.yahoo.com/evt=39663/*http://voice.yahoo.com" target="_blank">
PC-to-Phone call rates. </a>
<p></p></p></span></blockquote></div><br>