<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 ImageToVTKImageFilter->GetOutput(...) returns a vtkImageData, and </div>
<div>vtkVolumeRayCastMapper->SetInputConnection(...) only accepts a vtkAlgorithmOutput object.</div>
<div> </div>
<div>So how do i do the final mapping? I really hope you can help me, or any others can. </div>
<div> </div>
<div>Many regards</div>
<div> </div>
<div>Here is the code:</div>
<div>
<p>int main( int , char * argv[])<br>{<br> typedef unsigned char PixelType;<br> const unsigned int Dimension=3;<br> <br> typedef itk::Image<PixelType,Dimension> ImageType;<br> typedef itk::ImageFileReader<ImageType> ReaderType;
<br> typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType;</p>
<p> ReaderType::Pointer reader = ReaderType::New();<br> ConnectorType::Pointer connector = ConnectorType::New();<br> <br> reader->SetFileName("D:\\skole\\thesis\\Data\\KDIGWKFN\\ANALYZE\\KDIGWKFN_mpr_pip.img");
<br> connector->SetInput(reader->GetOutput());//In connector lies now the imagedata. Retrieve it by calling GetOutput()<br> <br> vtkStructuredPointsReader *vtkReader=vtkStructuredPointsReader::New();<br> </p>
<p> //Create transfer mapping scalar value to color<br> vtkPiecewiseFunction *opacityTransferfunction=vtkPiecewiseFunction::New();<br> opacityTransferfunction->AddPoint(20.,0.0);<br> opacityTransferfunction->AddPoint(255.,
0.2);</p>
<p> vtkColorTransferFunction *colorTransferFunction=vtkColorTransferFunction::New();<br> colorTransferFunction->AddRGBPoint(0.0,0.0,0.0,0.0);<br> colorTransferFunction->AddRGBPoint(64.0,1.0,0.0,0.0);<br> colorTransferFunction->AddRGBPoint(
128.0,0.0,0.0,1.0);<br> colorTransferFunction->AddRGBPoint(192.0,0.0,1.0,0.0);<br> colorTransferFunction->AddRGBPoint(255.0,0.0,0.2,0.0);</p>
<p> vtkVolumeProperty *volumeProperty=vtkVolumeProperty::New();<br> volumeProperty->SetColor(colorTransferFunction);<br> volumeProperty->SetScalarOpacity(opacityTransferfunction);</p>
<p> vtkVolumeRayCastCompositeFunction *compositeFunction=vtkVolumeRayCastCompositeFunction::New();<br> vtkVolumeRayCastMapper *volumeMapper=vtkVolumeRayCastMapper::New();<br> volumeMapper->SetVolumeRayCastFunction(compositeFunction);
<br> <br> volumeMapper->SetInputConnection(connector->GetOutput()); //This i cannot do. What should i do instead?</p></div>
<div> </div>
<div><span class="gmail_quote">2006/10/11, Brian Chacko <<a href="mailto:brianchacko@yahoo.com">brianchacko@yahoo.com</a>>:</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> </div>
<div>[P.N The header file itkImageToVTKImageFilter.h is not available as it is, when you download the ITK software source. Download <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\ (or any sub folder of vtk 5.0 which contains headers and source files). Remember to include the appropriate library file in your
CMakeLists.txt)].</div>
<div> </div>
<div>To visualize volume view, try out the volume example in VTK folder </div>
<div>Directory path is "\VTK 5.0\Examples\VolumeRendering\Tcl\SimpleRayCast.tcl".</div>
<div> <br>Regards</div>
<div>Brian</div><span class="q"><b><i></i></b>
<div><b><i></i></b> </div>
<div><b><i></i></b> </div>
<div><b><i>Prename Surname <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:bsd.diverse@gmail.com" target="_blank">bsd.diverse@gmail.com</a>></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 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> </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>