Sebastian,<br><br>thank you very much.<br>I used traces and it worked for me!<br><br><br>ula<br><br><div class="gmail_quote">On Thu, Mar 10, 2011 at 4:56 AM, Sebastien Jourdain <span dir="ltr"><<a href="mailto:sebastien.jourdain@kitware.com">sebastien.jourdain@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi Ula,<br>
<br>
you can use ParaView and with the python scripting interface, you<br>
should be able to automated that process for all your files.<br>
Start paraview, start python trace, do your processing for one file,<br>
do the capture, then show trace.<br>
This will show the python code that was needed for the whole process.<br>
Then, you will just need to change the reader filename, and request a<br>
new image capture for each new file that you may set inside a for loop<br>
in python.<br>
<br>
Seb<br>
<div><div></div><div class="h5"><br>
On Thu, Mar 10, 2011 at 12:25 AM, Ula Popov <<a href="mailto:ula.popov@gmail.com">ula.popov@gmail.com</a>> wrote:<br>
> Hello all,<br>
><br>
> I have 5000 cosmo files that I need to visualize and save each as a .png<br>
> file.<br>
><br>
> If I had one file, I'd<br>
> 1. open it in paraview<br>
> 2. choose glyph filter<br>
> 3. choose<br>
> vector : velocity<br>
> glyph type: arrow<br>
> color by: glyphVector<br>
> 4. press "reset" button<br>
> 5. adjust camera -> azimuth (XX)<br>
> 6. File->Save ScreenShot<br>
> 7. type "output_filename"<br>
><br>
> I need to automate this process, but I don't know how.<br>
> I do know how to read cosmo file into unstructured grid,<br>
> how to create a window, but i don't know how to set<br>
> all these parameters and save an image.<br>
><br>
><br>
> int main ()<br>
> {<br>
> vtkUnstructuredGrid *data;<br>
> vtkSmartPointer<vtkCosmoReader> reader =<br>
> vtkSmartPointer<vtkCosmoReader>::New();<br>
><br>
> reader->SetFileName("input_filename.cosmo");<br>
> reader->Update();<br>
> data = reader->GetOutput(0);<br>
><br>
> vtkSmartPointer<vtkUnstructuredGridGeometryFilter> geometryFilter =<br>
> vtkSmartPointer<vtkUnstructuredGridGeometryFilter>::New();<br>
> geometryFilter->SetInputConnection(data->GetOutputPort());<br>
> geometryFilter->Update();<br>
><br>
> //Create a mapper and actor<br>
> vtkSmartPointer<vtkDataSetMapper> mapper =<br>
> vtkSmartPointer<vtkDataSetMapper>::New();<br>
> mapper->SetInputConnection(geometryFilter->GetOutputPort());<br>
> vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();<br>
> actor->SetMapper(mapper);<br>
><br>
> // a renderer and render window<br>
> vtkRenderer *ren = vtkRenderer::New();<br>
> vtkRenderWindow *renWin = vtkRenderWindow::New();<br>
> renWin->AddRenderer(ren);<br>
><br>
> // an interactor<br>
> vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br>
> iren->SetRenderWindow(renWin);<br>
><br>
> // add the actor to the scene<br>
> ren->AddActor(actor);<br>
> ren->SetBackground(1,1,1); // Background color white<br>
><br>
> renWin->Render();<br>
><br>
> // begin mouse interaction<br>
> iren->Start();<br>
><br>
> ren1->Delete();<br>
> renWin->Delete();<br>
> iren->Delete();<br>
> return EXIT_SUCCESS;<br>
> }<br>
><br>
><br>
> Any ideas, suggestions, code examples are highly appreciated,<br>
> ula<br>
><br>
</div></div>> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Please keep messages on-topic and check the VTK FAQ at:<br>
> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
><br>
><br>
</blockquote></div><br>