<div dir="ltr"><div>Unless you can rely on PIL being on the system search path yes.<br></div><div><br>In my case PIL is mostly optional so if you look closely you will see paths that avoid PIL if not present when Catalyst writes out cinema files.<br><br><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-881-4909</div></div>
<br><div class="gmail_quote">On Wed, Oct 12, 2016 at 2:22 PM, Albina, Frank <span dir="ltr"><<a href="mailto:frank.albina@sauber-motorsport.com" target="_blank">frank.albina@sauber-motorsport.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div link="blue" vlink="purple" lang="DE-CH"><div class="m_-2789504624012651538WordSection1"><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d" lang="EN-US">David,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d" lang="EN-US">this leads me to another question. Looking at file raster_wrangler.py in lib/paraview-5.1/site-<wbr>packages/paraview/cinemaIO, one tries to import PIL. However, even though numpy is provided by the SuperBuild, PIL is not. So I guess that I have to compile my own version of Python including PIL and pass it to the SuperBuild as system python installation. Is my assumption correct? Or have I been missing something?<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d" lang="EN-US">Cheers,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d" lang="EN-US"><br>Frank.<u></u><u></u></span></p><div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US"> ParaView [mailto:<a href="mailto:paraview-bounces@paraview.org" target="_blank">paraview-bounces@<wbr>paraview.org</a>] <b>On Behalf Of </b>Albina, Frank<br><b>Sent:</b> Mittwoch, 12. Oktober 2016 20:01<br><b>To:</b> David E DeMarle<br><b>Cc:</b> Del Citto, Francesco; <a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a></span></p><div><div class="h5"><br><b>Subject:</b> Re: [Paraview] Paraview python script: passing images to PIL (python image library)<u></u><u></u></div></div><p></p></div></div><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">David,<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">that’s excellent. <u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Thanks a lot.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d">Frank.</span><span style="font-size:8.0pt;font-family:"Arial","sans-serif";color:green" lang="EN-US"><u></u><u></u></span></p><p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"" lang="EN-US"> David E DeMarle [<a href="mailto:dave.demarle@kitware.com" target="_blank">mailto:dave.demarle@kitware.<wbr>com</a>] <br><b>Sent:</b> Mittwoch, 12. Oktober 2016 19:56<br><b>To:</b> Albina, Frank<br><b>Cc:</b> <a href="mailto:paraview@paraview.org" target="_blank">paraview@paraview.org</a>; Del Citto, Francesco<br><b>Subject:</b> Re: [Paraview] Paraview python script: passing images to PIL (python image library)<u></u><u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Look into the cinemaIO directory of ParaView. We move back and forth between paraview, numpy and PIL often there.<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">For example:<u></u><u></u></p></div><div><p class="MsoNormal">image = self.view.CaptureWindow(1)<u></u><u></u></p></div><div><p class="MsoNormal">ext = image.GetExtent()<u></u><u></u></p></div><div><p class="MsoNormal">width = ext[1] - ext[0] + 1<u></u><u></u></p></div><div><p class="MsoNormal">height = ext[3] - ext[2] + 1<u></u><u></u></p></div><div><p class="MsoNormal">imagescalars = image.GetPointData().<wbr>GetScalars()<u></u><u></u></p></div><div><p class="MsoNormal">idata = numpy_support.vtk_to_numpy(<wbr>imagescalars)<u></u><u></u></p></div><div><p class="MsoNormal">image.UnRegister(None)<u></u><u></u></p></div><div><p class="MsoNormal">imageslice = idata.reshape(height, width, 3)<u></u><u></u></p></div><div><div><p class="MsoNormal">imageslice = numpy.flipud(imageslice)<u></u><u></u></p></div><div><p class="MsoNormal">pimg = PIL.Image.fromarray(<wbr>imageslice)<u></u><u></u></p></div></div><div><div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">David E DeMarle<br>Kitware, Inc.<br>R&D Engineer<br>21 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: <a href="tel:518-881-4909" target="_blank">518-881-4909</a><u></u><u></u></p></div></div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Wed, Oct 12, 2016 at 1:42 PM, Albina, Frank <<a href="mailto:frank.albina@sauber-motorsport.com" target="_blank">frank.albina@sauber-<wbr>motorsport.com</a>> wrote:<u></u><u></u></p><div><div><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d" lang="EN-US">All,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d" lang="EN-US">A simple question: my incentive is to manipulate images using PIL in a pvbatch script. At the time being, I am writing the images to file in PNG format and reading the file again from disc using PIL. I have found out that the underlying image writing is performed by the vtkPNGWriter class and that this class allows to write to memory (vtkPNGWriter.<wbr>SetWriteToMemory). Hence my question: Is it possible to “write” a PNG file to memory so that I can process it further using PIL? If so, how shall I proceed?</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d" lang="EN-US">Thank you very much in advance.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d" lang="EN-US">Cheers,</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial","sans-serif";color:#1f497d" lang="EN-US">Frank.</span><u></u><u></u></p></div></div><p class="MsoNormal" style="margin-bottom:12.0pt"><br>______________________________<wbr>_________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br><br>Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/<wbr>ParaView</a><br><br>Search the list archives at: <a href="http://markmail.org/search/?q=ParaView" target="_blank">http://markmail.org/search/?q=<wbr>ParaView</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://public.kitware.com/mailman/listinfo/paraview" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/paraview</a><u></u><u></u></p></div><p class="MsoNormal"><u></u> <u></u></p></div></div></div></div></div></div></blockquote></div><br></div>