<DIV>Hi Tim,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I downloaded your filter and converted your tcl program in c++ and it works.I tried it for 3 images and it works good but when I tried with all the slices of my volume it is extremelly slow.I'm working under XP,CPU 2.80GHz,1.00 GB RAM and my images are 832x1008 and it takes&nbsp;over 24 hours to process it and there's not result yet.How many time take it normally to process?Is there some way to optimize it cause like this it's a little bit of inapplicable.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Here is the code that i use:</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>
<P>#include &lt;vtkPolyData.h&gt;</P>
<P>#include &lt;vtkPoints.h&gt;</P>
<P>#include &lt;vtkPolyDataMapper.h&gt;</P>
<P>#include &lt;vtkActor.h&gt;</P>
<P>#include "vtkPowerCrustSurfaceReconstruction.h"</P>
<P>#include &lt;vtkRenderer.h&gt;</P>
<P>#include &lt;vtkRenderWindow.h&gt;</P>
<P>#include &lt;vtkWindowToImageFilter.h&gt;</P>
<P>#include &lt;vtkPNGWriter.h&gt;</P>
<P>#include &lt;vtkProperty.h&gt;</P>
<P>#include &lt;vtkCamera.h&gt;</P>
<P>#include "vtkRenderWindowInteractor.h"</P>
<P>&nbsp;</P>
<P>int main( int argc, char *argv[] )</P>
<P>{</P>
<P>///////////////////////////////////////////////////////////</P>
<P>FILE *donnees = fopen("points.txt","r");</P>
<P>vtkPolyData *data = vtkPolyData::New();</P>
<P>vtkPoints *points = vtkPoints::New();</P>
<P>int iCounter = 0;</P>
<P>while (!feof(donnees))</P>
<P>{</P>
<P>fprintf(stdout,"reading points: %i\r", iCounter);</P>
<P>float x, y, z;</P>
<P>fscanf(donnees,"%f %f %f\n", &amp;x, &amp;y, &amp;z);</P>
<P>points-&gt;InsertPoint(iCounter++, x, y, z);</P>
<P>}</P>
<P>data-&gt;SetPoints(points);</P>
<P>fclose(donnees);</P>
<P>fprintf(stdout,"\n\n");</P>
<P>/////////////////////////////////////////////////////////</P>
<P>// render the raw input points into the first renderer</P>
<P>vtkPolyDataMapper *rawpointsmapper=vtkPolyDataMapper::New();</P>
<P>rawpointsmapper-&gt; SetInput(data); </P>
<P>vtkActor *rawpointsactor=vtkActor::New();</P>
<P>rawpointsactor -&gt;SetMapper( rawpointsmapper);</P>
<P>rawpointsactor -&gt;GetProperty()-&gt; SetColor( 0, 0, 0);</P>
<P>rawpointsactor -&gt;SetScale(1.0,1.0,25);</P>
<P>// construct the surface and render into the second renderer</P>
<P>vtkPowerCrustSurfaceReconstruction *surf=vtkPowerCrustSurfaceReconstruction::New();</P>
<P>surf -&gt; SetInput(data);</P>
<P>vtkPolyDataMapper *map=vtkPolyDataMapper::New();</P>
<P>map -&gt; SetInput (surf -&gt;GetOutput());</P>
<P>vtkActor *surfaceActor=vtkActor::New();</P>
<P>surfaceActor -&gt; SetMapper (map);</P>
<P>surfaceActor -&gt;GetProperty()-&gt; SetDiffuseColor (1.0000, 0.3882, 0.2784);</P>
<P>surfaceActor -&gt;GetProperty()-&gt; SetSpecularColor (1, 1, 1);</P>
<P>surfaceActor -&gt;GetProperty()-&gt; SetSpecular (.4);</P>
<P>surfaceActor -&gt;GetProperty()-&gt; SetSpecularPower( 50);</P>
<P>surfaceActor -&gt;SetScale(1.0,1.0,25);</P>
<P>// render the medial surface into a third renderer</P>
<P>surf-&gt; Update(); </P>
<P>// (because GetMedialSurface is not part of the normal pipeline)</P>
<P>vtkPolyDataMapper *medialmapper=vtkPolyDataMapper::New();</P>
<P>medialmapper -&gt; SetInput (surf -&gt;GetMedialSurface());</P>
<P>medialmapper -&gt;ScalarVisibilityOff();</P>
<P>vtkActor *medialactor=vtkActor::New();</P>
<P>medialactor -&gt; SetMapper( medialmapper);</P>
<P>medialactor -&gt;GetProperty()-&gt; SetDiffuseColor (0.1000, 0.8882, 0.2784);</P>
<P>medialactor -&gt;GetProperty()-&gt; SetSpecularColor (1 ,1, 1);</P>
<P>medialactor -&gt;GetProperty()-&gt; SetSpecular (.4);</P>
<P>medialactor -&gt;GetProperty()-&gt; SetSpecularPower (50);</P>
<P>medialactor -&gt;GetProperty()-&gt; SetRepresentationToWireframe();</P>
<P>medialactor -&gt;SetScale(1.0,1.0,25);</P>
<P>// Render everything</P>
<P>vtkRenderer *ren1=vtkRenderer::New();</P>
<P>vtkRenderer *ren2=vtkRenderer::New();</P>
<P>vtkRenderer *ren3=vtkRenderer::New();</P>
<P>vtkRenderWindow *renWin=vtkRenderWindow::New();</P>
<P>renWin -&gt;AddRenderer( ren1);</P>
<P>renWin -&gt;AddRenderer (ren2);</P>
<P>renWin -&gt;AddRenderer (ren3);</P>
<P>renWin -&gt;SetSize (1000 ,1000);</P>
<P>// Add the actors to the renderer</P>
<P>ren1-&gt; AddActor (rawpointsactor);</P>
<P>ren2 -&gt;AddActor (surfaceActor);</P>
<P>ren3 -&gt;AddActor (medialactor);</P>
<P>// set the properties of the renderers</P>
<P>ren1 -&gt;SetBackground (1, 1, 1);</P>
<P>ren1 -&gt;SetViewport (0.0 ,0.0, 0.33, 1.0);</P>
<P>ren1 -&gt;GetActiveCamera() -&gt; SetPosition (1, -1 ,0);</P>
<P>ren1 -&gt;ResetCamera();</P>
<P>ren2 -&gt;SetBackground (1, 1, 1);</P>
<P>ren2 -&gt;SetViewport (0.33 ,0.0, 0.66, 1.0);</P>
<P>ren2 -&gt;GetActiveCamera() -&gt; SetPosition (1 ,-1, 0 ); </P>
<P>ren2 -&gt;ResetCamera();</P>
<P>ren3 -&gt;SetBackground (1, 1, 1);</P>
<P>ren3 -&gt;SetViewport (0.66 ,0.0 ,1.0, 1.0);</P>
<P>ren3 -&gt;GetActiveCamera() -&gt;SetPosition (1 ,-1, 0);</P>
<P>ren3 -&gt;ResetCamera();</P>
<P>vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();</P>
<P>iren-&gt;SetRenderWindow(renWin);</P>
<P>//render the image</P>
<P>renWin -&gt;Render();</P>
<P>iren-&gt;Start();</P>
<P>// output the image to file (used to generate the initial regression image)</P>
<P>vtkWindowToImageFilter *to_image=vtkWindowToImageFilter::New();</P>
<P>to_image -&gt;SetInput ( renWin);</P>
<P>vtkPNGWriter *to_png=vtkPNGWriter::New();</P>
<P>to_png-&gt; SetFileName ("TestPowerCrust.png");</P>
<P>to_png -&gt;SetInput(to_image-&gt; GetOutput());</P>
<P>to_png -&gt; Write();</P>
<P>return EXIT_SUCCESS;</P>
<P>}</P>
<P>Regards,</P>
<P>Stanislava</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P></FONT><BR><BR><B><I>Tim Hutton &lt;tim.hutton@gmail.com&gt;</I></B> a écrit :</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">Stanislava,<BR><BR>You could try some form of surface reconstruction. This code is<BR>already written for VTK which should save you time:<BR>http://www.sq3.org.uk/powercrust<BR><BR>From the image you sent it looks like it would work. However, the best<BR>results should be obtained from your marching cubes approach since the<BR>original image is a volume. Maybe you need to fill the contours before<BR>running vtkMarchingCubes?<BR><BR>Tim<BR><BR>On 6/10/05, Torsten Sadowski <MOEHL@AKAFLIEG.EXTERN.TU-BERLIN.DE>wrote:<BR>&gt; Have a look at this. Maybe it does what you need.<BR>&gt; <BR>&gt; Torsten<BR>&gt; <BR>&gt; <BR>&gt; http://www.ices.utexas.edu/~jessica/software/index.html<BR>&gt; <BR>&gt; On Fri, 10 Jun 2005 syssboxx-vtk@yahoo.fr wrote:<BR>&gt; <BR>&gt; &gt; Hi vtk users,<BR>&gt; &gt; I have to visualize a head from contours of MRI images.I tried Delaunay from a txt file with set
 of points with coordinates.My object has concave and convexe regions,so for the convexes it gives a good results but for the others it's terrible!! (I jointed the result) Is there a way to apply some other filter after Delaunay for improve the result in the concaves. I tried also MarchingCubes applied on the volume with the contours but results are neither good.<BR>&gt; &gt; That's the best choice for this kind of object to get best result and the same time I want a mesh over the originaly points.<BR>&gt; &gt;<BR>&gt; &gt; Thanks for your suggestions<BR>&gt; &gt;<BR>&gt; &gt; Stanislava<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; ---------------------------------<BR>&gt; &gt; Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger<BR>&gt; &gt; Téléchargez le ici !<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; ---------------------------------<BR>&gt; &gt; Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger<BR>&gt;
 &gt; Téléchargez le ici !<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt;<BR>&gt; &gt; ---------------------------------<BR>&gt; &gt; Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger<BR>&gt; &gt; Téléchargez le ici !<BR>&gt; _______________________________________________<BR>&gt; This is the private VTK discussion list.<BR>&gt; Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ<BR>&gt; Follow this link to subscribe/unsubscribe:<BR>&gt; http://www.vtk.org/mailman/listinfo/vtkusers<BR>&gt; <BR><BR><BR>-- <BR>Tim Hutton - http://www.sq3.org.uk<BR></BLOCKQUOTE><p>
                <hr size=1> 
<b><font color=#FF0000>Appel audio GRATUIT</font> partout dans le monde</b> avec le nouveau Yahoo! Messenger<br> 
<a href="http://us.rd.yahoo.com/messenger/mail_taglines/yahoofr/*http://fr.messenger.yahoo.com">Téléchargez le ici !</a>