OK, for me this means that I will use vtk observers, since I need a portable solution that runs on a default vtk installation.<br><br>@gobbi: could you please send me a short example, of how you use these observers in python?<br>
<br>nevertheless it would be nice to see this patch in some future vtk releases. If the only problem are these unreachable code warnings in windows, why can't you simply add some helper-functions that execute this otherwise unreachable code? Since I only use Linux I will not be able to test it for myself, but I can't imagine that none of the windows programmers could find a solution for this. perhaps you should give it another try and repost the patch to the developers list?<br>
<br>thanks to all for your help<br>I wish you what<br>FloB<br><br><br><div class="gmail_quote">On Sat, May 29, 2010 at 4:36 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.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 Charl,<br>
<br>
I've looked over the patch and I have one question. What happens when<br>
an python exception is thrown in a python observer callback? I didn't<br>
see any modifications to vtkPythonCommand, so I'm guessing that the<br>
error will just be printed (like it is now) and not fed back to the<br>
original caller.<br>
<font color="#888888"><br>
David<br>
</font><div><div></div><div class="h5"><br>
<br>
On Fri, May 28, 2010 at 4:43 PM, Charl Botha <<a href="mailto:c.p.botha@tudelft.nl">c.p.botha@tudelft.nl</a>> wrote:<br>
> Dear Florian and David,<br>
><br>
> On 28 May 2010 21:07, Florian Bruckner <<a href="mailto:e0425375@gmail.com">e0425375@gmail.com</a>> wrote:<br>
>><br>
>> is there a reason why the patch was not merged into the official vtk release?<br>
>><br>
>> i'm just wondering because that patch is fairly old and for me this seems to be a very good solution for a general problem.<br>
><br>
> The patch has a permanent home here:<br>
> <a href="http://code.google.com/p/devide/source/browse/trunk/johannes/patches/pyvtk_tryexcept_and_pyexceptions.diff" target="_blank">http://code.google.com/p/devide/source/browse/trunk/johannes/patches/pyvtk_tryexcept_and_pyexceptions.diff</a><br>
><br>
> Of course I think it's a good patch. :) It does the following:<br>
> 1. Turns all VTK errors into Python exceptions.<br>
> 2. Carefully releases the GIL during all calls into VTK (grabbing it<br>
> back for observers) so that you can successfully explicitly<br>
> multi-thread VTK pipelines from Python.<br>
> 3. Tries to trap bad_alloc.<br>
><br>
> I've been working on this for years, but due to Windows unreachable<br>
> code warnings that I have not been able to solve, I've never committed<br>
> this to VTK (it works, just gives many warnings during compilation).<br>
> My own binaries all have this patch integrated (DeVIDE [1] and VTK<br>
> [2]).<br>
><br>
> The current version is for 5.4.2, I'd like to update for 5.6 as soon<br>
> as I can figure out how to check out a clean 5.6 with git (until very<br>
> recently there was no tag yet, I see that it's there now!<br>
> <a href="http://vtk.org/gitweb?p=VTK.git;a=summary" target="_blank">http://vtk.org/gitweb?p=VTK.git;a=summary</a> )<br>
><br>
> I'm also considering to make a wiki page on <a href="http://devide.googlecode.com" target="_blank">devide.googlecode.com</a> that<br>
> documents the patch.<br>
><br>
> See you,<br>
> Charl<br>
><br>
> [1] <a href="http://graphics.tudelft.nl/Projects/DeVIDE" target="_blank">http://graphics.tudelft.nl/Projects/DeVIDE</a><br>
> [2] <a href="http://cpbotha.net/software/latest-vtk-windows-binaries/" target="_blank">http://cpbotha.net/software/latest-vtk-windows-binaries/</a><br>
><br>
><br>
>><br>
>> On Fri, May 28, 2010 at 4:07 PM, David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>> wrote:<br>
>>><br>
>>> Hi Florian,<br>
>>><br>
>>> I haven't seen mention of the patch here on the list, and I know<br>
>>> that it isn't in VTK 5.6 or in VTK devel. For my own apps, I use<br>
>>> VTK observers to catch reader errors.<br>
>>><br>
>>> David<br>
>>><br>
>>><br>
>>> On Fri, May 28, 2010 at 12:52 AM, Florian Bruckner <<a href="mailto:e0425375@gmail.com">e0425375@gmail.com</a>> wrote:<br>
>>> > hi,<br>
>>> ><br>
>>> > I just figured out the problem that no python exceptions are raised if<br>
>>> > my reader produces an error. I use vtk-5.6.<br>
>>> ><br>
>>> > after searching the net and the mailing list I found that there are some<br>
>>> > patches available<br>
>>> > (turn-vtk-errors-into-python-exceptions-and-catch-bad-malloc patch)<br>
>>> > which should solve this problem. Unfortunately I could neither find such<br>
>>> > a patch for vtk-5.6 nor any actual posts about this topic.<br>
>>> ><br>
>>> > So should this patch allready be included in the new vtk-5.6? or where<br>
>>> > can I get it otherwise? are there any reasons why the patch is not<br>
>>> > included in the official release? or is there another work around that<br>
>>> > is proposed for this kind of problems?<br>
>>> ><br>
>>> > thanks<br>
>>> > FloB<br>
>><br>
>><br>
>> _______________________________________________<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/opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the VTK FAQ at: <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>
><br>
><br>
> --<br>
> dr. charl p. botha :: <a href="http://graphics.tudelft.nl/CharlBotha" target="_blank">http://graphics.tudelft.nl/CharlBotha</a><br>
> work: <a href="mailto:cpbotha@medvis.org">cpbotha@medvis.org</a> personal: <a href="mailto:cpbotha@cpbotha.net">cpbotha@cpbotha.net</a><br>
><br>
> See our latest papers on shape spaces, brain connectivity, shoulder<br>
> segmentation, human motion analysis, voxel classification and eye fat<br>
> deformation! <a href="http://graphics.tudelft.nl/Publications/2010" target="_blank">http://graphics.tudelft.nl/Publications/2010</a><br>
><br>
</div></div></blockquote></div><br>