<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><div style="text-align: left;">Well, I'd say there would definately be an error because you called your vtkVolumeProperty "property" when that is a reserved name (it is blue text).<br><br><br>Also, if you're having problems with your colours or opacity try this....<br><br> vtkPiecewiseFunction *opacityTransferFunction = vtkPiecewiseFunction::New();<br> opacityTransferFunction->AddPoint( 70.0, 0.0 );<br> opacityTransferFunction->AddPoint( 100.0, 0.2 );<br> opacityTransferFunction->AddPoint( 50000.0, 0.2 );<br> opacityTransferFunction->AddPoint( 50005.0, 0.0 );<br><br> vtkColorTransferFunction* colorTransferFunction = vtkColorTransferFunction::New();<br> colorTransferFunction->AddRGBPoint( 0.0, 1.0, 0.0, 0.0 );<br> colorTransferFunction->AddRGBPoint( 300.0, 1.0, 1.0, 0.0 );<br> colorTransferFunction->AddRGBPoint( 600.0, 0.0, 1.0, 0.0 );<br> colorTransferFunction->AddRGBPoint( 900.0, 1.0, 1.0, 1.0 );<br> colorTransferFunction->AddRGBPoint( 1200.0, 0.0, 0.0, 1.0 );<br> colorTransferFunction->AddRGBPoint( 1500.0, 1.0, 0.0, 1.0 );<br> colorTransferFunction->AddRGBPoint( 1800.0, 0.0, 0.0, 0.0 );<br><br><br>I have absolutely NO idea how to obtain these points, but I guess it works fine. Maybe try changing the numbers to see what it does.<br></div><br><div></div><br><br><blockquote><hr id="EC_stopSpelling">From: cocorim@hotmail.fr<br>To: ahs@cfdrc.com<br>Date: Wed, 21 May 2008 23:39:41 +0200<br>CC: vtkusers@vtk.org<br>Subject: Re: [vtkusers] 3d reconstruction<br><br>
<meta http-equiv="Content-Type" content="text/html; charset=unicode">
<meta name="Generator" content="Microsoft SafeHTML">
<style>
.ExternalClass .EC_hmmessage P
{padding:0px;}
.ExternalClass body.EC_hmmessage
{font-size:10pt;font-family:Tahoma;}
</style>
Hi again !<br>
<br>
Sorry to bother you again, but I have one problem remaining with the vtkRendererWindow.<br>
<br>
Here's my code :<br>
<br>
//code<br>
<br><font size="2">
vtkVolumeRayCastMapper *mapper = vtkVolumeRayCastMapper::New();<br>
mapper->SetInput(connector->GetOutput());<br>
<br>
vtkVolume *volume = vtkVolume::New();<br>
volume->SetMapper(mapper);<br>
<br>
vtkColorTransferFunction *colors = vtkColorTransferFunction::New();<br>
colors->SetAlpha(1.0);<br>
<br>
vtkPiecewiseFunction *opacities = vtkPiecewiseFunction::New();<br>
opacities->SetMaximumNumberOfPieces(-1);<br>
<br>
vtkVolumeProperty *</font><font color="#0000ff" face="" size="2">property</font><font face="" size="2"> = volume->GetProperty();<br>
</font><font color="#0000ff" face="" size="2">property</font><font face="" size="2">->SetColor(colors);<br>
</font><font color="#0000ff" face="" size="2">property</font><font face="" size="2">->SetScalarOpacity(opacities);</font><br>
<font face="" size="2"> <br>
vtkRenderer *ren = vtkRenderer::New();<br>
ren->AddViewProp(volume);<br>
<br>
vtkRenderWindow *triDView = vtkRenderWindow::New();<br>
triDView->AddRenderer(ren);<br>
triDView->Render();<br>
</font> <br>
//end code<br>
<br>
And the problems comes when the vtkRendere is added to the windows. VC++ throws an writing violation exception at a memory bloc. I don't understand why it's doing that.<br>
Maybe, my use of the window is incorrect. I'm waiting for my User's Guide book, but i'd like to have a 3d visualisation of my dicom before :).<br>
<br>
Tranks<br><br>
<hr id="EC_stopSpelling">
<br>
> 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><br><hr>Tous vos amis discutent sur Messenger, et vous ? <a href="http://www.windowslive.fr/messenger/" target="_blank">Téléchargez Messenger, c'est gratuit !</a>
</blockquote><br /><hr />at CarPoint.com.au <a href='http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT' target='_new'>It's simple! Sell your car for just $30 </a></body>
</html>