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