<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Great !! Tranks a lot. I understand better how it works.<BR><BR>Alosh<BR><BR>
<HR id=stopSpelling>
&gt; Date: Wed, 21 May 2008 11:21:38 -0500<BR>&gt; From: ahs@cfdrc.com<BR>&gt; To: cocorim@hotmail.fr<BR>&gt; CC: vtkusers@vtk.org<BR>&gt; Subject: Re: [vtkusers] 3d reconstruction<BR>&gt; <BR>&gt; Create a vtkVolume <BR>&gt; (http://www.vtk.org/doc/nightly/html/classvtkVolume.html); this is the <BR>&gt; volume rendering equivalent of a vtkActor. Set the mapper on the <BR>&gt; vtkVolume, and add the volume to the render window. You will also need <BR>&gt; to set up color and opacity transfer functions (see <BR>&gt; http://www.vtk.org/doc/nightly/html/classvtkColorTransferFunction.html <BR>&gt; and http://www.vtk.org/doc/nightly/html/classvtkPiecewiseFunction.html) <BR>&gt; indicating how values in your dataset map to color and opacity for <BR>&gt; rendering. In c++, do something like the following.<BR>&gt; <BR>&gt; vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();<BR>&gt; ...<BR>&gt; <BR>&gt; vtkColorTransferFunction *colors = vtkColorTransferFunction::New();<BR>&gt; ...<BR>&gt; <BR>&gt; vtkPiecewiseFunction *opacities = vtkPiecewiseFunction::New();<BR>&gt; ...<BR>&gt; <BR>&gt; vtkVolume *volume = vtkVolume::New();<BR>&gt; volume-&gt;SetMapper(mapper);<BR>&gt; vtkVolumeProperty *property = volume-&gt;GetProperty();<BR>&gt; property-&gt;SetColor(colors);<BR>&gt; property-&gt;SetScalarOpacity(opacities);<BR>&gt; <BR>&gt; vtkRenderer *ren = new vtkRenderer();<BR>&gt; ren-&gt;AddViewProp(volume);<BR>&gt; <BR>&gt; <BR>&gt; - Amy<BR>&gt; <BR>&gt; Alosha [Dread_Lord] wrote:<BR>&gt; &gt; Thanks, it works properly now.<BR>&gt; &gt; <BR>&gt; &gt; Now I have my vtkVolumeRayCastMapper and I have put the vtkImageData <BR>&gt; &gt; as input.<BR>&gt; &gt; <BR>&gt; &gt; So have I my 3D object or am I dreaming :P ?<BR>&gt; &gt; <BR>&gt; &gt; I know I'm not far, but there are some last steps I don't understand yet.<BR>&gt; &gt; <BR>&gt; &gt; Do you or anyone knows how to display it in my 3D View ?<BR>&gt; &gt; <BR>&gt; &gt; I must admit that I'm new in VTK and I don't understand well all this <BR>&gt; &gt; stuff yet.<BR>&gt; &gt; I don't know for example if vtkVolumeRayCastMapper gerate a 3D model <BR>&gt; &gt; that I can display.<BR>&gt; &gt; <BR>&gt; &gt; If my questions seem stupid, forgive me.<BR>&gt; &gt;<BR>&gt; &gt; There's the function I've made and at the end, I have my vtkImageData <BR>&gt; &gt; in my vtkVolumeRayCastMapper. Still, I don't know what to do with it <BR>&gt; &gt; to display a 3D model.<BR>&gt; &gt; <BR>&gt; &gt; //code<BR>&gt; &gt; <BR>&gt; &gt; typedef signed short PixelType;<BR>&gt; &gt; const unsigned int Dimension = 3;<BR>&gt; &gt; typedef itk::Image&lt; PixelType, Dimension &gt; ImageType;<BR>&gt; &gt; typedef itk::ImageToVTKImageFilter&lt; ImageType &gt; ConnectorType;<BR>&gt; &gt; typedef itk::ImageSeriesReader&lt; ImageType &gt; ReaderType;<BR>&gt; &gt; <BR>&gt; &gt; ReaderType::Pointer reader = ReaderType::New();<BR>&gt; &gt; <BR>&gt; &gt; typedef itk::GDCMImageIO ImageIOType;<BR>&gt; &gt; <BR>&gt; &gt; ImageIOType::Pointer dicomIO = ImageIOType::New();<BR>&gt; &gt; reader-&gt;SetImageIO( dicomIO );<BR>&gt; &gt; <BR>&gt; &gt; typedef itk::GDCMSeriesFileNames NamesGeneratorType;<BR>&gt; &gt; <BR>&gt; &gt; NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();<BR>&gt; &gt; nameGenerator-&gt;SetUseSeriesDetails( true );<BR>&gt; &gt; nameGenerator-&gt;SetDirectory("C:/Dicoms/PHENIX/dicoms/OS/");<BR>&gt; &gt; <BR>&gt; &gt; typedef std::vector&lt; std::string &gt; SeriesIdContainer;<BR>&gt; &gt; <BR>&gt; &gt; const SeriesIdContainer &amp; seriesUID = nameGenerator-&gt;GetSeriesUIDs();<BR>&gt; &gt; SeriesIdContainer::const_iterator seriesItr = seriesUID.begin();<BR>&gt; &gt; SeriesIdContainer::const_iterator seriesEnd = seriesUID.end();<BR>&gt; &gt; <BR>&gt; &gt; while( seriesItr != seriesEnd )<BR>&gt; &gt; {<BR>&gt; &gt; std::cout &lt;&lt; seriesItr-&gt;c_str() &lt;&lt; "caca" &lt;&lt; std::endl;<BR>&gt; &gt; seriesItr++;<BR>&gt; &gt; }<BR>&gt; &gt; <BR>&gt; &gt; std::string seriesIdentifier;<BR>&gt; &gt; seriesIdentifier = seriesUID.begin()-&gt;c_str();<BR>&gt; &gt; typedef std::vector&lt; std::string &gt; FileNamesContainer;<BR>&gt; &gt; <BR>&gt; &gt; FileNamesContainer fileNames;<BR>&gt; &gt; fileNames = nameGenerator-&gt;GetFileNames( seriesIdentifier );<BR>&gt; &gt; reader-&gt;SetFileNames( fileNames );<BR>&gt; &gt; <BR>&gt; &gt; cout &lt;&lt; "updating the reader" &lt;&lt; endl;<BR>&gt; &gt; <BR>&gt; &gt; try<BR>&gt; &gt; {<BR>&gt; &gt; reader-&gt;Update();<BR>&gt; &gt; }<BR>&gt; &gt; catch (itk::ExceptionObject &amp;ex)<BR>&gt; &gt; {<BR>&gt; &gt; std::cout &lt;&lt; ex &lt;&lt; std::endl;<BR>&gt; &gt; }<BR>&gt; &gt; <BR>&gt; &gt; ConnectorType::Pointer connector = ConnectorType::New();<BR>&gt; &gt; <BR>&gt; &gt; vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();<BR>&gt; &gt; mapper-&gt;SetInput(connector-&gt;GetOutput());<BR>&gt; &gt; <BR>&gt; &gt; //end code<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; <BR>&gt; &gt; ------------------------------------------------------------------------<BR>&gt; &gt;<BR>&gt; &gt; &gt; Date: Wed, 21 May 2008 10:20:08 -0500<BR>&gt; &gt; &gt; From: ahs@cfdrc.com<BR>&gt; &gt; &gt; To: cocorim@hotmail.fr<BR>&gt; &gt; &gt; CC: vtkusers@vtk.org<BR>&gt; &gt; &gt; Subject: Re: [vtkusers] 3d reconstruction<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; Are you linking against the vtkVolumeRendering library? You would need<BR>&gt; &gt; &gt; to do that in order to use vtkVolumeRayCastMapper (or any other volume<BR>&gt; &gt; &gt; rendering mapper).<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; - Amy<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; Alosha [Dread_Lord] wrote:<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; Thank you for your answer.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; The vtkDicomImageReader actually works, but I have some LINK error<BR>&gt; &gt; &gt; &gt; while instantiating vtkVolumeRayCastMapper.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; ( vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New() )<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; Anyway, is the vtkDicomImageReader build a 3D mesh using the 2D dicom<BR>&gt; &gt; &gt; &gt; serie, or just generate a data set ?<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; In this last case, how can I display it in my igstk::View3D ? I<BR>&gt; &gt; &gt; &gt; suppose I have to build a mesh with it ?<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; I guess there is a VTK class which takes a volume VTK data set and<BR>&gt; &gt; &gt; &gt; build a mesh with it, but I don't know which class :S.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; Anyway, thanks for your answer, and I'm all ears if anyone knows how<BR>&gt; &gt; &gt; &gt; to generate a 3D object from my 2D Dicom series for displaying in a<BR>&gt; &gt; &gt; &gt; igstk::View3D<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; ------------------------------------------------------------------------<BR>&gt; &gt; &gt; &gt; From: w_e_b_m_a_s_t_e_r_6_9@hotmail.com<BR>&gt; &gt; &gt; &gt; To: cocorim@hotmail.fr<BR>&gt; &gt; &gt; &gt; CC: vtkusers@vtk.org<BR>&gt; &gt; &gt; &gt; Subject: RE: [vtkusers] 3d reconstruction<BR>&gt; &gt; &gt; &gt; Date: Thu, 22 May 2008 00:44:50 +1000<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; You can actually read in a DICOM file as a 3D object just using VTK.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; vtkDICOMImageReader *dicomReader = vtkDICOMImageReader::New();<BR>&gt; &gt; &gt; &gt; dicomReader-&gt;SetDirectoryName( "C:\\dicomfolder\\");<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; Have a look at Ray Cast Mapping as well (vtkVolumeRayCastMapper).<BR>&gt; &gt; &gt; &gt; I'm not sure if there is a better way though. With this approach,<BR>&gt; &gt; &gt; &gt; the image has to reduce its image quality (goes a bit blurry)<BR>&gt; &gt; &gt; &gt; while you move the camera. Then once you are finished moving<BR>&gt; &gt; &gt; &gt; around it will return to its original quality.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; Alternatively you can read it in using ITK, and then convert it<BR>&gt; &gt; &gt; &gt; back to VTK. I haven't tried this, so maybe someone can let you<BR>&gt; &gt; &gt; &gt; know the best way to do it.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; Regards,<BR>&gt; &gt; &gt; &gt; Cameron.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; ------------------------------------------------------------------------<BR>&gt; &gt; &gt; &gt; From: cocorim@hotmail.fr<BR>&gt; &gt; &gt; &gt; To: vtkusers@vtk.org<BR>&gt; &gt; &gt; &gt; Date: Wed, 21 May 2008 13:48:12 +0200<BR>&gt; &gt; &gt; &gt; Subject: [vtkusers] 3d reconstruction<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; Hi all !<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; Maybe the problem has already been exposed, and I'm sorry if<BR>&gt; &gt; &gt; &gt; it was.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; I've managed to made a basic DICOM Viewer. It has 4 views ; 3<BR>&gt; &gt; &gt; &gt; views to axial, coronal ans sagittal orientation, and a<BR>&gt; &gt; &gt; &gt; tridimentionnal view for 3d reconstruction.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; I'm using igstk::View2D and igstk::View3D.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; I instantiate a CTImageSpatialObject in which I put the CT<BR>&gt; &gt; &gt; &gt; Image from the CTImageReader.<BR>&gt; &gt; &gt; &gt; Then I put the CTImageSpatialObject into a<BR>&gt; &gt; &gt; &gt; CTImageSpatialObjectRepresentation and I give it to the<BR>&gt; &gt; &gt; &gt; igstk::View2D.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; It's working properly and I can navigate into slides in the<BR>&gt; &gt; &gt; &gt; three 2D views.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; My problems is now how to perform a 3D reconstruction of the<BR>&gt; &gt; &gt; &gt; DICOM and display it in the 3D View.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; I've search on the net and on the mailing list for some help,<BR>&gt; &gt; &gt; &gt; but all this is still a little unclear to me.<BR>&gt; &gt; &gt; &gt; I just know that ITK and VTK has to be used, but I have no<BR>&gt; &gt; &gt; &gt; idea of how.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; If you can help me on that or at least show me the way for<BR>&gt; &gt; &gt; &gt; begin, I would be very greatfull.<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; Thanks a lot !<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; ------------------------------------------------------------------------<BR>&gt; &gt; &gt; &gt; Discutez gratuitement avec vos amis en vidéo ! Téléchargez<BR>&gt; &gt; &gt; &gt; Messenger, c'est gratuit ! &lt;http://www.windowslive.fr/messenger/&gt;<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; ------------------------------------------------------------------------<BR>&gt; &gt; &gt; &gt; Click here Search for local singles online @ Lavalife.<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; &lt;http://a.ninemsn.com.au/b.aspx?URL=http://lavalife9.ninemsn.com.au/clickthru/clickthru.act?id%3Dninemsn%26context%3Dan99%26locale%3Den_AU%26a%3D30290&amp;_t=764581033&amp;_r=email_taglines_Search_OCT07&amp;_m=EXT&gt;<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; ------------------------------------------------------------------------<BR>&gt; &gt; &gt; &gt; Centralisez tous vos comptes mails dans Hotmail ! Créez un compte<BR>&gt; &gt; &gt; &gt; Hotmail, c'est gratuit ! &lt;http://www.windowslive.fr/hotmail/&gt;<BR>&gt; &gt; &gt; &gt; <BR>&gt; &gt; ------------------------------------------------------------------------<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt; &gt; _______________________________________________<BR>&gt; &gt; &gt; &gt; This is the private VTK discussion list.<BR>&gt; &gt; &gt; &gt; Please keep messages on-topic. Check the FAQ at: <BR>&gt; &gt; http://www.vtk.org/Wiki/VTK_FAQ<BR>&gt; &gt; &gt; &gt; Follow this link to subscribe/unsubscribe:<BR>&gt; &gt; &gt; &gt; http://www.vtk.org/mailman/listinfo/vtkusers<BR>&gt; &gt; &gt; &gt;<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt; --<BR>&gt; &gt; &gt; Amy Squillacote Phone: (256) 726-4839<BR>&gt; &gt; &gt; Computer Scientist Fax: (256) 726-4806<BR>&gt; &gt; &gt; CFD Research Corporation Web: http://www.cfdrc.com<BR>&gt; &gt; &gt; 215 Wynn Drive, Suite 501<BR>&gt; &gt; &gt; Huntsville, AL 35805<BR>&gt; &gt; &gt;<BR>&gt; &gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; ------------------------------------------------------------------------<BR>&gt; &gt; Avec Windows Live Messenger restez en contact avec tous vos amis ! <BR>&gt; &gt; Téléchargez Messenger, c'est gratuit ! <BR>&gt; &gt; &lt;http://www.windowslive.fr/messenger/&gt;<BR>&gt; <BR>&gt; -- <BR>&gt; Amy Squillacote Phone: (256) 726-4839<BR>&gt; Computer Scientist Fax: (256) 726-4806<BR>&gt; CFD Research Corporation Web: http://www.cfdrc.com<BR>&gt; 215 Wynn Drive, Suite 501<BR>&gt; Huntsville, AL 35805<BR>&gt; <BR>&gt; <BR><br /><hr />Centralisez tous vos comptes mails dans Hotmail !  <a href='http://www.windowslive.fr/hotmail/' target='_new'>Créez un compte Hotmail, c'est gratuit !</a></body>
</html>