<DIV>Hi Tim,</DIV>
<DIV> </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 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> </DIV>
<DIV>Here is the code that i use:</DIV>
<DIV> </DIV>
<DIV><FONT size=2>
<P>#include <vtkPolyData.h></P>
<P>#include <vtkPoints.h></P>
<P>#include <vtkPolyDataMapper.h></P>
<P>#include <vtkActor.h></P>
<P>#include "vtkPowerCrustSurfaceReconstruction.h"</P>
<P>#include <vtkRenderer.h></P>
<P>#include <vtkRenderWindow.h></P>
<P>#include <vtkWindowToImageFilter.h></P>
<P>#include <vtkPNGWriter.h></P>
<P>#include <vtkProperty.h></P>
<P>#include <vtkCamera.h></P>
<P>#include "vtkRenderWindowInteractor.h"</P>
<P> </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", &x, &y, &z);</P>
<P>points->InsertPoint(iCounter++, x, y, z);</P>
<P>}</P>
<P>data->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-> SetInput(data); </P>
<P>vtkActor *rawpointsactor=vtkActor::New();</P>
<P>rawpointsactor ->SetMapper( rawpointsmapper);</P>
<P>rawpointsactor ->GetProperty()-> SetColor( 0, 0, 0);</P>
<P>rawpointsactor ->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 -> SetInput(data);</P>
<P>vtkPolyDataMapper *map=vtkPolyDataMapper::New();</P>
<P>map -> SetInput (surf ->GetOutput());</P>
<P>vtkActor *surfaceActor=vtkActor::New();</P>
<P>surfaceActor -> SetMapper (map);</P>
<P>surfaceActor ->GetProperty()-> SetDiffuseColor (1.0000, 0.3882, 0.2784);</P>
<P>surfaceActor ->GetProperty()-> SetSpecularColor (1, 1, 1);</P>
<P>surfaceActor ->GetProperty()-> SetSpecular (.4);</P>
<P>surfaceActor ->GetProperty()-> SetSpecularPower( 50);</P>
<P>surfaceActor ->SetScale(1.0,1.0,25);</P>
<P>// render the medial surface into a third renderer</P>
<P>surf-> Update(); </P>
<P>// (because GetMedialSurface is not part of the normal pipeline)</P>
<P>vtkPolyDataMapper *medialmapper=vtkPolyDataMapper::New();</P>
<P>medialmapper -> SetInput (surf ->GetMedialSurface());</P>
<P>medialmapper ->ScalarVisibilityOff();</P>
<P>vtkActor *medialactor=vtkActor::New();</P>
<P>medialactor -> SetMapper( medialmapper);</P>
<P>medialactor ->GetProperty()-> SetDiffuseColor (0.1000, 0.8882, 0.2784);</P>
<P>medialactor ->GetProperty()-> SetSpecularColor (1 ,1, 1);</P>
<P>medialactor ->GetProperty()-> SetSpecular (.4);</P>
<P>medialactor ->GetProperty()-> SetSpecularPower (50);</P>
<P>medialactor ->GetProperty()-> SetRepresentationToWireframe();</P>
<P>medialactor ->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 ->AddRenderer( ren1);</P>
<P>renWin ->AddRenderer (ren2);</P>
<P>renWin ->AddRenderer (ren3);</P>
<P>renWin ->SetSize (1000 ,1000);</P>
<P>// Add the actors to the renderer</P>
<P>ren1-> AddActor (rawpointsactor);</P>
<P>ren2 ->AddActor (surfaceActor);</P>
<P>ren3 ->AddActor (medialactor);</P>
<P>// set the properties of the renderers</P>
<P>ren1 ->SetBackground (1, 1, 1);</P>
<P>ren1 ->SetViewport (0.0 ,0.0, 0.33, 1.0);</P>
<P>ren1 ->GetActiveCamera() -> SetPosition (1, -1 ,0);</P>
<P>ren1 ->ResetCamera();</P>
<P>ren2 ->SetBackground (1, 1, 1);</P>
<P>ren2 ->SetViewport (0.33 ,0.0, 0.66, 1.0);</P>
<P>ren2 ->GetActiveCamera() -> SetPosition (1 ,-1, 0 ); </P>
<P>ren2 ->ResetCamera();</P>
<P>ren3 ->SetBackground (1, 1, 1);</P>
<P>ren3 ->SetViewport (0.66 ,0.0 ,1.0, 1.0);</P>
<P>ren3 ->GetActiveCamera() ->SetPosition (1 ,-1, 0);</P>
<P>ren3 ->ResetCamera();</P>
<P>vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();</P>
<P>iren->SetRenderWindow(renWin);</P>
<P>//render the image</P>
<P>renWin ->Render();</P>
<P>iren->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 ->SetInput ( renWin);</P>
<P>vtkPNGWriter *to_png=vtkPNGWriter::New();</P>
<P>to_png-> SetFileName ("TestPowerCrust.png");</P>
<P>to_png ->SetInput(to_image-> GetOutput());</P>
<P>to_png -> Write();</P>
<P>return EXIT_SUCCESS;</P>
<P>}</P>
<P>Regards,</P>
<P>Stanislava</P>
<P> </P>
<P> </P>
<P> </P></FONT><BR><BR><B><I>Tim Hutton <tim.hutton@gmail.com></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>> Have a look at this. Maybe it does what you need.<BR>> <BR>> Torsten<BR>> <BR>> <BR>> http://www.ices.utexas.edu/~jessica/software/index.html<BR>> <BR>> On Fri, 10 Jun 2005 syssboxx-vtk@yahoo.fr wrote:<BR>> <BR>> > Hi vtk users,<BR>> > 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>> > 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>> ><BR>> > Thanks for your suggestions<BR>> ><BR>> > Stanislava<BR>> ><BR>> ><BR>> ><BR>> ><BR>> > ---------------------------------<BR>> > Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger<BR>> > Téléchargez le ici !<BR>> ><BR>> ><BR>> ><BR>> > ---------------------------------<BR>> > Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger<BR>>
> Téléchargez le ici !<BR>> ><BR>> ><BR>> ><BR>> ><BR>> > ---------------------------------<BR>> > Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger<BR>> > Téléchargez le ici !<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>-- <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>