<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>Thanks, it works properly now.<BR>
<BR>
Now I have my vtkVolumeRayCastMapper and I have put the vtkImageData 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 stuff yet.<BR>
I don't know for example if vtkVolumeRayCastMapper gerate a 3D model 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 in my vtkVolumeRayCastMapper. Still, I don't know what to do with it to display a 3D model.<BR>
<BR>
//code<BR>
<BR><FONT size=2>
</FONT><FONT color=#0000ff size=2><FONT face="" color=#0000ff size=2>typedef</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT face="" color=#0000ff size=2>signed</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>short</FONT></FONT><FONT face="" size=2> PixelType;<BR>
</FONT><FONT color=#0000ff size=2><FONT face="" color=#0000ff size=2>const</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT face="" color=#0000ff size=2>unsigned</FONT></FONT><FONT size=2> </FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</FONT></FONT><FONT size=2> Dimension = 3;<BR>
</FONT><FONT color=#0000ff size=2><FONT face="" color=#0000ff size=2>typedef</FONT></FONT><FONT face="" size=2> itk::Image< PixelType, Dimension > ImageType;<BR>
</FONT><FONT color=#0000ff size=2><FONT face="" color=#0000ff size=2>typedef</FONT></FONT><FONT face="" size=2> itk::ImageToVTKImageFilter< ImageType > ConnectorType;<BR>
</FONT><FONT color=#0000ff size=2><FONT face="" color=#0000ff size=2>typedef</FONT></FONT><FONT face="" size=2> itk::ImageSeriesReader< ImageType > ReaderType;</FONT><BR>
<FONT face="" size=2> <BR>
ReaderType::Pointer reader = ReaderType::New();<BR>
<BR>
</FONT><FONT color=#0000ff size=2><FONT face="" color=#0000ff size=2>typedef</FONT></FONT><FONT face="" size=2> itk::GDCMImageIO ImageIOType;</FONT><BR>
<FONT face="" size=2> <BR>
ImageIOType::Pointer dicomIO = ImageIOType::New();<BR>
reader->SetImageIO( dicomIO );<BR>
<BR>
</FONT><FONT color=#0000ff size=2><FONT face="" color=#0000ff size=2>typedef</FONT></FONT><FONT face="" size=2> itk::GDCMSeriesFileNames NamesGeneratorType;</FONT><BR>
<FONT face="" size=2> <BR>
NamesGeneratorType::Pointer nameGenerator = NamesGeneratorType::New();<BR>
nameGenerator->SetUseSeriesDetails( </FONT><FONT color=#0000ff size=2><FONT face="" color=#0000ff size=2>true</FONT></FONT><FONT face="" size=2> );<BR>
nameGenerator->SetDirectory(</FONT><FONT face="" color=#a31515 size=2><FONT color=#a31515 size=2>"C:/Dicoms/PHENIX/dicoms/OS/"</FONT></FONT><FONT face="" size=2>);</FONT><BR>
<FONT face="" size=2> <BR>
</FONT><FONT color=#0000ff size=2><FONT face="" color=#0000ff size=2>typedef</FONT></FONT><FONT face="" size=2> std::vector< std::string > SeriesIdContainer;</FONT><BR>
<FONT face="" size=2> <BR>
</FONT><FONT color=#0000ff size=2><FONT face="" color=#0000ff size=2>const</FONT></FONT><FONT face="" size=2> SeriesIdContainer & seriesUID = nameGenerator->GetSeriesUIDs();<BR>
SeriesIdContainer::<FONT face="">const_iterator</FONT> seriesItr = seriesUID.begin();<BR>
SeriesIdContainer::<FONT face="">const_iterator</FONT> seriesEnd = <FONT face="">seriesUID.end</FONT>();<BR>
<BR>
</FONT><FONT color=#0000ff size=2><FONT face="" color=#0000ff size=2>while</FONT></FONT><FONT face="" size=2>( seriesItr != seriesEnd )<BR>
{<BR>
std::cout << seriesItr->c_str() << </FONT><FONT face="" color=#a31515 size=2><FONT color=#a31515 size=2>"caca"</FONT></FONT><FONT face="" size=2> << std::endl;<BR>
seriesItr++;<BR>
}<BR>
<BR>
std::string seriesIdentifier;<BR>
seriesIdentifier = seriesUID.begin()->c_str();<BR>
</FONT><FONT face="" color=#0000ff size=2><FONT face="" color=#0000ff size=2>typedef</FONT></FONT><FONT face="" size=2> std::vector< std::string > FileNamesContai</FONT><FONT face="" size=2>ner;</FONT><BR>
<FONT face="" size=2> <BR>
FileNamesContainer fileNames;<BR>
fileNames = nameGenerator->GetFileNames( seriesIdentifier );<BR>
reader->SetFileNames( fileNames );<BR>
<BR>
cout << </FONT><FONT color=#a31515 size=2><FONT face="" color=#a31515 size=2>"updating the reader"</FONT></FONT><FONT face="" size=2> << endl;</FONT><BR>
<FONT face="" size=2> <BR>
</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>try<BR></FONT></FONT><FONT size=2>
{<BR>
reader->Update();<BR>
}<BR>
</FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>catch</FONT></FONT><FONT face="" size=2> (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>
</FONT><BR><BR><BR> <BR>
<HR id=stopSpelling>
<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>> > 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>> > 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>> > 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>> > Click here Search for local singles online @ Lavalife.<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>> > 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>> > 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>> > <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 /><hr />Avec Windows Live Messenger restez en contact avec tous vos amis ! <a href='http://www.windowslive.fr/messenger/' target='_new'>Téléchargez Messenger, c'est gratuit !</a></body>
</html>